#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
Go to the source code of this file.
Classes | |
| class | Pitch |
| Pitch class implements a set of data types, conversions, and operations for musical pitches, scales, and tuning systems. More... | |
Functions | |
| Integer | Accidental (Pitch p) |
| The accidental of a pitch. | |
| Integer | PitchClass (Integer i) |
| Finds the corresponding pitch class of a key index. | |
| Integer | PitchClass (Pitch p) |
| Finds the corresponding pitch class of a Pitch. | |
| Integer | Octave (Integer i) |
| Finds the corresponding octave of a key index. | |
| Integer | Octave (Pitch p) |
| Returns the octave of a Pitch. | |
| Real | PitchToHertz (Pitch p) |
| Return the frequency of a Pitch. | |
| Real | KeyToHertz (Integer i) |
| Return the frequency of a key index. | |
| Void | SetDegrees (Integer ref) |
| Set the number of degrees used globally by Pitch. | |
| Pitch | Mod (Pitch p, Integer len) |
Definition in file Pitch.h.
The accidental of a pitch.
| p | Pitch |
Definition at line 527 of file Pitch.h.
References Pitch::accidental(), and Return.
00528 { 00529 Return p.accidental(); 00530 }
Return the frequency of a key index.
| i | Key index |
Definition at line 575 of file Pitch.h.
References Pitch::HzReference(), Octave(), PitchClass(), and Return.
00576 { 00577 Real R = Pitch::HzReference(); 00578 Integer k = PitchClass( i ); 00579 Integer o = Octave( i ); 00580 Return( R * pow(2, ( (o - 4) + k / 12) ) ); 00581 }
Finds the corresponding octave of a key index.
| i | Key index |
Definition at line 551 of file Pitch.h.
References Return.
Referenced by KeyToHertz().
00552 { 00553 Return( (i - 3) / 12 + 1 ); 00554 }
Finds the corresponding pitch class of a Pitch.
| p | Pitch |
Definition at line 543 of file Pitch.h.
References Pitch::pitchClass(), and Return.
00544 { 00545 Return( p.pitchClass() ); 00546 }
| Void SetDegrees | ( | Integer | ref | ) | [inline] |
Set the number of degrees used globally by Pitch.
| ref | # of degrees |
Definition at line 585 of file Pitch.h.
References Pitch::SetDegrees().
00586 { 00587 Pitch::SetDegrees(ref); 00588 }
1.4.7