Capturing the pitch band message by Ruby - Is there a way?

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

Capturing the pitch band message by Ruby - Is there a way?

Post by kortezzzz »

http://imgur.com/a/mcz20

Hi people.
Found some free time to try solving this old time problem I have:
I'm still trying to pass a manipulated midi signal (by using Ruby) to the outside world through a virtual midi cable without loosing the pitchband message that being created during playing the keyboard. The first code in the picture manipulates the message fine, but I have no idea how to make ruby pass the pitch messages as well :cry:

So I just thought maybe there is a creative way to connect both manipulated and original midi signals to a second ruby module and then isolate only the pitch messages from the original signal, while keeping the manipulated un-touched. When done, the ruby module would create a new midi array that would pass the total results (manipulated notes+pitchband messages) out to the cable.

Any chance that its possible? What would be the code then (I tried so many suggestions allready - yet no luck)? Thanks :)
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Capturing the pitch band message by Ruby - Is there a wa

Post by tulamide »

kortezzzz wrote:When done, the ruby module would create a new midi array that would pass the total results (manipulated notes+pitchband messages) out to the cable.

That sentence doesn't make sense. MIDI is a serial protocol. All messages come in and go out one after the other. So, hitting a key and moving the pitchbend wheel simultanously creates two discrete messages.

Seperating pitch bend from the rest of the stream is simple. The status byte is 224 + midi channel (0-based). 224 = pitchbend on channel 1, 239 = pitchbend on channel 16

You just have to check for the status byte to be in that range and then output to another midi stream. Find an example attached. I'm sure you'll figure out the rest ;)
Attachments
Filter_Pitchbend.fsm
(435 Bytes) Downloaded 979 times
"There lies the dog buried" (German saying translated literally)
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Capturing the pitch band message by Ruby - Is there a wa

Post by kortezzzz »

Damn yeah, tula, you did it again! :D
God, I was after a solution for so long...
Works perfectely here. THANKS MAN 8-)
Post Reply