diff --git a/include/VST_sync_shm.h b/include/VST_sync_shm.h index 595b21cd9..7b6a813d5 100644 --- a/include/VST_sync_shm.h +++ b/include/VST_sync_shm.h @@ -39,19 +39,19 @@ struct sncVST { bool isPlayin; - double ppqPos; + float ppqPos; int timeSigNumer; int timeSigDenom; bool isCycle; bool hasSHM; - double cycleStart; - double cycleEnd; + float cycleStart; + float cycleEnd; int m_bufferSize; int m_sampleRate; int m_bpm; #ifdef VST_SNC_LATENCY - double m_latency; + float m_latency; #endif } ; diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 254d70071..122dda3bc 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -319,8 +319,8 @@ private: // host to plugin synchronisation data structure struct in { - double lastppqPos; - double m_Timestamp; + float lastppqPos; + float m_Timestamp; } ; in * m_in; @@ -1482,7 +1482,7 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode, __plugin->m_in->lastppqPos += ( __plugin->m_SncVSTplug->hasSHM ? __plugin->m_SncVSTplug->m_bpm : - __plugin->m_bpm ) / (double)10340; + __plugin->m_bpm ) / (float)10340; _timeInfo.ppqPos = __plugin->m_in->lastppqPos; } // _timeInfo.ppqPos = __plugin->m_SncVSTplug->ppqPos; diff --git a/src/core/song.cpp b/src/core/song.cpp index e1ce8ae86..6fdba2b21 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -243,7 +243,7 @@ void song::setTempo() #ifdef VST_SNC_LATENCY m_SncVSTplug->m_latency = m_SncVSTplug->m_bufferSize * tempo / - ( (double) m_SncVSTplug->m_sampleRate * 60 ); + ( (float) m_SncVSTplug->m_sampleRate * 60 ); #endif emit tempoChanged( tempo ); @@ -471,7 +471,7 @@ void song::processNextBuffer() #ifdef VST_SNC_LATENCY m_SncVSTplug->m_latency = m_SncVSTplug->m_bufferSize * m_SncVSTplug->m_bpm / - ( (double) m_SncVSTplug->m_sampleRate * 60 ); + ( (float) m_SncVSTplug->m_sampleRate * 60 ); #endif float current_frame = m_playPos[m_playMode].currentFrame(); @@ -482,10 +482,10 @@ void song::processNextBuffer() + (int)( current_frame / frames_per_tick ); #ifdef VST_SNC_LATENCY - m_SncVSTplug->ppqPos = ( ( ticks + 0 ) / (double)48 ) - + m_SncVSTplug->ppqPos = ( ( ticks + 0 ) / (float)48 ) - m_SncVSTplug->m_latency; #else - m_SncVSTplug->ppqPos = ( ( ticks + 0 ) / (double)48 ); + m_SncVSTplug->ppqPos = ( ( ticks + 0 ) / (float)48 ); #endif // did we play a whole tact? @@ -523,11 +523,11 @@ void song::processNextBuffer() midiTime::ticksPerTact() ); #ifdef VST_SNC_LATENCY m_SncVSTplug->ppqPos = ( ( ticks + 0 ) - / (double)48 ) + / (float)48 ) - m_SncVSTplug->m_latency; #else m_SncVSTplug->ppqPos = ( ( ticks + 0 ) - / (double)48 ); + / (float)48 ); #endif } } @@ -538,10 +538,10 @@ void song::processNextBuffer() m_SncVSTplug->isCycle = true; m_SncVSTplug->cycleStart = ( tl->loopBegin().getTicks() ) - / (double)48; + / (float)48; m_SncVSTplug->cycleEnd = ( tl->loopEnd().getTicks() ) - / (double)48; + / (float)48; if( m_playPos[m_playMode] >= tl->loopEnd() ) { m_playPos[m_playMode].setTicks( @@ -1362,7 +1362,7 @@ void song::updateSampleRateSHM() #ifdef VST_SNC_LATENCY m_SncVSTplug->m_latency = m_SncVSTplug->m_bufferSize * m_SncVSTplug->m_bpm / - ( (double) m_SncVSTplug->m_sampleRate * 60 ); + ( (float) m_SncVSTplug->m_sampleRate * 60 ); #endif }