Simple MIDI Thru


#1

Hello

I’m trying to learn Juce because i want to do a “MIDI Thru program” for filter MIDI message of my master keyboard to different sound module (for example: filter by key note to differents channels)

I haven’t found tutorial for MIDI programming with Juce, so i’m a little lost :? I do not know where to start

I know i must create MidiInput, MidiOutput and MidiCallBack but after…?
I must do a loop with “getMessage” , filtering and just after “sendMessage”?

I do not want you to make me my program, I just want you show me the way for for beginning. For the rest, I’ll manage :smiley:

Thanls a lot :slight_smile:

(sorry for my bas english ^^)


#2

The best point to start would be to look at the juce demo application.
There you have everything ready to open devices and receive Midi events (if my brain serves me well).
Filtering them is very easy in juce (sorry, all Midi handling is very easy in juce). Just read the incoming
Midi messages and select them by type and pass them on to the particular output devices, done.

Joerg


#3

Thanks for you anwer

Sorry, in fact, i was a little lost but it’s okay now, i was find a good example and use it
Just do something like that? :

[code]void MidiMessageManager::handleIncomingMidiMessage (MidiInput*, const MidiMessage& message)
{
text->setText(this->getStringNote(midiNote), true); // to know wich note is played

if(message.isNoteOn())
{
	midiNote = message.getNoteNumber();
	midiNoteHz = message.getMidiNoteInHertz(midiNote);
	velocity = (int)(message.getVelocity());

	if(keyrangeMini_split_1 > midiNote > keyrangeMaxi_split_1)
	{
             midiOutput->sendMessageNow(MidiMessage::noteOn(1,message.getNoteNumber() , message.getVelocity()));
	}
	if(keyrangeMini_split_2 > midiNote > keyrangeMaxi_split_2)
	{
	 midiOutput->sendMessageNow(MidiMessage::noteOn(2,message.getNoteNumber() , message.getVelocity()));
	}

}
if(message.isNoteOff())
{ // the "same" but with "note off"

}

[/code]

It work perfectly and It is certain that it is easy, sorry for disturbing, I haven’t maybe searched enough :roll:


#4

fredoxxy, if you use Reaper you might find useful a couple of MIDI splitters I wrote in JS (one in 2-zones and one in 3-zones). You can find them here: http://stash.reaper.fm/u/splisp

Ciao!