Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void placeNotesStaff(Note * notes, int nbNotes, int nbStrings)
- {
- int i;
- int stringsIdxCur = 2;
- notes[0].stringIdx = stringsIdxCur;
- for (i = 1; i < nbNotes; i++)
- {
- if (notes[i].value == notes[i-1].value)
- {
- notes[i].stringIdx = stringsIdxCur;
- }
- if (notes[i].value < notes[i-1].value)
- {
- if (stringsIdxCur == 0)
- {
- notes[i].stringIdx = stringsIdxCur;
- }
- else
- {
- notes[i].stringIdx = stringsIdxCur - 1;
- stringsIdxCur--;
- }
- }
- if (notes[i].value > notes[i-1].value)
- {
- if (stringsIdxCur == 4)
- {
- notes[i].stringIdx = stringsIdxCur;
- }
- else
- {
- notes[i].stringIdx = stringsIdxCur + 1;
- stringsIdxCur++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement