Stuck midi notes; Maybe Ruby may fix it?

For general discussion related FlowStone
Post Reply
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Stuck midi notes; Maybe Ruby may fix it?

Post by kortezzzz »

Its kinda old bug that never fixed: FS's midi inputs and modules doesn't support "All notes off" massage, so maybe there would be a Ruby alternative to add before the midi input prim' to kill sustained notes when switching between
midi inputs or changing midi pitches instantly? So far, couldn't find a solution for that with green :?
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by KG_is_back »

This has been discussed before. We have tried several approaches. One was, to send note-off massages to all notes, but that created massive CPU spike and even considerable LAG. Then I tried different approach - to save midi-number of notes that are on and delete them when they get off. Then a trigger input may be used to turn off all notes that are on.
At that time I was total noob at ruby, but now I made it in 5 minutes. Here's the code:

the module should have first input for midi in and second for a green trigger and one midi output. And also it doesn't pass midi through - you have to put it in parallel with your midi chain.

Code: Select all

def init
@notes=[]
end

def event i,v,t
#process incoming midi
if i==0
note=@ins[0].to_array
   #midi note on - save to array
   if note[0]==144
   @notes << [note[1],note[2]]
   end
   if note[0]==128
   @notes.delete([note[1],note[2]])
   end

end
#when all notes off trigger is received
if i==1
   @notes.each{|note|
#create new midi off message with respective channel and pitch
   out=Midi.new 128,note[0],note[1],100
   output 0,out,t
   }
   @notes=[]
end

end

tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by tulamide »

Totally off-topic, but I just couldn't resist :lol:

kortezzzz wrote:..."All notes off" massage...

KG_is_back wrote:...send note-off massages to all notes...


You both are in such loving care for your notes! Yes, I heard that cows given a massage shall result in much more tasty steaks, but do notes really sound better after a massage? :mrgreen:
"There lies the dog buried" (German saying translated literally)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by KG_is_back »

xD totally didn't noticed that :-D off course - everything and everyone sounds better after a massage...
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by kortezzzz »

:)

Well, I'm still getting never ending pampering massage from my stuck notes here... :lol: Maybe because they are
are scared to death from the option to be killed? Poor notes, they will do anything to survive :|

Unfortunately, your concept, @KG, doesn't works here. Tried to connect your code in so many ways without success. Thanks anyway.
Maybe we better forward another reminder to Malc? This bug probably should be fixed, not "bypassed".
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by Nubeat7 »

works as suspected.. just add the module output to the desired midiconnection

but a note to malc to accept the "all notes off" message would be good, this really is a basic midi function which should work!
Attachments
all notes off.fsm
(8.44 KiB) Downloaded 1004 times
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Stuck midi notes; Maybe Ruby may fix it?

Post by kortezzzz »

Yes, it works now. Thanks guys. My problem was that when feeding few midi outputs with a midi input straight from a selector, its wasn't responding to change from 1 to 0. The "changed" primitive did the trick. :)
Post Reply