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
Copy file name to clipboardExpand all lines: shared-bindings/synthio/MidiTrack.c
+27-4Lines changed: 27 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,8 @@
44
44
//| tempo: int,
45
45
//| *,
46
46
//| sample_rate: int = 11025,
47
-
//| waveform: ReadableBuffer = None
47
+
//| waveform: Optional[ReadableBuffer] = None,
48
+
//| envelope: Optional[Envelope] = None,
48
49
//| ) -> None:
49
50
//| """Create a MidiTrack from the given stream of MIDI events. Only "Note On" and "Note Off" events
50
51
//| are supported; channel numbers and key velocities are ignored. Up to two notes may be on at the
@@ -54,6 +55,7 @@
54
55
//| :param int tempo: Tempo of the streamed events, in MIDI ticks per second
55
56
//| :param int sample_rate: The desired playback sample rate; higher sample rate requires more memory
56
57
//| :param ReadableBuffer waveform: A single-cycle waveform. Default is a 50% duty cycle square wave. If specified, must be a ReadableBuffer of type 'h' (signed 16 bit)
58
+
//| :param Envelope envelope: An object that defines the loudness of a note over time. The default envelope provides no ramping, voices turn instantly on and off.
//| At least 2 simultaneous notes are supported. mimxrt10xx and rp2040 platforms support up to
46
-
//| 12 notes.
47
-
//|
48
51
//| Notes use MIDI note numbering, with 60 being C4 or Middle C, approximately 262Hz.
49
52
//|
50
53
//| :param int sample_rate: The desired playback sample rate; higher sample rate requires more memory
51
-
//| :param ReadableBuffer waveform: A single-cycle waveform. Default is a 50% duty cycle square wave. If specified, must be a ReadableBuffer of type 'h' (signed 16 bit). It is permitted to modify this buffer during synthesis. This can be used, for instance, to control the overall volume or timbre of the notes.
54
+
//| :param ReadableBuffer waveform: A single-cycle waveform. Default is a 50% duty cycle square wave. If specified, must be a ReadableBuffer of type 'h' (signed 16 bit)
55
+
//| :param Optional[Envelope] envelope: An object that defines the loudness of a note over time. The default envelope, `None` provides no ramping, voices turn instantly on and off.
//| """The envelope to apply to all notes. `None`, the default envelope, instantly turns notes on and off. The envelope may be changed dynamically, but it affects all notes (even currently playing notes)"""
0 commit comments