Skip to content

monotonize_times doesn't do its job #251

@anusfoil

Description

@anusfoil

We have talked about using the monotonize_times to fix the performed note order reversal problem. But it turns out it's already being used in the tempo computations, but not actually returning a monotonic sequence.

To replicate using the data from score ../Datasets/pianodata-master/xml/chopin_op63_No1.xml and alignment ../Datasets/pianodata-master/match/chopin_op63_No1.match

# from the tempo_by_average function
eq_onsets = get_unique_seq(
    onsets=performed_onsets,
    offsets=performed_onsets + performed_durations,
    unique_onset_idxs=unique_onset_idxs,
)["u_onset"]

# Monotonize times
eq_onset_mt, unique_s_onsets_mt = monotonize_times(
    eq_onsets, deltas=unique_s_onsets
)

# check if the sequence eq_onset_mt is monotonic ascending
eq_onset_mt_ = np.append(eq_onset_mt[1:], eq_onset_mt[-1])
((eq_onset_mt_ - eq_onset_mt) >= 0).all()
# False

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions