pyampact.symbolic.sampled
- pyampact.symbolic.sampled(piece, bpm=60, obs=24)[source]
Sample the score according to the given beats per minute (bpm) and the desired observations per second (obs). This method is primarily used as an intermediate step in the construction of a mask. It builds on the pianoRoll by sampling the time axis (columns) at the desired rate. The result is a DataFrame where each row corresponds to a MIDI pitch (0 to 127), and each column corresponds to a timepoint in the sampled score. The difference between this and the pianoRoll is that the columns are sampled at a regular time intervals, rather than at each new event as they are in the pianoRoll.
- Parameters:
bpm – Integer, default 60. The beats per minute to use for sampling.
obs – Integer, default 24. The desired observations per second.
- Returns:
A DataFrame representing the sampled score. Each row corresponds to a MIDI pitch (0 to 127), and each column corresponds to a timepoint in the sampled score. The values are 1 for a note onset and 0 otherwise.
See also