2021-03-19 18:22:00 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2021 Artyom Skrobov
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2023-04-01 11:21:22 -04:00
|
|
|
#pragma once
|
2021-03-19 18:22:00 -04:00
|
|
|
|
2023-04-12 21:26:46 -04:00
|
|
|
#include "py/objnamedtuple.h"
|
2023-05-10 09:40:09 -04:00
|
|
|
#include "py/enum.h"
|
2023-04-12 21:26:46 -04:00
|
|
|
|
2023-05-10 09:40:09 -04:00
|
|
|
typedef enum synthio_bend_mode_e {
|
2023-05-11 17:53:40 -04:00
|
|
|
SYNTHIO_BEND_MODE_STATIC, SYNTHIO_BEND_MODE_VIBRATO, SYNTHIO_BEND_MODE_SWEEP, SYNTHIO_BEND_MODE_SWEEP_IN
|
2023-05-10 08:31:25 -04:00
|
|
|
} synthio_bend_mode_t;
|
|
|
|
|
2023-05-10 09:40:09 -04:00
|
|
|
extern const cp_enum_obj_t bend_mode_VIBRATO_obj;
|
2023-05-10 08:31:25 -04:00
|
|
|
extern const mp_obj_type_t synthio_bend_mode_type;
|
2023-04-12 21:26:46 -04:00
|
|
|
typedef struct synthio_synth synthio_synth_t;
|
2023-04-01 11:21:22 -04:00
|
|
|
extern int16_t shared_bindings_synthio_square_wave[];
|
2023-04-12 21:26:46 -04:00
|
|
|
extern const mp_obj_namedtuple_type_t synthio_envelope_type_obj;
|
|
|
|
void synthio_synth_envelope_set(synthio_synth_t *synth, mp_obj_t envelope_obj);
|
|
|
|
mp_obj_t synthio_synth_envelope_get(synthio_synth_t *synth);
|
2023-05-06 09:35:48 -04:00
|
|
|
mp_float_t common_hal_synthio_midi_to_hz_float(mp_float_t note);
|
|
|
|
mp_float_t common_hal_synthio_onevo_to_hz_float(mp_float_t note);
|