Im trying to write a simple application that can prompt the midi-in data from my hardware synth; later I hope to succeed
in designing my own softsynth - when that time comes I think that Jules Demo application will help me but currently
I’m focused on prompting the midi data.
Right now, I have modified the juce application project (hello world window with a quit-button). I have added another button
that when pressed opens the sound manager window (sound configuration)…here I can see that my midi port has been found.
Also, I have included a text editor for prompting the midi values I hope to be able to recieve. So far so good!
Now, I have defined another class containing the following three variables:
void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill)
{
// the synth always adds its output to the audio buffer, so we have to clear it
// first…
bufferToFill.clearActiveBufferRegion();
// fill a midi buffer with incoming messages from the midi input.
midiCollector.removeNextBlockOfMessages (incomingMidi, bufferToFill.numSamples);
// and now get the synth to process the midi events and generate its output.
synth.renderNextBlock (*bufferToFill.buffer, incomingMidi, 0, bufferToFill.numSamples);
}
This class I have instantiated in the Main Component.h file but I can’t work out how to extract the midi data from the
midibuffer variable in the class described above and have data prompted in the text editor. I’m far from a skilled programmer
so please bare over with my primitive terminology and if this is trivial.
Can some one please describe what I need to do to get this done?
I’m having difficulties with my simple midi data prompter and looking for some help. Hope someone will be reading this!
I have put in some code lines that should get me a little further but when running the program and pressing one of the keys on my external hardware synth (virus polar) I get an error at:
// you need to call reset() to set the correct sample rate before using this object
jassert (sampleRate != 44100.0001);
The Juce demo works fine and to me it looks like I’m doing the exact same thing…
midiCollector.reset(sampleRate); // isnt this the right way to reset???
synth.setCurrentPlaybackSampleRate (sampleRate);
}
void releaseResources()
{
}
void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill)
{
// the synth always adds its output to the audio buffer, so we have to clear it
// first..
bufferToFill.clearActiveBufferRegion();
// fill a midi buffer with incoming messages from the midi input.
midiCollector.removeNextBlockOfMessages (incomingMidi, bufferToFill.numSamples);
// and now get the synth to process the midi events and generate its output.
//synth.renderNextBlock (*bufferToFill.buffer, incomingMidi, 0, bufferToFill.numSamples);
}