Skip to content

Commit

Permalink
Merge pull request #136 from kramlie/master
Browse files Browse the repository at this point in the history
Fix Equal Temperament variation when voice is being imported.
  • Loading branch information
abrolag committed Apr 27, 2021
2 parents c750e8b + ca3f8fa commit 8a435ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Synth/ADnote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,13 +1590,17 @@ float ADnote::getVoiceBaseFreq(int nvoice)
if (subVoiceNumber == -1)
detune += NoteGlobalPar.Detune / 100.0f;

// Fixed frequency is disabled for sub voices. We get the basefreq from the
// parent.
if (!NoteVoicePar[nvoice].fixedfreq || subVoiceNumber != -1)
if (!NoteVoicePar[nvoice].fixedfreq)
return basefreq * powf(2.0f, detune / 12.0f);
else // fixed freq is enabled
{
float fixedfreq = 440.0f;
float fixedfreq;
if (subVoiceNumber != -1)
// Fixed frequency is not used in sub voices. We get the basefreq
// from the parent.
fixedfreq = basefreq;
else
fixedfreq = 440.0f;
int fixedfreqET = NoteVoicePar[nvoice].fixedfreqET;
if (fixedfreqET)
{ // if the frequency varies according the keyboard note
Expand Down

0 comments on commit 8a435ee

Please sign in to comment.