Browse files

MIDI - extract to new namespace and hugely improve API

Now with support for:

* midi clocks
* cc messages
* mode selection
* channel messages
  • Loading branch information...
1 parent dde0c77 commit 32b0445f8a76060bd7fe2bc5043d98c074b925a9 @samaaron committed Jan 11, 2017
Showing with 542 additions and 76 deletions.
  1. +541 −0 app/server/sonicpi/lib/sonicpi/lang/midi.rb
  2. +1 −76 app/server/sonicpi/lib/sonicpi/lang/sound.rb
Oops, something went wrong.

2 comments on commit 32b0445


Just a note - the final API will include a way to specify a set of matchers on which MIDI devices to send the message on.

rbnpi commented on 32b0445 Jan 12, 2017 edited

I've linked the new midi module into server.rb (require_relative and the klass.send call) and runtime.rb and preparser.rb (require_relative) (not done a doc link yet) and tried out some of the commands. I found that the midi :e1, dur: 0.1 gave a runtime error looking for __sched_ahead_time
I added

    def __current_sched_ahead_time

to the runtime.rb file (just after def __current_sched_at_time) and this got it working. Works great playing a synth on my iPad!
{Now added in the documentation as well (require_relative "../sonicpi/lib/sonicpi/lang/midi in qt-doc.rb)}

Please sign in to comment.