mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
starting o microtonal support
This commit is contained in:
parent
19e1f80726
commit
c90a502035
3 changed files with 18 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ file (GLOB_RECURSE source_files CONFIGURE_DEPENDS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.h)
|
||||
|
||||
target_sources (${PLUGIN_NAME} PRIVATE ${source_files})
|
||||
target_sources (${PLUGIN_NAME} PRIVATE ${source_files} ${CMAKE_CURRENT_SOURCE_DIR}/modules/MTS-ESP/Client/libMTSClient.cpp)
|
||||
source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR}/plugin PREFIX Source FILES ${source_files})
|
||||
|
||||
file (GLOB_RECURSE asset_files CONFIGURE_DEPENDS
|
||||
|
|
|
|||
|
|
@ -8,6 +8,12 @@ WavetableVoice::WavetableVoice (WavetableAudioProcessor& p)
|
|||
, sub (proc.analogTables)
|
||||
{
|
||||
filter.setNumChannels (2);
|
||||
mtsClient = MTS_RegisterClient();
|
||||
}
|
||||
|
||||
WavetableVoice::~WavetableVoice()
|
||||
{
|
||||
MTS_DeregisterClient (mtsClient);
|
||||
}
|
||||
|
||||
void WavetableVoice::noteStarted()
|
||||
|
|
@ -240,6 +246,10 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
auto note = getCurrentlyPlayingNote();
|
||||
|
||||
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);
|
||||
|
||||
for (int i = 0; i < Cfg::numOSCs; i++)
|
||||
{
|
||||
|
|
@ -247,6 +257,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 (note.totalPitchbendInSemitones);
|
||||
currentMidiNotes[i] += getValue (proc.oscParams[i].tune) + getValue (proc.oscParams[i].finetune) / 100.0f;
|
||||
|
||||
|
|
@ -264,6 +275,7 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
{
|
||||
subNote = noteSmoother.getCurrentValue() * 127.0f;
|
||||
if (glideInfo.glissando) subNote = (float) juce::roundToInt (subNote);
|
||||
subNote += retune_semitones;
|
||||
subNote += float (note.totalPitchbendInSemitones);
|
||||
subNote += getValue (proc.subParams.tune);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <JuceHeader.h>
|
||||
#include "Cfg.h"
|
||||
#include "MTS-ESP/Client/libMTSClient.h"
|
||||
|
||||
class WavetableAudioProcessor;
|
||||
|
||||
|
|
@ -12,6 +13,8 @@ class WavetableVoice : public gin::SynthesiserVoice,
|
|||
public:
|
||||
WavetableVoice (WavetableAudioProcessor& p);
|
||||
|
||||
~WavetableVoice() override;
|
||||
|
||||
void noteStarted() override;
|
||||
void noteRetriggered() override;
|
||||
void noteStopped (bool allowTailOff) override;
|
||||
|
|
@ -59,4 +62,6 @@ public:
|
|||
gin::EasedValueSmoother<float> noteSmoother;
|
||||
|
||||
float ampKeyTrack = 1.0f;
|
||||
|
||||
MTSClient* mtsClient = nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue