Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

Powerfull Midi manipulation Ruby library

Post any examples or modules that you want to share here

Re: Powerfull Midi manipulation Ruby library

Postby tulamide » Fri Sep 24, 2021 10:05 pm

aefa wrote:I know this is an old post but, did anyone ever got anything out of this lib? All I can do is read the file make a sequence or a MIDIFile but I can't figure out how to parse events and tracks out of it! :(

The MIDI reader is already parsing. It identifies note on/off, cc, sysex, etc. and triggers a method for each of these. For example, when it encounters a note on it triggers
note_on(allvalues you need, like velocity, channel, etc.)

So, in your RubyEdit you create a

def note_on(allvalues you need, like velocity, channel, etc.)
##your code handling this note_on goes here##
end

Look for NoP in the library, between start NoP and end NoP comments are all the methods you can use as I described above. Make sure your definition has the exact same amount of arguments, and it should work just fine.

In the same way you also get global data, like tempo, signature, number of tracks, etc.

I'm afraid you have to read all the comments in the library, as they explain how to use all the methods. But I think my explanation above about YOU creating a method definition in YOUR RubyEdit, matching the method that gets triggered by the parser, was the missing link?
If you feel like gifting: https://paypal.me/tulamide
tulamide
 
Posts: 2514
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Powerfull Midi manipulation Ruby library

Postby aefa » Sat Sep 25, 2021 8:42 am

tulamide wrote:
aefa wrote:I know this is an old post but, did anyone ever got anything out of this lib? All I can do is read the file make a sequence or a MIDIFile but I can't figure out how to parse events and tracks out of it! :(

The MIDI reader is already parsing. It identifies note on/off, cc, sysex, etc. and triggers a method for each of these. For example, when it encounters a note on it triggers
note_on(allvalues you need, like velocity, channel, etc.)

So, in your RubyEdit you create a

def note_on(allvalues you need, like velocity, channel, etc.)
##your code handling this note_on goes here##
end

Look for NoP in the library, between start NoP and end NoP comments are all the methods you can use as I described above. Make sure your definition has the exact same amount of arguments, and it should work just fine.

In the same way you also get global data, like tempo, signature, number of tracks, etc.

I'm afraid you have to read all the comments in the library, as they explain how to use all the methods. But I think my explanation above about YOU creating a method definition in YOUR RubyEdit, matching the method that gets triggered by the parser, was the missing link?


Thank you very much tulamide! I'm not very good at programming but I'll get into it! I was reading the procedures up and down and totally didn't understand the reason for the NoPs. I'll post the progress (if any) :)
aefa
 
Posts: 34
Joined: Wed Mar 26, 2014 12:52 pm

Previous

Return to User Examples

Who is online

Users browsing this forum: No registered users and 8 guests

cron