Make MIDI timing sample-accurate
- currently only affects Vestige
- no idea whether this can also be used for Zyn and OpulenZ, I'm not sure if Zyn has any kind of mechanism for communicating frame offset to the synth, as for OpulenZ, @softrabbit would know the answer better
- basically, I made it happen by simply adding an extra parameter in the processMidi{In|Out} functions, which is 0 by default, and made the necessary changes in instrumentTrack and nph to utilize it
- I based this against 1.1 because I didn't think it's a very big change, and I don't see much possibility for things going wrong here, since we're basically just using the existing functionality in Vestige (there already was a frame offset being communicated to the remote plugin, just that it was always set to 0). However, if @tobydox thinks this is better to bump up to 1.2, I can rebase it for master...
This commit is contained in:
@@ -283,7 +283,7 @@ int opl2instrument::pushVoice(int v) {
|
||||
return i;
|
||||
}
|
||||
|
||||
bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time )
|
||||
bool opl2instrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
|
||||
{
|
||||
emulatorMutex.lock();
|
||||
int key, vel, voice, tmp_pb;
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
return IsSingleStreamed | IsMidiBased;
|
||||
}
|
||||
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time );
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset = 0 );
|
||||
virtual void play( sampleFrame * _working_buffer );
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
|
||||
@@ -310,12 +310,12 @@ void vestigeInstrument::play( sampleFrame * _buf )
|
||||
|
||||
|
||||
|
||||
bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time )
|
||||
bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->processMidiEvent( event, time );
|
||||
m_plugin->processMidiEvent( event, offset );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
return IsSingleStreamed | IsMidiBased;
|
||||
}
|
||||
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time );
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset = 0 );
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
|
||||
|
||||
|
||||
|
||||
bool ZynAddSubFxInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time )
|
||||
bool ZynAddSubFxInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
|
||||
{
|
||||
// do not forward external MIDI Control Change events if the according
|
||||
// LED is not checked
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
virtual void play( sampleFrame * _working_buffer );
|
||||
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
Reference in New Issue
Block a user