Support for alternative tunings and keyboard mappings (#5522)
Co-authored-by: Kevin Zander <veratil@gmail.com> Co-authored-by: Dominic Clark <mrdomclark@gmail.com> Co-authored-by: Martin <martin@sigma.he29.net>
This commit is contained in:
@@ -303,7 +303,8 @@ QString audioFileProcessor::nodeName( void ) const
|
||||
|
||||
int audioFileProcessor::getBeatLen( NotePlayHandle * _n ) const
|
||||
{
|
||||
const float freq_factor = BaseFreq / _n->frequency() *
|
||||
const auto baseFreq = instrumentTrack()->baseFreq();
|
||||
const float freq_factor = baseFreq / _n->frequency() *
|
||||
Engine::mixer()->processingSampleRate() / Engine::mixer()->baseSampleRate();
|
||||
|
||||
return static_cast<int>( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) );
|
||||
|
||||
@@ -43,6 +43,7 @@ float frnd(float range)
|
||||
#include "Engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Knob.h"
|
||||
#include "lmms_constants.h"
|
||||
#include "NotePlayHandle.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "ToolTip.h"
|
||||
@@ -469,7 +470,8 @@ void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t pitchedFrameNum = (_n->frequency()/BaseFreq)*frameNum;
|
||||
const auto baseFreq = instrumentTrack()->baseFreq();
|
||||
int32_t pitchedFrameNum = (_n->frequency() / baseFreq) * frameNum;
|
||||
|
||||
pitchedFrameNum /= ( currentSampleRate / 44100 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user