MidiData::MidiData(const std::vector<MidiNote> &initial_data) : numNotes(0), span(0.0, 0.0), midiLock("Midi Data") { midiLock.lockWait(); addNotes(initial_data); midiLock.unlock(); }
void MainWindow::addDotted(int column){ QChar noteLength=noteLengthLine.at(column); if(noteLength=='T'){ stream << "1,"; if(repeatActive) repeatString = repeatString + "1,"; addNotes(column, 1); }else if(noteLength=='S'){ stream << "3,"; if(repeatActive) repeatString = repeatString + "3,"; addNotes(column, 1); } else if(noteLength=='E'){ stream << "6,"; if(repeatActive) repeatString = repeatString + "6,"; addNotes(column, 1); } else if(noteLength=='Q'){ stream << "12,"; if(repeatActive) repeatString = repeatString + "12,"; addNotes(column, 1); } else if(noteLength=='H'){ stream << "24,"; if(repeatActive) repeatString = repeatString + "24,"; addNotes(column, 1); } else if(noteLength=='W'){ stream << "48,"; if(repeatActive) repeatString = repeatString + "48,"; addNotes(column, 1); } else if(noteLength=='.'){ // addDotted(column); } }
void MainWindow::parseColumn(int column) { QChar noteLength = noteLengthLine.at(column); if(stringLine[4].at(column)=='*'){ if(repeatActive){ repeatActive=false; stream << repeatString << endl; } else{ qDebug() << "activated repeat"; repeatActive=true; } } //check for end of measure if(stringLine[1].at(column)=='|'){ if(repeatActive) repeatString = repeatString + "\n"; stream << "-" << endl; } if(noteLength!=' '&&stringLine[1].length()>column+1) { QChar nextLength = noteLengthLine.at(column+1); if(nextLength=='.'){ addDotted(column); }else{ if(noteLength=='T'){ stream << "1,"; if(repeatActive) repeatString = repeatString + "1,"; addNotes(column, 1); }else if(noteLength=='S'){ stream << "2,"; if(repeatActive) repeatString = repeatString + "2,"; addNotes(column, 1); } else if(noteLength=='E'){ stream << "4,"; if(repeatActive) repeatString = repeatString + "4,"; addNotes(column, 1); } else if(noteLength=='Q'){ stream << "8,"; if(repeatActive) repeatString = repeatString + "8,"; addNotes(column, 1); } else if(noteLength=='H'){ stream << "16,"; if(repeatActive) repeatString = repeatString + "16,"; addNotes(column, 1); } else if(noteLength=='W'){ stream << "32,"; if(repeatActive) repeatString = repeatString + "32,"; addNotes(column, 1); } else if(noteLength=='.'){ // addDotted(column); } } } }