make_notes

scoretools.make_notes(pitches, durations, decrease_durations_monotonically=True, use_messiaen_style_ties=False)

Makes notes according to pitches and durations.

Example 1. Cycles through pitches when the length of pitches is less than the length of durations:

>>> notes = scoretools.make_notes([0], [(1, 16), (1, 8), (1, 8)])
>>> notes
Selection([Note("c'16"), Note("c'8"), Note("c'8")])
>>> staff = Staff(notes)
>>> show(staff) 

Example 2. Cycles through durations when the length of durations is less than the length of pitches:

>>> notes = scoretools.make_notes(
...     [0, 2, 4, 5, 7],
...     [(1, 16), (1, 8), (1, 8)],
...     )
>>> notes
Selection([Note("c'16"), Note("d'8"), Note("e'8"), Note("f'16"), Note("g'8")])
>>> staff = Staff(notes)
>>> show(staff) 

Example 3. Creates ad hoc tuplets for nonassignable durations:

>>> notes = scoretools.make_notes([0], [(1, 16), (1, 12), (1, 8)])
>>> notes
Selection([Note("c'16"), Tuplet(Multiplier(2, 3), "c'8"), Note("c'8")])
>>> staff = Staff(notes)
>>> show(staff) 

Example 4. Set decrease_durations_monotonically=True to express tied values in decreasing duration:

>>> notes = scoretools.make_notes(
...     [0],
...     [(13, 16)],
...     decrease_durations_monotonically=True,
...     )
>>> notes
Selection([Note("c'2."), Note("c'16")])
>>> staff = Staff(notes)
>>> show(staff) 

Example 5. Set decrease_durations_monotonically=False to express tied values in increasing duration:

>>> notes = scoretools.make_notes(
...     [0],
...     [(13, 16)],
...     decrease_durations_monotonically=False,
...     )
>>> notes
Selection([Note("c'16"), Note("c'2.")])
>>> staff = Staff(notes)
>>> show(staff) 

Example 6. Uses Messiaen-style ties:

>>> notes = scoretools.make_notes(
...     [0],
...     [(13, 16)],
...     use_messiaen_style_ties=True,
...     )
>>> staff = Staff(notes)
>>> show(staff) 

Set pitches to a single pitch or a sequence of pitches.

Set durations to a single duration or a list of durations.

Returns selection.