forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9776 from relic-se/audiofilters_distortion
audiofilters: Add Distortion effect and implement LFO ticking
- Loading branch information
Showing
16 changed files
with
995 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include "shared-module/audiofilters/Distortion.h" | ||
|
||
extern const mp_obj_type_t audiofilters_distortion_type; | ||
extern const mp_obj_type_t audiofilters_distortion_mode_type; | ||
|
||
void common_hal_audiofilters_distortion_construct(audiofilters_distortion_obj_t *self, | ||
mp_obj_t drive, mp_obj_t pre_gain, mp_obj_t post_gain, | ||
audiofilters_distortion_mode mode, bool soft_clip, mp_obj_t mix, | ||
uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, | ||
uint8_t channel_count, uint32_t sample_rate); | ||
|
||
void common_hal_audiofilters_distortion_deinit(audiofilters_distortion_obj_t *self); | ||
bool common_hal_audiofilters_distortion_deinited(audiofilters_distortion_obj_t *self); | ||
|
||
uint32_t common_hal_audiofilters_distortion_get_sample_rate(audiofilters_distortion_obj_t *self); | ||
uint8_t common_hal_audiofilters_distortion_get_channel_count(audiofilters_distortion_obj_t *self); | ||
uint8_t common_hal_audiofilters_distortion_get_bits_per_sample(audiofilters_distortion_obj_t *self); | ||
|
||
mp_obj_t common_hal_audiofilters_distortion_get_drive(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_drive(audiofilters_distortion_obj_t *self, mp_obj_t arg); | ||
|
||
mp_obj_t common_hal_audiofilters_distortion_get_pre_gain(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_pre_gain(audiofilters_distortion_obj_t *self, mp_obj_t arg); | ||
|
||
mp_obj_t common_hal_audiofilters_distortion_get_post_gain(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_post_gain(audiofilters_distortion_obj_t *self, mp_obj_t arg); | ||
|
||
audiofilters_distortion_mode common_hal_audiofilters_distortion_get_mode(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_mode(audiofilters_distortion_obj_t *self, audiofilters_distortion_mode mode); | ||
|
||
bool common_hal_audiofilters_distortion_get_soft_clip(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_soft_clip(audiofilters_distortion_obj_t *self, bool soft_clip); | ||
|
||
mp_obj_t common_hal_audiofilters_distortion_get_mix(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_set_mix(audiofilters_distortion_obj_t *self, mp_obj_t arg); | ||
|
||
bool common_hal_audiofilters_distortion_get_playing(audiofilters_distortion_obj_t *self); | ||
void common_hal_audiofilters_distortion_play(audiofilters_distortion_obj_t *self, mp_obj_t sample, bool loop); | ||
void common_hal_audiofilters_distortion_stop(audiofilters_distortion_obj_t *self); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.