summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdatahelper.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
index 6b8a5bd..c52e0da 100644
--- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
+++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
@@ -78,52 +78,50 @@ int Instrument::noOfOctaves()
}
//****************************************************************************
//****************************************************************************
Scale::Scale()
{
name="UNDEFINED";
}
//****************************************************************************
Scale::Scale(QString name,QValueList<int> halftones)
:name(name),halftones(halftones)
{
}
//****************************************************************************
Scale::~Scale()
{
}
//****************************************************************************
int Scale::noOfHaltones()
{
return (int)halftones.count();
}
//****************************************************************************
int Scale::getHalfTone(int id)
{
- if(id>=0 && noOfHaltones()<id)
- {
+ if(id>=0 && id<noOfHaltones())
return halftones[id];
- }
else
return 0;
}
//****************************************************************************
QString Scale::scaleName()
{
return name;
}
//****************************************************************************
bool Scale::noteInScale(int base,int note)
{
int octave=Note::getOctaveOfNote(note);
note-=12*octave;
int normnote = (note>=base) ? note-base : (12-base)+note;
if(halftones.contains(normnote)>0)
{
//qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote);
return true;
}
else
{
//qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote);
return false;