You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your documentation, you show the clip() and the binarize function (binarize()).
I have trouble understanding the output. My goal is to create a binary piano roll with the 16th note as the shortest allowed note, and limit the pitch from C0 to C8 (24-108). For every time stamp, the value should be 1 iff the note is played, and 0 otherwise. Thus, my desired output shape is (num_tracks, time_steps, 84), with the 84 being a multi-hot vector indicating if a pitch is played at a time step.
The following code is my attempt, the sample_file is sample.zip
#read midi, set shortest note duration to sixteenth note
multitrack = pypianoroll.read(sample_file, resolution=16) #set resolution to 16th note
#clip to range note pitches C0 to C8
clipped_multitrack = clipped = multitrack.clip(24, 108)
#get pianoroll for all tracks
normal_pianoroll = clipped_multitrack.stack()
print(normal_pianoroll.shape)
print(normal_pianoroll[0][0])
In your documentation, you show the
clip()
and the binarize function (binarize()
).I have trouble understanding the output. My goal is to create a binary piano roll with the 16th note as the shortest allowed note, and limit the pitch from C0 to C8 (24-108). For every time stamp, the value should be 1 iff the note is played, and 0 otherwise. Thus, my desired output shape is (num_tracks, time_steps, 84), with the 84 being a multi-hot vector indicating if a pitch is played at a time step.
The following code is my attempt, the
sample_file
issample.zip
The output is
What is the 24 standing for? And why is the last channel 128, and not 108-24=84, as I have clipped the pitch range?
To binarize, I run:
for which the output is:
Why is the last channel always "True", does that indicate that every pitch is always played?
Thanks in advance for your help in clarifying things!
The text was updated successfully, but these errors were encountered: