Howdy folks,
I would like to load up two VSTi's as independent channels/streams (BassVst.BASS_VST_ChannelCreate) and have both streams handle their own unique MIDI events in a synchronized fashion.
At first glance, the VST addon appears fairly sparse in event triggering (BassVst.BASS_VST_ProcessEvent in examples I've stumbled upon). Having played with BASS a year ago (namely bass.net), I'm aware that the MIDI addon itself has more event triggering/handling operations but these don't appear compatible with the VSTi streams I've created. I've successfully synchronized audio via two decoding streams through the mixer (bassmix addon) so I'm hoping there is a similar method for synchronizing midi events. I'm sure the answer is out there on these forums but I've not come across the big picture (midi events -> somehow synchronized -> trigger separate VSTi's).
User "joeduf" uploaded a good example on basic VSTi MIDI triggering in which he uses the "ProcessEvent" method. Cannibalizing his code, I saw he created a little musical sequence:
public void PlayTheTones()
{
// play note sequence ;-)
// G# 4
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(68, 100));
Thread.Sleep(NOTE_DURATION);
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(68, 0));
// A# 4 (Up a whole step)
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(70, 100));
Thread.Sleep(NOTE_DURATION);
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(70, 0));
// F# 4 (Down a major third)
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(66, 100));
Thread.Sleep(NOTE_DURATION);
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(66, 0));
// F# 3 (Down an octave)
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(54, 100));
Thread.Sleep(NOTE_DURATION);
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(54, 0));
// C# 4 (Up a perfect fifth) ;-)
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(61, 100));
Thread.Sleep(NOTE_DURATION * 4);
BassVst.BASS_VST_ProcessEvent(m_stream1Handle, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(61, 0));
}
This works well for monophonic melodies but I'm hoping someone can point me to posts/materials informing of simultaneous MIDI notes, even across streams. Simply triggering two unique streams at the same time with "ProcessEvent" results in random start times (un-synchronized)