Skip to content

Commit 60b233f

Browse files
committed
document EnvelopeState
1 parent 70cf061 commit 60b233f

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

shared-bindings/synthio/__init__.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@
4545

4646
#include "shared-module/synthio/LFO.h"
4747

48+
//| class EnvelopeState:
49+
//| ATTACK: EnvelopeState
50+
//| """The note is in its attack phase"""
51+
//| DECAY: EnvelopeState
52+
//| """The note is in its decay phase"""
53+
//| SUSTAIN: EnvelopeState
54+
//| """The note is in its sustain phase"""
55+
//| RELEASE: EnvelopeState
56+
//| """The note is in its release phase"""
57+
//|
4858
MAKE_ENUM_VALUE(synthio_note_state_type, note_state, ATTACK, SYNTHIO_ENVELOPE_STATE_ATTACK);
4959
MAKE_ENUM_VALUE(synthio_note_state_type, note_state, DECAY, SYNTHIO_ENVELOPE_STATE_DECAY);
5060
MAKE_ENUM_VALUE(synthio_note_state_type, note_state, SUSTAIN, SYNTHIO_ENVELOPE_STATE_SUSTAIN);
@@ -59,7 +69,7 @@ MAKE_ENUM_MAP(synthio_note_state) {
5969

6070
STATIC MP_DEFINE_CONST_DICT(synthio_note_state_locals_dict, synthio_note_state_locals_table);
6171
MAKE_PRINTER(synthio, synthio_note_state);
62-
MAKE_ENUM_TYPE(synthio, NoteState, synthio_note_state);
72+
MAKE_ENUM_TYPE(synthio, EnvelopeState, synthio_note_state);
6373

6474
#define default_attack_time (MICROPY_FLOAT_CONST(0.1))
6575
#define default_decay_time (MICROPY_FLOAT_CONST(0.05))
@@ -332,7 +342,7 @@ STATIC const mp_rom_map_elem_t synthio_module_globals_table[] = {
332342
{ MP_ROM_QSTR(MP_QSTR_MathOperation), MP_ROM_PTR(&synthio_math_operation_type) },
333343
{ MP_ROM_QSTR(MP_QSTR_MidiTrack), MP_ROM_PTR(&synthio_miditrack_type) },
334344
{ MP_ROM_QSTR(MP_QSTR_Note), MP_ROM_PTR(&synthio_note_type) },
335-
{ MP_ROM_QSTR(MP_QSTR_NoteState), MP_ROM_PTR(&synthio_note_state_type) },
345+
{ MP_ROM_QSTR(MP_QSTR_EnvelopeState), MP_ROM_PTR(&synthio_note_state_type) },
336346
{ MP_ROM_QSTR(MP_QSTR_LFO), MP_ROM_PTR(&synthio_lfo_type) },
337347
{ MP_ROM_QSTR(MP_QSTR_Synthesizer), MP_ROM_PTR(&synthio_synthesizer_type) },
338348
{ MP_ROM_QSTR(MP_QSTR_from_file), MP_ROM_PTR(&synthio_from_file_obj) },
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
None 0.00
22
press
3-
synthio.NoteState.ATTACK 0.23
4-
synthio.NoteState.ATTACK 0.46
5-
synthio.NoteState.ATTACK 0.70
6-
synthio.NoteState.ATTACK 0.93
7-
synthio.NoteState.DECAY 1.00
8-
synthio.NoteState.DECAY 0.91
9-
synthio.NoteState.DECAY 0.81
10-
synthio.NoteState.SUSTAIN 0.80
11-
synthio.NoteState.SUSTAIN 0.80
3+
synthio.EnvelopeState.ATTACK 0.23
4+
synthio.EnvelopeState.ATTACK 0.46
5+
synthio.EnvelopeState.ATTACK 0.70
6+
synthio.EnvelopeState.ATTACK 0.93
7+
synthio.EnvelopeState.DECAY 1.00
8+
synthio.EnvelopeState.DECAY 0.91
9+
synthio.EnvelopeState.DECAY 0.81
10+
synthio.EnvelopeState.SUSTAIN 0.80
11+
synthio.EnvelopeState.SUSTAIN 0.80
1212
release
13-
synthio.NoteState.RELEASE 0.80
14-
synthio.NoteState.RELEASE 0.71
15-
synthio.NoteState.RELEASE 0.61
16-
synthio.NoteState.RELEASE 0.52
17-
synthio.NoteState.RELEASE 0.43
18-
synthio.NoteState.RELEASE 0.34
19-
synthio.NoteState.RELEASE 0.24
20-
synthio.NoteState.RELEASE 0.15
21-
synthio.NoteState.RELEASE 0.06
22-
synthio.NoteState.RELEASE 0.00
13+
synthio.EnvelopeState.RELEASE 0.80
14+
synthio.EnvelopeState.RELEASE 0.71
15+
synthio.EnvelopeState.RELEASE 0.61
16+
synthio.EnvelopeState.RELEASE 0.52
17+
synthio.EnvelopeState.RELEASE 0.43
18+
synthio.EnvelopeState.RELEASE 0.34
19+
synthio.EnvelopeState.RELEASE 0.24
20+
synthio.EnvelopeState.RELEASE 0.15
21+
synthio.EnvelopeState.RELEASE 0.06
22+
synthio.EnvelopeState.RELEASE 0.00
2323
None 0.00

0 commit comments

Comments
 (0)