diff options
Diffstat (limited to 'config.rhai')
-rw-r--r-- | config.rhai | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/config.rhai b/config.rhai index 513e34f..07c4bb3 100644 --- a/config.rhai +++ b/config.rhai @@ -1,10 +1,17 @@ const PM_DEVICE_ID = 0; fn pm_note_played(channel, note, vel) { + print(channel); + if channel <= 4 { + channel = 0; + } pm_play_note(channel, note, vel); } fn pm_note_released(channel, note, vel) { + if channel <= 4 { + channel = 0; + } pm_release_note(channel, note); } @@ -26,10 +33,16 @@ fn pm_control_changed(channel, controller, value) { } print("setting metronome to " + bpm); pm_set_metronome(60, bpm, 1.0); + } else if controller == 51 { + if value == 127 { + pm_start_midi_recording(); + } else { + pm_stop_midi_recording(); + } } } pm_load_soundfont("/etc/alternatives/default-GM.sf3"); -pm_load_preset(0, 299); -pm_load_preset(9, 102); -pm_load_preset(16, 102); +pm_load_preset(-1, 299); // default = piano +pm_load_preset(9, 102); // drum pad +pm_load_preset(16, 102); // metronome |