Midi notes can't stop - Digiton Elektron [solved - probably issue from Elektron]

Hi !

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.

1 Like

thanks @robin.newman

live_loop :channel_01 do
  ##| stop
  midi [:c, :e, :f].tick, channel: "1", sustain: 1
  sleep 4
  
end

# bd
live_loop :channel_02 do
  ##| stop
  midi_note_on [:c5].choose, channel: "1", sustain: 0.5
  sleep 0.5
  midi_all_notes_off
end

so when do you use midi_note_on ? and why in the channel_02 loop midi_all_notes_off doesn’t stop the notes ?

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

You can see this used in my polysynth program two versions

immediately after your midi_all_notes_off command you start the loop again and it restarts the note!

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

Hmm It should work. Work’s fine here using SP driving Qsynth. Maybe elektron digitone doesn’t respond to the midi_all _notes_off command.

1 Like

so i duckduckgo for a hypothetic problem from elektron, https://www.elektronauts.com/t/digitone-digitone-keys-1-21-bug-reports/96850/89
and read this
" The Digitone doesn’t understand the CC123 message “all notes off”, that’s why it is not compatible with most of the sequencers. "
so i use midi :slight_smile:

1 Like

just to add that it works with midi_note_off

# 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 !!!

cheers

2 Likes