Someone lends me a fantastic elektron digitone machine so try to control it with spi.
i meet the issue that notes are kept be playing…
# elektron meets sonic pi
# utilisation du midi avec Elektron Digiton
use_midi_defaults port: "elektron_digitone_midi_1"
with_fx :compressor do
live_audio :goo_01, stereo: true, input:1
end
live_loop :channel_01 do
stop
midi_note_on [:c, :e, :f].tick, channel: "1", sustain: 0.5
sleep 4
end
# bd
live_loop :channel_02 do
##| stop
midi_note_on [:c2, :c3].choose, channel: "2", sustain: 0.5
sleep 0.5
midi_all_notes_off
end
live_loop :channel_03 do
stop
midi_note_on [:g, :a, :b,:c5].tick , channel: "3", sustain: 1
sleep 0.25
end
# snare
live_loop :channel_04 do
#stop
midi_note_on :c2, channel: "4", sustain: 2
sleep 2
end
If someone has an idea, let me know. with Orca no problem to stop the notes… I must miss something or my midi system built from sources is not fully correct… midi logs somewhere ?
Try just using midi [:c2, :c3].choose, channel: "2", sustain: 0.5
rather than using midi_note_on. This will automatically send a midi_note_off for you.
At the moment a couple of your loops send a midi_note on without any corresponding midi_note_off
See the entry for midi in the lang section of the help files.
You use midi_note_on when you want to start a note, and leave it playing.
At some later point in the program, you can decide to turn it off, either by using midi_note_off, or in the case of some devices midi_note_on with the velocity setting as zero
ok my code was pretty stupid (or the man who types it) but the following code should work but it doesn’t, the c5 never ends
use_midi_defaults port: "elektron_digitone_midi_1", channel: "1"
# a midi_note_off is auto sent
midi :c2
# we have to send a midi_note_off
midi_note_on :c5, sustain: 0.5
sleep 1
midi_all_notes_off
stop
# elektron meets sonic pi
# utilisation du midi avec Elektron Digiton
use_midi_defaults port: "elektron_digitone_midi_1", channel: "1"
# note off is auto sent
midi :c2
midi_note_on :c5, sustain: 0.5
sleep 1
midi_all_notes_off # nope elektron ignores this midi message... bug...
sleep 1
midi_note_off :c5 # yes !!!