We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Processing MIDIFILE reading support
Page Index Toggle Pages: 1
Processing MIDIFILE reading support (Read 4410 times)
Processing MIDIFILE reading support
Jan 13th, 2010, 9:22pm
 
Hello my name is Faust,
I am new to processing, just started now to learn it. I am an electronic music producer so what really interest me is how processing interact with midi. I downloaded rwmidi library. I would like to ask you to help me a littlebit starting using midi in processing, simple code examples will be really welcome.

What I want to do is starting with a very simple midi file in which only 2 notes are played ( C3 - G3 ). here attached file. So when C3 is played a circle is drawn and when G3 is played a line is drawn.

ww.sendspace.com/file/r6tlhx

thanks in advance

Dr Faust

PS. it seems I can't add a proper link on my message...am I wrong?
Re: New to processing - need help about midi
Reply #1 - Jan 14th, 2010, 9:17am
 
if not code examples, links or just simple advices are welcome too Roll Eyes

Smiley
Re: New to processing - need help about midi
Reply #2 - Jan 14th, 2010, 10:37am
 
neither rwmidi or the two midi libraries in the processing libraries docs appear to be able to read midi files - all take their data from midi events generated by actual devices.

there is this:

http://processing.org/discourse/yabb2/num_1240555854.html

and this

http://processing.org/discourse/yabb2/num_1253105559.html

(i just googled for 'processing read midi file')

(and you can't post links until you've posted several (5) comments. the restriction is there to reduce spam.)
Re: New to processing - need help about midi
Reply #3 - Jan 15th, 2010, 7:27am
 
So probably the only solution is to create a virtual midi player or instrument that stream midifile data to processing.
or convert midifile into XML file..???
or just code in java a midifile reader.
any ideas are welcome, but I don't think I can code it.
thanks for your reply.

Dr Faust
Re: New to processing - need help about midi
Reply #4 - Jan 15th, 2010, 8:08am
 
yes, it looks like you need a sequencer that'll take your file and generate midi events that you can feed into the program. http://en.wikipedia.org/wiki/List_of_MIDI_editors_and_sequencers

or, parse the file yourself. there are plenty of references that'll tell you what the bits mean, but as with all these things, there's more to it than you think - http://www.sonicspot.com/guide/midifiles.html

or convert the file into a friendlier format and use that.
Re: New to processing - need help about midi
Reply #5 - Jan 15th, 2010, 9:46am
 
my idea was to create a simple videoclip (avi) for an electronic music track using its midi arrangement, so that video is perfectly synchronized to audio.
well, I am a cubase user and I can output midi data to my audio interface but I don't know if it's possible pointing to processing.
I studied a little about Java few years ago, but I'm not good coder. there's a specific class to read midifile in java:

java.sun.com/j2se/1.4.2/docs/api/javax/sound/midi/spi/MidiFileReader.html

maybe someone can code it for me?  Roll Eyes

Re: New to processing - need help about midi
Reply #6 - Jan 15th, 2010, 10:15am
 
something like this should work? or not?

jsresources.org/examples/MidiFileInfo.java.html
Re: New to processing - need help about midi
Reply #7 - Jan 15th, 2010, 11:00am
 
kun wrote on Jan 15th, 2010, 9:46am:
I can output midi data to my audio interface but I don't know if it's possible pointing to processing.


I did that using the ProMidi library. With it, Processing can listen to midi events in real-time.
Re: New to processing - need help about midi
Reply #8 - Jan 15th, 2010, 12:15pm
 
Now that I'm thinking about it, I remember that I used MidiYoke (Windows only) to emulate MIDI inputs.

The idea is to route the MIDI signals from the audio software to a virtual MIDI input that you can listen to in Processing.

I did that to sync audio and video effects (e.g. blur the image when putting some reverb) and it worked pretty well. You can find the source in this other thread:
http://processing.org/discourse/yabb2/num_1240680619.html
Re: New to processing - need help about midi
Reply #9 - Jan 15th, 2010, 11:59pm
 
Dear Antiplastik,
thanks a lot for your reply and interest in my issue.
it should work.
I'll try it and report result.

regards

Dr Faust
Re: New to processing - need help about midi
Reply #10 - Feb 5th, 2010, 8:18am
 
thanks for advices...it seems not very easy working with midifiles in processing ...if someone have any news about library that support midifile reading please forward me.

kind regards

dr faust
Re: Processing MIDIFILE reading support
Reply #11 - Feb 8th, 2010, 12:52pm
 
Have you seen this example code?

docjar.com/html/api/javax/sound/midi/MidiSystem.java.html
Re: Processing MIDIFILE reading support
Reply #12 - Feb 8th, 2010, 5:14pm
 
I've used MidiYoke too and it worked fine for my purposes...
Re: Processing MIDIFILE reading support
Reply #13 - Feb 13th, 2010, 3:03pm
 
Nordtec wrote on Feb 8th, 2010, 12:52pm:
Have you seen this example code

docjar.com/html/api/javax/sound/midi/MidiSystem.java.html


hi
thanks for reply.
sorry I am not advanced on java and I haven't much time to learn it. grrrr Sad

I'm waiting for an easy way to use midifiles to synchronize processing.

midiYoke could work but it doesn't seems the best way...I think I have to wait an upgrade to processing libraries, I think it really need midifile support.
I am techno music producer so I want to use my midi source to trigger a video for my tracks. using audio for that purpose is very limitative.
regards

dr faust
Re: Processing MIDIFILE reading support
Reply #14 - Mar 11th, 2010, 1:20am
 
yes MidiYoke could be a good solution although it's not the best one.
if some good developer can code a "MIDIFILE" reader for processing it could be really usefull and appreciated. Image graphics interacting live triggered by midi data... Shocked Cheesy Tongueawesome! isn't it!!


best regards

Dr. Faust
Page Index Toggle Pages: 1