MIDI-only plug-ins?


Sorry if this has been dealt with elsewhere but searching didn’t find it.

I 'm thinking of writing a near-trivial MIDI plug-in that simply takes MIDI and sends it to a midiout - to fix this issue here: http://forum.ableton.com/viewtopic.php?f=35&t=148462

The demo audio plug-in doesn’t really demonstrate this facility - does someone have a trivial plug-in project that just does MIDI? I’d be releasing this as open source so it’d be useful to “the community”. :smiley:


I don’t have a project, but you simply have to start an audio plugin from the new Jucer and add your MIDI processing in processBlock().That could look something like this:

const int midiBufferLength = midiBuffer.getNumEvents();
MidiBuffer newBuffer;
MidiMessage midiMessage;
int samplePos;
for (int i=0; i<midiBufferLength; i++)
    midiMessages.getNextEvent(midiMessage, samplePos);
    // do watever you want with midiMessage
    newBuffer.addBuffer(midiMessage, samplePos);
midiMessages = newBuffer;

I didn’t test this, but it should look something like this.




Can it be as simple as that, hmm? (Going to scribble in the other window and try it out…)


Just to follow up on this!

I ended up writing a Max external instead to try to fix my problem, to try to get around some of the utter terribleness of Max For Live (specifically, that you can only send or receive on one MIDI channel, what is this, the 1950s?)

I had little trouble writing such a plug-in using Juce, and it worked fine - in Max - unfortunately it turns out that in Max For Live your code is prohibited from speaking right to MIDI, so it didn’t fix my issue. The code is here

However, the take-away from this is that there were zero issues in using Juce in a Max (MIDI) external box, if anyone else were wanting to do that.