From cbc9f48ea45379c7a1c776520a32bb71629c3462 Mon Sep 17 00:00:00 2001 From: sildater Date: Fri, 19 Jul 2024 14:10:13 +0200 Subject: [PATCH] improve documentation performance note_array --- partitura/performance.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/partitura/performance.py b/partitura/performance.py index 8957491b..ef434120 100644 --- a/partitura/performance.py +++ b/partitura/performance.py @@ -152,8 +152,8 @@ def num_tracks(self) -> int: def note_array(self, *args, **kwargs) -> np.ndarray: """Structured array containing performance information. - The fields are 'id', 'pitch', 'onset_div', 'duration_div', - 'onset_sec', 'duration_sec' and 'velocity'. + The fields are 'id', 'pitch', 'onset_tick', 'duration_tick', + 'onset_sec', 'duration_sec', 'track', 'channel', and 'velocity'. """ fields = [ @@ -206,9 +206,19 @@ def from_note_array( id: str = None, part_name: str = None, ): - """Create an instance of PerformedPart from a note_array. + """ + Create an instance of PerformedPart from a note_array. Note that this property does not include non-note information (i.e. - controls such as sustain pedal). + controls such as sustain pedal, program changes, tempo changes, etc.). + + The following fields are mandatory: + 'pitch', 'onset_sec', 'duration_sec', and 'velocity'. + + The following fields are used if available: + 'id', 'track', 'channel'. + + The following fields are ignored: + 'onset_tick', 'duration_tick', all others """ if "id" not in note_array.dtype.names: n_ids = ["n{0}".format(i) for i in range(len(note_array))]