Hey there people !
I’m trying to create a 4x4 Cartesian Sequencer VST (feeling inspired by MakeNoise’s René module) and so far I haven’t met much difficulties with the GUI environment!
The problem is I can’t quite figure out how to get an input MIDI Clock (e.g from Ableton) and then use it in the Editor to at least have a visual feedback before I get into generating MIDI notes.
I started with the Handling MIDI Events & Slider Values examples but I don’t really know how to start.
So far my processBlock function (which I believe is the root of it all) looks like this (count variable is what I intend to use to determine my sequence):
void MatrixSequencerPluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
const int totalNumInputChannels = getTotalNumInputChannels();
const int totalNumOutputChannels = getTotalNumOutputChannels();
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
// Midi Processing
MidiBuffer processMidi;
int time;
MidiMessage m;
for(MidiBuffer::Iterator i (midiMessages); i.getNextEvent(m, time);)
{
if(m.isMidiClock())
{
count++;
if(count%24==0) transmitFlagToEditor();
}
}
//...Audio Processing part (not relevant here)
}
In short:
- Is the isMidiClock() message the right one to get my External Clock? Or should I use the tempo-related Events such as getTempoMetaEventTickLength() ?
- How can I set up a Listener on my Editor so that every time I get a MIDI tick I can visually move on to the next step ?
I believe this can solve a lot of my problems so thank you very much to whoever will find the time to help me!
Cheers