Need answers/direction - Midi processing


#1

I'm trying to pull off something with Midi files and don't understand how. Just really need to know how to go about it, willing to paypal someone for some direction/answers... If in fact JUCE can play midi files/tracks. I don't so much need code as direction.


#2

There's nothing to just "play a whole midi file".

Everything is juce is block-based because that's how most serious audio work is done - if you have an audio callback you can send small blocks of midi to the output devices, but generally in a serious app you wouldn't want a function that just dumps a whole midi file to the output because you probably need more control over stopping/starting playback.


#3

I do want to play a midi file, and have a piano roll that shows the notes moving along (not all of them, just the upcoming ones). How do I generally structure a juce app to do this? 


#4

Impossible to give a useful answer to such a broad question!

You'd probably want to use a high-res timer to actually play the notes - that's what we do in things like tracktion. But you'd need to build a model of what you're playing, create transport controls for it, a UI etc.


#5

I don't want to determine when to play the notes, I want "JUCE" (synthesiser? to play them) 

It is more than one question, though:

1) How is a midi file played in JUCE? 
2) How do I determine the current time position (being played)
3) How to use current time to obtain relevant notes for graphing? 

I expect the first two are trivial questions, the last one being more interesting.


#6

There are classes to control a midi i/o devices, to parse midi files and let you iterate the events in them, to create synthesisers, to use high res timers for sending notes at a precise time etc etc. It's up to you to tie all those parts together to play the file in whatever way is appropriate for your app. If you're looking for a magic function called "playMidiFile" then you're going to be disappointed.