From ef6d5fdb7e688ac36216df432a1be441ea3da937 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 17 Aug 2020 20:53:43 +0000 Subject: [PATCH] - also feed Global LFO 2..4 with Midi Clock - set parameter text for MIDISYNC_MODE git-svn-id: http://moon:8086/svn/software/trunk/projects/JaySynth@736 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- Source/JaySynth.cpp | 9 ++++++--- Source/PluginProcessor.cpp | 18 ++++++++++++++++++ Source/synth/voice.h | 9 +++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Source/JaySynth.cpp b/Source/JaySynth.cpp index 2ebb455..5864937 100644 --- a/Source/JaySynth.cpp +++ b/Source/JaySynth.cpp @@ -1188,9 +1188,12 @@ void JaySynth::handleMidiEvent (const MidiMessage& m) void JaySynth::voiceSetMidiBeat(int barBeatCount) { - lfo_t *pLfo = &m_pVoices[0].pCom->glfo[0]; - synth_float_t phase = Sync_mod((synth_float_t)barBeatCount/m_numMidiClocksPerBar); - LFO_sync(pLfo, phase); + for (int i=0; i < VOICE_NUM_LFO; i++) + { + lfo_t *pLfo = &m_pVoices[0].pCom->glfo[i]; + synth_float_t phase = Sync_mod((synth_float_t)barBeatCount/m_numMidiClocksPerBar); + LFO_sync(pLfo, phase); + } for (int i=0; i < max_num_voices; i++) { diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 10232e7..7bbc0fc 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -379,6 +379,24 @@ const String JaySynthAudioProcessor::getParameterText (int index) return "Unknown (" + String((int)pSynth->getParameter(index)) + ")"; } + case SYNTH_PARAM_LFO_0_MIDISYNC_MODE: + case SYNTH_PARAM_LFO_1_MIDISYNC_MODE: + case SYNTH_PARAM_LFO_2_MIDISYNC_MODE: + case SYNTH_PARAM_LFO_3_MIDISYNC_MODE: + switch ((int)pSynth->getParameter(index)) + { + case VOICE_LFO_MIDISYNC_OFF: + return "Off"; + case VOICE_LFO_MIDISYNC_F: + return "Freq"; + case VOICE_LFO_MIDISYNC_P: + return "Phase"; + case VOICE_LFO_MIDISYNC_F_P: + return "Freq+Phase"; + default: + return "Unknown (" + String((int)pSynth->getParameter(index)) + ")"; + } + default: if (pParamInfo->pinterval == 0.0) return String (pSynth->getParameter(index)); diff --git a/Source/synth/voice.h b/Source/synth/voice.h index 3ba4ef0..babd62a 100644 --- a/Source/synth/voice.h +++ b/Source/synth/voice.h @@ -229,6 +229,15 @@ enum VOICE_LFO_NUM_SYNCS }; +enum +{ + VOICE_LFO_MIDISYNC_OFF, + VOICE_LFO_MIDISYNC_F, + VOICE_LFO_MIDISYNC_P, + VOICE_LFO_MIDISYNC_F_P, + VOICE_LFO_NUM_MIDISYNC +}; + enum { VOICE_NOISE_SHAPE_WHITE,