toscanini icon indicating copy to clipboard operation
toscanini copied to clipboard

Toscanini.Iterator

Open MegaArman opened this issue 8 years ago • 4 comments

What: An iterator to make iterating over a score simpler.

Why: Per Dr. T's request, this abstraction should simplify the process for a new programmer to start developing new queries. New programmers need not know about XML parsing techniques. This makes collecting information about chords and melodic sequences much easier for example.

Concerns: -chords or multiple voices? MuseScore and seems like the MusicXML standard require two voices to be used when a note of a chord has different duration from other notes of the chord.

Chords not voices will be considered. If two notes are played by one part at a single point in time, then they are to be considered a chord of one instrument as opposed to two voices under any circumstance. It would be impractical to code otherwise. Guitar music where notes in a chord have different durations require multiple voices to be used according to the MusicXML standard and MuseScore, but in reality it's clearly meant for one instrument.

-How do you represent a chord that is spread across multiple parts? Should the iterable contain all notes of all parts at a given point in time for harmonic analysis across instruments?

  • Rests?
  • Ties?
  • Repeats?
  • Dynamics?
  • Vibrato?
  • Tremolo?
  • Time Signatures: effect beat (ex: in 7/8 a measure of all eights means each note is a beat) etc...

MegaArman avatar Mar 28 '17 02:03 MegaArman

Draft spec 6/24/17: Iterator.selectInstrument(instrumentName);

Iterator.nextMeasure(); //takes you to the first beat of the next measure Iterator.next(); //takes you to the next note or set of notes or rest ... of a measure or across measures? Iterator.nextBeat(); //takes you to the next beat of the measure or across measures?? Iterator.nextChord(); //should this just beat went multiple notes are hit at once- what if it's a canon?

Iterator.prevMeasure(); Iterator.prev(); Iterator.prevBeat(); Iterator.prevChord();

Iterator.nextTimeSignature(); Iterator.nextKeySignature();

Iterator.getMeasureNum(); Iterator.setMeasureNum();

Iterator.getSelectedInstrumentName() ....

MegaArman avatar Jun 24 '17 04:06 MegaArman

Iterator 1.0 coming soon. Concerns:

  • should beat be represented in terms of quarters or in terms of the beat-type?( Ex: a measure with all eight notes in 7/8 - should each note be treated as beat for the Iterator?) It becomes very difficult to determine chords formed by instrument parts with the latter in the event the music is polyrhythmic. Also, for conductors- I recall in high school marching band: 7/8 was typically counted "1 2, 1 2, 1 2 3". How meaningful is it to count the beat in terms of eights (ex: "1 2 3 4 5 6 7")? Which is most important for the iterator- respecting time signature beat type or having a single uniform way of knowing how far the note is from the start of the measure?

MegaArman avatar Jul 22 '17 04:07 MegaArman

I.next().notes[0].duration I.next().notes[0].pitch

MegaArman avatar Aug 06 '17 18:08 MegaArman

Iterator 1.1.0: -user can listen for key and time signature changes -setMeasureNum -need to improve test code coverage overall

MegaArman avatar Aug 20 '17 23:08 MegaArman