Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // find frequency only for A ..
- int freq;
- if (noteLetter == "A") {
- if (hasAccidental == true) {
- } else { //doesn't haven't accidental for all following code!
- if (octave == 4){
- freq = 440;
- } else {
- int semitoneDiff = octave - 4;
- int multiplier = powf((double) 2, (double)semitoneDiff);
- freq = 440 * multiplier;
- }
- }
- } else {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement