[last updated: 2019-11-28]
raspberry Pi home page
Midi home page
Midi: links
-----
- Sonic-pi is a program included in the rPi distro (menu > Programming > Sonic-pi). It has music editing features and seems to be geared mostly to live performance.
However it can control my Concertmate Midi keyboard, though almost all the documentation and tutorials as I said are related to live performance, so there's a lot of digging needed to figure out how to manipulate the keyboard. But I persevere...
- When you click "run" in upper left, whatever code is in the window will execute one time.
However if you have a do-loop, it effectively runs until you stop it.
- Turning notes on and off:
- Minimal command to turn on a note:
midi_note_on :e3 [volume] ... not sure range of volume parameter, est 0 - 100 decimal or so...
:e3 is "e" note, 3rd octave
It is equivalent to specify it as 52 (52nd key on a standard keyboard)
ie: midi_note_on 52 [volume]
- :es3 will play "e3 sharp" (equivalent to note #53), and
:eb3 will play "e3 flat" (equivalent to note #51)
- It isn't required to use whole numbers to specify a note.
midi_note_on 52.35 ... is valid too.
- When you've turned on a note, it will stay on until you turn it off.
You can turn it off with either:
midi_note_off [noteID] ... or
midi_note_on [noteID] 0 ... which specifies zero volume
- To specify how long you want the note to stay on before turning off,
insert 'sleep' command between the on command and the off command:
- midi_note_on 52 50
sleep 0.5
midi_note_off 52
- (I think) Units of sleep parameter are "whole beats" (however and wherever they're specified...)
- Programming Structures:
.
.
.
eof