Simple MIDI Thru

4 posts / 0 new
Last post
fredoxxy
Offline
Last seen: 1 year 10 months ago
Joined: 28 May 2012 - 16:54
Simple MIDI Thru

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 :D

Thanls a lot :)

(sorry for my bas english ^^)

Joerg Koehler
Offline
Last seen: 3 weeks 7 hours ago
Joined: 11 Jan 2010 - 16:58
Re: Simple MIDI Thru

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

fredoxxy
Offline
Last seen: 1 year 10 months ago
Joined: 28 May 2012 - 16:54
Re: Simple MIDI Thru

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? :

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"
}

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

splisp
Offline
Last seen: 7 months 4 weeks ago
Joined: 25 Sep 2012 - 10:09
Re: Simple MIDI Thru

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!