Diffstat (limited to 'noncore/multimedia/tonleiter/tonleiterdatahelper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp index 5714cea..156dba5 100644 --- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | |||
@@ -1,8 +1,10 @@ | |||
1 | #include "tonleiterdatahelper.h" | 1 | #include "tonleiterdatahelper.h" |
2 | 2 | ||
3 | #include <math.h> | ||
4 | |||
3 | using namespace Data; | 5 | using namespace Data; |
4 | 6 | ||
5 | int Note::getOctaveOfNote(int note) | 7 | int Note::getOctaveOfNote(int note) |
6 | { | 8 | { |
7 | int remain=note%12; | 9 | int remain=note%12; |
8 | return (note-remain)/12; | 10 | return (note-remain)/12; |
@@ -73,13 +75,13 @@ int Instrument::string(int id) | |||
73 | } | 75 | } |
74 | //**************************************************************************** | 76 | //**************************************************************************** |
75 | int Instrument::noOfOctaves() | 77 | int Instrument::noOfOctaves() |
76 | { | 78 | { |
77 | int lowest=strings[0]; | 79 | int lowest=strings[0]; |
78 | int highest=strings[strings.count()-1]+frets; | 80 | int highest=strings[strings.count()-1]+frets; |
79 | return (int)((highest-lowest)/12.0); | 81 | return (int) ceil((highest-lowest)/12.0); |
80 | } | 82 | } |
81 | //**************************************************************************** | 83 | //**************************************************************************** |
82 | //**************************************************************************** | 84 | //**************************************************************************** |
83 | Scale::Scale() | 85 | Scale::Scale() |
84 | { | 86 | { |
85 | name="UNDEFINED"; | 87 | name="UNDEFINED"; |