Simple MIDI Thru

Discuss issues relating to audio plugins

Simple MIDI Thru

Postby fredoxxy » Mon May 28, 2012 5:07 pm

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 ^^)
fredoxxy
JUCE Weenie
 
Posts: 2
Joined: Mon May 28, 2012 4:54 pm

Re: Simple MIDI Thru

Postby Joerg Koehler » Tue May 29, 2012 7:41 pm

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
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Simple MIDI Thru

Postby fredoxxy » Wed May 30, 2012 8:54 am

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: Select all
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:
fredoxxy
JUCE Weenie
 
Posts: 2
Joined: Mon May 28, 2012 4:54 pm

Re: Simple MIDI Thru

Postby splisp » Tue Sep 25, 2012 10:23 am

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!
User avatar
splisp
JUCE Weenie
 
Posts: 14
Joined: Tue Sep 25, 2012 10:09 am


Return to Audio Plugins

Who is online

Users browsing this forum: No registered users and 0 guests