We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 52d8a35 + 3ee3f76 commit a770d1bCopy full SHA for a770d1b
src/essentia/essentiamath.h
@@ -766,13 +766,12 @@ inline int note2octave(std::string note) {
766
767
inline std::string midi2note(int midiNoteNumber) {
768
std::string NOTES[] = {ALL_NOTES};
769
- //int nNotes = NOTES.size();
770
int nNotes = *(&NOTES + 1) - NOTES;
771
int CIdx = 3;
772
int diffCIdx = nNotes - CIdx;
773
int noteIdx = midiNoteNumber - 69;
774
int idx = abs(noteIdx) % nNotes;
775
- int octave = (CIdx + 1) + floor((noteIdx + diffCIdx) / nNotes);
+ int octave = (CIdx + 1) + floor(float(noteIdx + diffCIdx) / nNotes);
776
if (noteIdx < 0) {
777
idx = abs(idx - nNotes) % nNotes;
778
}
0 commit comments