Class fx_pedal¶
Defined in File dreammakerfx.h
Class Documentation¶
-
class
fx_pedal
¶ The pedal.
The
pedal
object is the root of all functionality on DreamMakerFx. We reference this object when wiring effects together and controlling the various knobs, buttons, lights, etc.An effect will always have a few common elements:
#include <dreammakerfx.h> void setup() { // Initialize the pedal hardware pedal.init(); // Route audio through the pedal to any effects modules pedal.route_audio(pedal.instr_in, pedal.amp_out); // Run the effect on the DSP pedal.run(); } void loop() { // Exchange information wiht the DSP pedal.service(); }
There are several other functions that control the buttons, lights/LEDs, knobs/pots and toggle switches.
Public Functions
-
fx_pedal
()¶
-
void
init
(void)¶ Initializes the pedal object with default debug level (just warnings and errors)
-
void
init
(DEBUG_MSG_LEVEL debug_level)¶ Initializes the pedal object with user defined debug level.
- Parameters
[in] debug_level
: The debug level to display (MSG_DEBUG, MSG_INFO, MSG_WARN, MSG_ERROR)
-
void
init
(DEBUG_MSG_LEVEL debug_level, bool dsp_no_reset)¶ Initializes the pedal object with used defined debug level, bypasses DSP reset.
- Parameters
[in] debug_level
: The debug level to display (MSG_DEBUG, MSG_INFO, MSG_WARN, MSG_ERROR)[in] dsp_no_reset
: The dsp no reset (set to true to bypass reset)
-
void
init
(bool debug_enable)¶
-
void
init
(bool debug_enable, bool dsp_telem)¶
-
bool
run
(void)¶ Runs the current canvas (i.e. compiles and downloads to the DSP)
- Return
True if successful, false if not
-
void
service
(void)¶ Pedal service function that should be called in the Arduino loop() function.
-
bool
route_audio
(fx_audio_node *out, fx_audio_node *in)¶ Routes a source node (output) to a destination mode (input)
- Return
True is successful, false if not
- Parameters
src
: The source / outputdest
: The destination / input
-
bool
route_control
(fx_control_node *src, fx_control_node *dest)¶ Route a control source node (output) to a destination mode (input)
- Return
True is successful, false if not
- Parameters
src
: The source node (should be an output)dest
: The destination node (should be an input)
-
bool
route_control
(fx_control_node *src, fx_control_node *dest, float scale, float offset)¶ Route a control source node (output) to a destination mode (input)
- Return
True is successful, false if not
- Parameters
src
: The source node (should be an output)dest
: The destination node (should be an input)[in] scale
: The scale to apply to the control value[in] offset
: The offset to apply to the control value
Set one of the footswitches to be a bypass button.
This function will also set the corresponding LED to turn on and off when bypass is disabled / enabled.
- Parameters
[in] footswitch
: The footswitch (FOOTSWITCH_RIGHT, FOOTSWITCH_LEFT)
Set one of the footswitches to be a tap tempo / length button.
- Parameters
[in] footswitch
: The footswitch (FOOTSWITCH_RIGHT, FOOTSWITCH_LEFT, FOOTSWITCH_BOTH)[in] enable_led_flash
: Set the corresponding LED to flash at tempo rate
-
void
bypass_fx
(void)¶
-
void
enable_fx
(void)¶
-
bool
new_tap_interval
(void)¶ Returns true when a new tap interval has been tapped in by the user.
- Return
{ description_of_the_return_value }
-
float
get_tap_interval_ms
(void)¶ Returns the current tap interval in milliseconds.
- Return
The tap interval in milliseconds.
-
float
get_tap_freq_hz
(void)¶ Returns the current tap interval in Hertz (cycles / second)
- Return
The tap frequency in Hertz
-
void
set_tap_blink_rate_hz
(float rate_hz)¶ Sets the LED blink rate for tap interval.
Use this if there is a pot that can also change the tempo / rate / duration to override what has been previously “tapped” in.
- Parameters
[in] rate_hz
: The new blink rate in Hertz
-
void
set_tap_blink_rate_hz
(float rate_hz, FOOTSWITCH led)¶ Sets the LED blink rate for tap interval with LED control.
Use this if there is a pot that can also change the tempo / rate / duration to override what has been previously “tapped” in.
- Parameters
[in] rate_hz
: The new blink rate in Hertz[in] led
: Which LED to flash (FOOTSWITCH_LEFT, FOOTSWITCH_RIGHT)
-
void
set_tap_blink_rate_ms
(float ms)¶ Sets the LED blink rate in milliseconds.
Use this if there is a pot that can also change the tempo / rate / duration to override what has been previously “tapped” in.
- Parameters
[in] ms
: The blink rate in milliseconds
-
void
set_tap_blink_rate_ms
(float ms, FOOTSWITCH led)¶ Sets the LED blink rate for tap interval with LED control.
Use this if there is a pot that can also change the tempo / rate / duration to override what has been previously “tapped” in.
- Parameters
[in] ms
: The new blink period in milliseconds[in] led
: Which LED to flash (FOOTSWITCH_LEFT, FOOTSWITCH_RIGHT)
Checks if a button was just pressed and optionally turns on an LED when it is.
This function is used to create events when a button is held down and released to momentarily enable / disable functionality.
- Return
true if button is pressed, false if not
- Parameters
[in] footswitch
: The footswitch (FOOTSWITCH_LEFT, FOOTSWITCH_RIGHT, (FOOTSWITCH_LEFT, FOOTSWITCH_BOTH)[in] enable_led
: If true, lights LED while button pressed
Checks if a button was just released and optionally turns off an LED when it was.
This function is used to create events when a button is held down and released to momentarily enable / disable functionality.
- Return
{ description_of_the_return_value }
- Parameters
[in] footswitch
: The footswitch (FOOTSWITCH_LEFT, FOOTSWITCH_RIGHT, (FOOTSWITCH_LEFT, FOOTSWITCH_BOTH)[in] enable_led
: If true, turns off the LED when button is released
-
void
register_tap
(void)¶
-
void
print_instance_stack
(void)¶ Utility function to print the instance stack to the console.
-
void
print_routing_table
(void)¶ Utility function to print the routing table to the console.
-
void
print_param_tables
(void)¶ Utility function to print the parameter tables.
-
void
print_processor_load
(int seconds)¶ Prints the current processor loading (percentage) to Serial console.
- Parameters
[in] seconds
: How many seconds to wait before displaying the loading again
-
void
spi_transmit_param
(EFFECT_TYPE instance_type, uint32_t instance_id, PARAM_TYPES param_type, uint8_t param_id, void *value)¶
-
void
parameter_service
(void)¶
Public Members
-
bool
bypass_control_enabled
¶
-
bool
bypassed
¶
-
FOOTSWITCH
bypass_footswitch
¶
-
bool
tap_control_enabled
¶
-
bool
tap_blink_only_enabled
¶
-
FOOTSWITCH
tap_footswitch
¶
-
fx_audio_node *
instr_in
¶ Alias for left instrument in (mono)
-
fx_audio_node *
instr_in_l
¶ Left instrument in node
-
fx_audio_node *
instr_in_r
¶ Right instrument in node
-
fx_audio_node *
amp_out
¶ Alias for left instrument out (mono)
-
fx_audio_node *
amp_out_l
¶ Left amp out node
-
fx_audio_node *
amp_out_r
¶ Right amp out node
-
fx_audio_node *
mic_in_l
¶
-
fx_audio_node *
mic_in_r
¶
-
fx_control_node *
note_frequency
¶ Pedal variable of current note frequency
-
fx_control_node *
note_duration
¶ Pedal variable of current note duration in milliseconds
-
fx_control_node *
new_note
¶ Pedal variable of when a new note is played
Friends
-
friend
fx_pedal::fx_effect
-