Skip to content

Provide easy way to disable MIDI quantization #192

@alexandermorgan

Description

@alexandermorgan

In processing a string quartet, I get the same offset values for the C and Bb in measure 2, beat 3 of the first violin in the snapshot below.
image
I'm running into this problem in music21 3.1.0, but not in 2.1.2. The way I use music21 to determine the offset of a note is with the following logic where event has already been filtered to make sure it has a 'Note', 'Rest', or 'Chord' type:

for y in event.contextSites():
    if y[0] is part:
        return y[1]

When I make a pandas.Series of these note, rest, or chord objects with their offsets as determined by the code above as the index, these are the first few values for the first violin:

0.000000               <music21.note.Rest rest>
3.000000                  <music21.note.Note E>
4.000000                  <music21.note.Note F>
5.500000                  <music21.note.Note A>
6.000000                  <music21.note.Note C>
6.000000                 <music21.note.Note B->
6.333333               <music21.note.Rest rest>
6.500000                  <music21.note.Note A>
7.000000                 <music21.note.Note B->
7.500000                  <music21.note.Note D>

Should I be using contextSites() differently in 3.1.0, or is there something else I'm missing? Just let me know if you'd like me to send the file. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions