Next: , Previous: ABC, Up: Top


Third-party software integration

Surmulot ships with two Python-based packages, athenaCL (http://www.flexatone.org/article/athenaCLMain) and music21 (http://mit.edu/music21/).

There are pre-installed, you only need a Python interpreter in your system (get version 2.7 here: http://www.python.org/).


Interactive usage

Start either of them from the Surmulot menu, under the “Interaction” submenu. You will be presented with a Python REPL buffer. The documentation for both packages is also available from the Surmulot menu, under submenu "Documentation”.

Both systems make it possible to build and save MIDI files. The Emacs REPL should detect any command output relative to the creation of a new MIDI file, and handle this file accordingly. By default, it is send to the muO image within a graphical editor. The behavior can be changed by customizing variable surmulot-midi-file-handler.

In athenaCL, the commands PIh, ELn, ELw and ELv are supported.

In music21, the .write('midi') method call is supported.


Programmatic usage

The Emacs Lisp functions 'surmulot-music21 and 'surmulot-athenaCL set up a Python session and evaluate their arguments as commands. When done, the Python session is exited.

Provided that you have a Python interpreter installed, the following examples should work out-of-the-box and give you musical phrases in the muO Emacs flap:

     (surmulot-music21 "corpus.parseWork('bach/bwv7.7').write('midi')")
     
     (surmulot-music21
       "tinyNotation.TinyNotationStream('c4 d8 f g16 a g').write('midi')")
     
     (surmulot-athenaCL
       "emo mp
        tin a 36
        tie r pt,(c,2),(bg,oc,(7,5,2,1,1)),(c,1)
        tin b 37
        tie r pt,(c,4),(bg,rp,(3,3,5,4,1)),(bg,oc,(0,1,1))
        tin c 42
        tie r pt,(c,2),(c,1),(bg,oc,(0,1))
        eln")