thedpws / pitcher

A python library and framework for composing music.
GNU General Public License v3.0
1 stars 0 forks source link

Implicitly Add Rests on Measure Instantiation (4/4 measure should default to whole rest on creation) #17

Open thedpws opened 4 years ago

thedpws commented 4 years ago

Implicitly add rests to the measure on instantiation.

  1. Measure() in 4/4 time should result in a measure with notes [ Rest(4.0) ]
  2. Appending notes should implicitly shrink the rest. m.append(Note('A', 1.0)) should result in notes [ Note(A', 1.0), Rest(3.0) ]
  3. Inserting notes allows implicitly creates rests on unfilled beats. m[0] = Note('A', 1.0), m[2] = Note('B', 1.0), should result in notes [ Note('A', 1.0), Rest(1.0), Note('B', 1.0), Rest(1.0) ]
thedpws commented 4 years ago

Also think about how to handle shrinking a note's duration after it's been put into a measure

How will the measure know about this change? Maybe it doesn't, until it tries to be iterated through and it sees a hole in it's rhythm, at which moment it returns an appropriately-lengthed rest.

A similar issue occurs when changing the time signature of a Part. How will its inner measures be informed that their length requirements have been changed?