AU & Midi from Host


#1

Hello all!
Im trying to implement a simple AU synthesizer, by following the example given with the SDK. i have managed to take MIDI signal and produce sound from the keyboard on the gui but i cannot do it by using the host’s piano roll.
I am calling keyboardState.isNoteOn(1, k).
Furthermore i was wondering how can i get the velocity and other midi info from the midi buffer
Thank you in advance!


#2

Have a look in the audio page of the demo app - it uses the incoming buffer from a midi input to trigger the synth, which is basically the same as using the midi buffer that the plugin receives.


#3

Ok i created a mySound, and myVoice Class. In the constructor of the plugins filter i pass them to a synth object, and at the filter’s processBlock function i call the following:

void MyJuceFilter::processBlock (AudioSampleBuffer& buffer,
MidiBuffer& midiMessages)
{

     buffer.clear(0,buffer.getNumSamples());



midiCollector.removeNextBlockOfMessages (midiMessages, buffer.getNumSamples());
keyboardState.processNextMidiBuffer (midiMessages, 0, buffer.getNumSamples(), true);
synth.renderNextBlock(buffer, midiMessages,0, buffer.getNumSamples());

}

The result unfortunately is the same and the only Midi signal i still get is the one of the keyboard object. Is is something that i get wrong?

Thank you


#4

Are you 100% sure the host is sending midi messages? You should debug the callback and see if there’s anything actually coming in first.


#5

Im sure that the host sends midi, and after debugging i saw that the Synth’s midi message is empty, and the midiNote is 0. I tried to instantiate a new midi buffer and fill it with the midi messages using :

MidiBuffer incomingMidi;
midiCollector.removeNextBlockOfMessages (incomingMidi, buffer.getNumSamples());

synth.renderNextBlock(buffer, incomingMidi,0, buffer.getNumSamples());

but the same kept happening…
any ideas?
thanks!!

Furthemore (if it helps) i copied the SineWaveVoice and sound classes to my project (and renamed them properly) to see what is happening, and again i get midi only from the keyboard.


#6

Jules as it seems the problem was stated before and i found a solution here!

http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3532

Im sure that the host sends midi, and after debugging i saw that the Synth’s midi message is empty, and the midiNote is 0. I tried to instantiate a new midi buffer and fill it with the midi messages using :

MidiBuffer incomingMidi;
midiCollector.removeNextBlockOfMessages (incomingMidi, buffer.getNumSamples());

synth.renderNextBlock(buffer, incomingMidi,0, buffer.getNumSamples());

but the same kept happening…
any ideas?
thanks!!

Furthemore (if it helps) i copied the SineWaveVoice and sound classes to my project (and renamed them properly) to see what is happening, and again i get midi only from the keyboard.[/quote]