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:
Vesa
2014-06-04 04:23:16 +03:00
parent b28e995316
commit 06be5bba82
13 changed files with 34 additions and 32 deletions

View File

@@ -23,8 +23,8 @@
*
*/
#ifndef _INSTRUMENT_H
#define _INSTRUMENT_H
#ifndef INSTRUMENT_H
#define INSTRUMENT_H
#include <QtGui/QWidget>
@@ -101,7 +101,7 @@ public:
// sub-classes can re-implement this for receiving all incoming
// MIDI-events
inline virtual bool handleMidiEvent( const MidiEvent&, const MidiTime& = MidiTime() )
inline virtual bool handleMidiEvent( const MidiEvent&, const MidiTime& = MidiTime(), f_cnt_t offset = 0 )
{
return true;
}

View File

@@ -23,8 +23,8 @@
*
*/
#ifndef _INSTRUMENT_TRACK_H
#define _INSTRUMENT_TRACK_H
#ifndef INSTRUMENT_TRACK_H
#define INSTRUMENT_TRACK_H
#include "AudioPort.h"
#include "InstrumentFunctions.h"
@@ -71,8 +71,8 @@ public:
MidiEvent applyMasterKey( const MidiEvent& event );
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
// silence all running notes played by this track
void silenceAllNotes();

View File

@@ -22,8 +22,8 @@
*
*/
#ifndef _MIDI_CONTROLLER_H
#define _MIDI_CONTROLLER_H
#ifndef MIDI_CONTROLLER_H
#define MIDI_CONTROLLER_H
#include <QtGui/QWidget>
@@ -44,10 +44,10 @@ public:
virtual ~MidiController();
virtual void processInEvent( const MidiEvent & _me,
const MidiTime & _time );
const MidiTime & _time, f_cnt_t offset = 0 );
virtual void processOutEvent( const MidiEvent& _me,
const MidiTime & _time)
const MidiTime & _time, f_cnt_t offset = 0 )
{
// No output yet
}

View File

@@ -22,8 +22,8 @@
*
*/
#ifndef _MIDI_EVENT_PROCESSOR_H
#define _MIDI_EVENT_PROCESSOR_H
#ifndef MIDI_EVENT_PROCESSOR_H
#define MIDI_EVENT_PROCESSOR_H
#include "MidiEvent.h"
#include "MidiTime.h"
@@ -42,8 +42,8 @@ public:
}
// to be implemented by inheriting classes
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime() ) = 0;
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() ) = 0;
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 ) = 0;
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 ) = 0;
} ;