Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion main4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ namespace synth
switch (nScaleID)
{
case SCALE_DEFAULT: default:
return 8 * pow(1.0594630943592952645618252949463, nNoteID);
// n/12th root of 2 * A=440 where n is distance from A4 in semitones
// n = NoteID - 69 as A4 is midi note 69
return pow(2.0, 0.0 / nNoteID - 69) * 440.0);
}
}

Expand Down