how to send Midi Message

For general discussion related FlowStone
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

how to send Midi Message

Post by Walter Sommerfeld »

Hi FS users,

i need some help - again...

dunno how i get this Midi Message send in my attached schematic - please have a look!

Keep on Doing!
Walter

P.S.: I left a little gimmick as a thank U => did u found it :)
Attachments
send midi Message + gimmick.fsm
(61.53 KiB) Downloaded 1065 times
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to send Midi Message

Post by tulamide »

There is no midi message. The string @message is just a visualization of an address in RAM, where a midi object once was created by Ruby.
"There lies the dog buried" (German saying translated literally)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: how to send Midi Message

Post by billv »

Not sure if it helps you Walter...
But I got a result in the Midi Analizer by adding "Midi.new"....
SysEx F0..F7 11 bytes

Code: Select all

def init
   @message = []
end

def event i,v,t
   if i==0
      @message = Midi.new "#<Midi:0x1b21526c>"
      output 0,@message,t #ime
   end
end
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: how to send Midi Message

Post by Walter Sommerfeld »

@tulamide: I thought so.

@billv: nice idea but - see tulamide's answer...
btw: How are u dude?! Newest project of yours?

Is there a way in FS to record and save/reload Midi sequences?

P.S.: I also need CC's and timing recorded 2 (not only notes)
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to send Midi Message

Post by tulamide »

Walter Sommerfeld wrote:Is there a way in FS to record and save/reload Midi sequences?

P.S.: I also need CC's and timing recorded 2 (not only notes)


Yes, there is. The critical part is the timing. If you are recording premade sequences from the DAW, then you can use the ppq info for the timing. If not, you can only use Ruby's timing, which is reliable down to 10ms.

The basics of a recording are simple. Everything in Ruby is an object, so you can just add the incoming midi object, together with the timing info, to an array. For saving/loading you can use Ruby's marshalling.

I don't have the time to make a demo, but you can find an example of marshalling in my ACM (advanced color manager), where it is used to save the user defined color palettes. Only difference is that you wouldn't save/load on schematic saving/loading, but through some trigger (probably an open/save-dialog).
"There lies the dog buried" (German saying translated literally)
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to send Midi Message

Post by tulamide »

I'm very sorry, I just realized that I used marshalling in Apex, where you don't have access to the code. In ACM only the standard schematic marshalling (loadState, saveState) is used.
"There lies the dog buried" (German saying translated literally)
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: how to send Midi Message

Post by Walter Sommerfeld »

Yeah - i heard about the 'Marshall' routine but didn't had the time to look into it...

Maybe someone here can enlighten me and/or give me some good links 4 more info...


Thanks in advance!
Walter

btw: will have a look into ur ACM...
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to send Midi Message

Post by tulamide »

My source of choice for Ruby is always ruby-doc.org

Here are 2 pages that you need to use marshalling and saving/loading:
http://ruby-doc.org/core-1.9.3/Marshal.html
http://ruby-doc.org/core-1.9.3/IO.html

On the first page you'll want to read everything, but the keywords are dump and load
On the second page you'll be interested in binread and binwrite

Combined it is really easy to create files that contain the current state of any object, for example:

Code: Select all

IO.binwrite("myfilename.myending", Marshal.dump(myobject))
# writes a serialized binary version of myobject to the file myfilename.myending


Code: Select all

myobject = Marshal.load(IO.binread("myfilename.myending"))
# loads back the serialized object from the file
"There lies the dog buried" (German saying translated literally)
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: how to send Midi Message

Post by Walter Sommerfeld »

Thanks Tom => really appreciate your help!

Had a look there already now and i'll give it a go... ;-)

Cheers,
Walter

=> done - It works like a charm :)
U saved my day!
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to send Midi Message

Post by tulamide »

Walter Sommerfeld wrote:=> done - It works like a charm :)
U saved my day!

GREAT! Nice to have feedback, and impressive that you could work it out without real demos!
"There lies the dog buried" (German saying translated literally)
Post Reply