Git Product home page Git Product logo

alda-mode's Introduction

Alda Mode

http://melpa.org/packages/alda-mode-badge.svg

The best way to edit your alda files in Emacs!

Alda mode is a simple mode to provide syntax highlighting and other basic language features for Alda,the music programming language written in Clojure.

http://i.imgur.com/lRAA27L.png

Installation

The easiest way to install alda-mode is through melpa. Simply M-x package-install alda-mode.

Once installed, place (require 'alda-mode) in your init.el.

For evil integration, simply install evil before alda-mode.

Alda files (.alda extension) should now have syntax highlighting via font-lock-mode when opened.

If melpa won’t work for you, M-x package-install-file alda-mode.el from this repository instead.

Usage

alda-mode can play segments of alda from within Emacs! Simply highlight a section of alda code and run:

M-x alda-play-region

This will take a while during the first call, which will start the alda server within Emacs (if not already on your system). alda will need to be on your path.

If you want to use a custom alda binary, set alda-binary-location to your alda binary. Ex: (setq alda-binary-location "/usr/local/bin/alda")

Keep in mind, the server will only see the selection you make, and this has consequences. For example, you must run a snippet of code defining an instrument before you hear anything (or defining a marker before using it). alda-play-region will use a running alda server if it finds one, but will start one within Emacs if not found. Support is currently only tested under Linux for this command. Mac will probably work depending on your emacs install.

Please submit any bugs with this feature as issues to this repository.

Evil Integration

Evil integration is automatically applied if you install evil before alda-mode. If you are installing evil after alda-mode, please reinstall/recompile alda-mode.

(package-install 'evil)
(package-install 'alda-mode)
(require 'alda-mode)

This will make a evil operator called alda-evil-play-region, defined when you require evil. If evil was not installed, this is replaced with a warning message.

Keybindings

alda-mode adds a couple simple keybindings by default. These are documented below:

KeybindFunctionExplanation
C-c C-ralda-play-regionPlays selected text
C-c C-calda-play-blockPlays the paragraph on point
C-c C-nalda-play-linePlays a single line
C-c C-balda-play-bufferPlays the entire buffer, as text (not as a file)

Here are some simple example keybinds for evil integration (or if you want to add your own custom keybindings):

(global-set-key (kbd "C-c a") 'alda-play-region) ;; Global alda-play-map
;; Requires evil integration
(define-key evil-motion-state-map "gp" 'alda-evil-play-region)

This will map C-c a to play a selected region, and gp to be an evil operator to do the same thing! (gpp will play the current line, gp20j plays 20 lines, etc).

Contributing

If you find a bug or want to improve alda-mode, submit a PR! =)

License

alda-mode is licensed under the GPLv3.

alda-mode's People

Contributors

jgkamat avatar purcell avatar syohex avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.