mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
A few tweaks for MTS support
This commit is contained in:
parent
c90a502035
commit
796228e041
5 changed files with 20 additions and 11 deletions
|
|
@ -522,6 +522,7 @@ WavetableAudioProcessor::WavetableAudioProcessor()
|
|||
extractProgram (BinaryData::originalFilenames[i], data, sz);
|
||||
}
|
||||
|
||||
mtsClient = MTS_RegisterClient();
|
||||
enableLegacyMode();
|
||||
setVoiceStealingEnabled (true);
|
||||
|
||||
|
|
@ -577,6 +578,8 @@ WavetableAudioProcessor::WavetableAudioProcessor()
|
|||
|
||||
WavetableAudioProcessor::~WavetableAudioProcessor()
|
||||
{
|
||||
MTS_DeregisterClient (mtsClient);
|
||||
mtsClient = nullptr;
|
||||
}
|
||||
|
||||
void WavetableAudioProcessor::reloadWavetables()
|
||||
|
|
@ -844,6 +847,11 @@ void WavetableAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, ju
|
|||
if (buffer.getNumChannels() != 2)
|
||||
return;
|
||||
|
||||
if (mtsClient)
|
||||
for (auto itr : midi)
|
||||
if (auto m = itr.getMessage(); m.isSysEx())
|
||||
MTS_ParseMIDIDataU (mtsClient, itr.data, itr.numBytes);
|
||||
|
||||
if (blockMissed || presetLoaded || lastMono != globalParams.mono->isOn())
|
||||
{
|
||||
blockMissed = presetLoaded = false;
|
||||
|
|
|
|||
|
|
@ -348,6 +348,8 @@ public:
|
|||
juce::CriticalSection dspLock;
|
||||
juce::Random rng;
|
||||
|
||||
MTSClient* mtsClient = nullptr;
|
||||
|
||||
private:
|
||||
bool isParamLocked (gin::Parameter* p) override;
|
||||
float getSmoothingTime (gin::Parameter*);
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ WavetableVoice::WavetableVoice (WavetableAudioProcessor& p)
|
|||
, sub (proc.analogTables)
|
||||
{
|
||||
filter.setNumChannels (2);
|
||||
mtsClient = MTS_RegisterClient();
|
||||
}
|
||||
|
||||
WavetableVoice::~WavetableVoice()
|
||||
{
|
||||
MTS_DeregisterClient (mtsClient);
|
||||
}
|
||||
|
||||
void WavetableVoice::noteStarted()
|
||||
|
|
@ -247,9 +245,9 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
|
||||
proc.modMatrix.setPolyValue (*this, proc.modSrcNote, note.initialNote / 127.0f);
|
||||
|
||||
double retune_semitones = 0.0;
|
||||
if (mtsClient)
|
||||
retune_semitones = MTS_RetuningInSemitones (mtsClient, note.initialNote, -1);
|
||||
double retuneSemitones = 0.0;
|
||||
if (proc.mtsClient)
|
||||
retuneSemitones = MTS_RetuningInSemitones (proc.mtsClient, note.initialNote, -1);
|
||||
|
||||
for (int i = 0; i < Cfg::numOSCs; i++)
|
||||
{
|
||||
|
|
@ -257,7 +255,7 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
|
||||
currentMidiNotes[i] = noteSmoother.getCurrentValue() * 127.0f;
|
||||
if (glideInfo.glissando) currentMidiNotes[i] = (float) juce::roundToInt (currentMidiNotes[i]);
|
||||
currentMidiNotes[i] += float (retune_semitones);
|
||||
currentMidiNotes[i] += float (retuneSemitones);
|
||||
currentMidiNotes[i] += float (note.totalPitchbendInSemitones);
|
||||
currentMidiNotes[i] += getValue (proc.oscParams[i].tune) + getValue (proc.oscParams[i].finetune) / 100.0f;
|
||||
|
||||
|
|
@ -275,7 +273,7 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
{
|
||||
subNote = noteSmoother.getCurrentValue() * 127.0f;
|
||||
if (glideInfo.glissando) subNote = (float) juce::roundToInt (subNote);
|
||||
subNote += retune_semitones;
|
||||
subNote += float (retuneSemitones);
|
||||
subNote += float (note.totalPitchbendInSemitones);
|
||||
subNote += getValue (proc.subParams.tune);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,5 @@ public:
|
|||
|
||||
gin::EasedValueSmoother<float> noteSmoother;
|
||||
|
||||
float ampKeyTrack = 1.0f;
|
||||
|
||||
MTSClient* mtsClient = nullptr;
|
||||
float ampKeyTrack = 1.0f;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue