@@ -85,7 +85,7 @@ mp_float_t common_hal_synthio_note_get_tremolo_depth(synthio_note_obj_t *self) {
85
85
void common_hal_synthio_note_set_tremolo_depth (synthio_note_obj_t * self , mp_float_t value_in ) {
86
86
mp_float_t val = mp_arg_validate_float_range (value_in , 0 , 1 , MP_QSTR_tremolo_depth );
87
87
self -> tremolo_descr .amplitude = val ;
88
- self -> tremolo_state .amplitude_scaled = round_float_to_int (val * 32767 );
88
+ self -> tremolo_state .amplitude_scaled = round_float_to_int (val * 32768 );
89
89
}
90
90
91
91
mp_float_t common_hal_synthio_note_get_tremolo_rate (synthio_note_obj_t * self ) {
@@ -96,7 +96,7 @@ void common_hal_synthio_note_set_tremolo_rate(synthio_note_obj_t *self, mp_float
96
96
mp_float_t val = mp_arg_validate_float_range (value_in , 0 , 60 , MP_QSTR_tremolo_rate );
97
97
self -> tremolo_descr .frequency = val ;
98
98
if (self -> sample_rate != 0 ) {
99
- self -> tremolo_state .dds = synthio_frequency_convert_float_to_dds (val , self -> sample_rate );
99
+ self -> tremolo_state .dds = synthio_frequency_convert_float_to_dds (val * 65536 , self -> sample_rate );
100
100
}
101
101
}
102
102
@@ -107,7 +107,7 @@ mp_float_t common_hal_synthio_note_get_bend_depth(synthio_note_obj_t *self) {
107
107
void common_hal_synthio_note_set_bend_depth (synthio_note_obj_t * self , mp_float_t value_in ) {
108
108
mp_float_t val = mp_arg_validate_float_range (value_in , -1 , 1 , MP_QSTR_bend_depth );
109
109
self -> bend_descr .amplitude = val ;
110
- self -> bend_state .amplitude_scaled = round_float_to_int (val * 32767 );
110
+ self -> bend_state .amplitude_scaled = round_float_to_int (val * 32768 );
111
111
}
112
112
113
113
mp_float_t common_hal_synthio_note_get_bend_rate (synthio_note_obj_t * self ) {
@@ -127,7 +127,7 @@ void common_hal_synthio_note_set_bend_rate(synthio_note_obj_t *self, mp_float_t
127
127
mp_float_t val = mp_arg_validate_float_range (value_in , 0 , 60 , MP_QSTR_bend_rate );
128
128
self -> bend_descr .frequency = val ;
129
129
if (self -> sample_rate != 0 ) {
130
- self -> bend_state .dds = synthio_frequency_convert_float_to_dds (val , self -> sample_rate );
130
+ self -> bend_state .dds = synthio_frequency_convert_float_to_dds (val * 65536 , self -> sample_rate );
131
131
}
132
132
}
133
133
0 commit comments