|
|
@ -36,7 +36,7 @@ |
|
|
|
#include "effect_modulated_delay.h" |
|
|
|
#include "effect_modulated_delay.h" |
|
|
|
#include "effect_stereo_mono.h" |
|
|
|
#include "effect_stereo_mono.h" |
|
|
|
#include "effect_mono_stereo.h" |
|
|
|
#include "effect_mono_stereo.h" |
|
|
|
#include "sequencer_timer.h" |
|
|
|
#include "audio_timer.h" |
|
|
|
#ifdef USE_PLATEREVERB |
|
|
|
#ifdef USE_PLATEREVERB |
|
|
|
#include "effect_platervbstereo.h" |
|
|
|
#include "effect_platervbstereo.h" |
|
|
|
#else |
|
|
|
#else |
|
|
@ -141,34 +141,59 @@ AudioMixer8 drum_reverb_send_mixer_l; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); |
|
|
|
{stereo2mono, 0, i2s1, 0}, |
|
|
|
AudioConnection patchCord11(stereo2mono, 1, i2s1, 1); |
|
|
|
{stereo2mono, 1, i2s1, 1}, |
|
|
|
#elif defined(TGA_AUDIO_BOARD) |
|
|
|
#elif defined(TGA_AUDIO_BOARD) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord10(stereo2mono, 0, i2s1, 0); |
|
|
|
{stereo2mono, 0, i2s1, 0}, |
|
|
|
AudioConnection patchCord11(stereo2mono, 1, i2s1, 1); |
|
|
|
{stereo2mono, 1, i2s1, 1}, |
|
|
|
AudioControlWM8731master wm8731_1; |
|
|
|
AudioControlWM8731master wm8731_1; |
|
|
|
#elif defined(PT8211_AUDIO) |
|
|
|
#elif defined(PT8211_AUDIO) |
|
|
|
AudioOutputPT8211 pt8211_1; |
|
|
|
AudioOutputPT8211 pt8211_1; |
|
|
|
AudioConnection patchCord10(stereo2mono, 0, pt8211_1, 0); |
|
|
|
{stereo2mono, 0, pt8211_1, 0}, |
|
|
|
AudioConnection patchCord11(stereo2mono, 1, pt8211_1, 1); |
|
|
|
{stereo2mono, 1, pt8211_1, 1}, |
|
|
|
#elif defined(TEENSY_DAC_SYMMETRIC) |
|
|
|
#elif defined(TEENSY_DAC_SYMMETRIC) |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioMixer4 invMixer; |
|
|
|
AudioMixer4 invMixer; |
|
|
|
AudioConnection patchCord10(stereo2mono, 0, dacOut , 0); |
|
|
|
{stereo2mono, 0, dacOut , 0}, |
|
|
|
AudioConnection patchCord11(stereo2mono, 1, invMixer, 0); |
|
|
|
{stereo2mono, 1, invMixer, 0}, |
|
|
|
AudioConnection patchCord12(invMixer, 0, dacOut , 1); |
|
|
|
{invMixer, 0, dacOut , 1}, |
|
|
|
#elif defined(TEENSY_DAC) |
|
|
|
#elif defined(TEENSY_DAC) |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioConnection patchCord10(stereo2mono, 0, dacOut, 0); |
|
|
|
{stereo2mono, 0, dacOut, 0}, |
|
|
|
AudioConnection patchCord11(stereo2mono, 1, dacOut, 1); |
|
|
|
{stereo2mono, 1, dacOut, 1}, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef AUDIO_DEVICE_USB |
|
|
|
#ifdef AUDIO_DEVICE_USB |
|
|
|
AudioOutputUSB usb1; |
|
|
|
AudioOutputUSB usb1; |
|
|
|
AudioConnection patchCord13(stereo2mono, 0, usb1, 0); |
|
|
|
{stereo2mono, 0, usb1, 0}, |
|
|
|
AudioConnection patchCord14(stereo2mono, 1, usb1, 1); |
|
|
|
{stereo2mono, 1, usb1, 1}, |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
|
|
|
|
AudioInputI2S i2s1in; |
|
|
|
|
|
|
|
{stereo2mono, 0, audio_thru_mixer_r, 0}, |
|
|
|
|
|
|
|
{stereo2mono, 1, audio_thru_mixer_l, 0}, |
|
|
|
|
|
|
|
{i2s1in, 0, audio_thru_mixer_r, 1}, |
|
|
|
|
|
|
|
{i2s1in, 1, audio_thru_mixer_l, 1}, |
|
|
|
|
|
|
|
{audio_thru_mixer_r, 0, i2s1, 0}, |
|
|
|
|
|
|
|
{audio_thru_mixer_l, 0, i2s1, 1}, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
|
|
|
#ifdef USE_FX |
|
|
|
|
|
|
|
{drum_reverb_send_mixer_r, 0, reverb_mixer_r, 2}, |
|
|
|
|
|
|
|
{drum_reverb_send_mixer_l, 0, reverb_mixer_l, 2}, |
|
|
|
|
|
|
|
{drum_mixer_r, 0, master_mixer_r, 2}, |
|
|
|
|
|
|
|
{drum_mixer_l, 0, master_mixer_l, 2}, |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
{drum_mixer_r, 0, master_mixer_r, 2}, |
|
|
|
|
|
|
|
{drum_mixer_l, 0, master_mixer_l, 2}, |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AudioTimer audio_timer; |
|
|
|
|
|
|
|
{reverb_mixer_r, audio_timer} |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// Audio chain tail
|
|
|
|
// Audio chain tail
|
|
|
@ -252,8 +277,8 @@ AudioConnection patchCord22(drum_mixer_l, 0, master_mixer_l, 2); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
AudioSequencerTimer sequencer_timer; |
|
|
|
AudioTimer audio_timer; |
|
|
|
AudioConnection patchCord25(reverb_mixer_r, sequencer_timer); |
|
|
|
AudioConnection patchCord25(reverb_mixer_r, audio_timer); |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Dynamic patching of MicroDexed objects
|
|
|
|
// Dynamic patching of MicroDexed objects
|
|
|
@ -657,31 +682,31 @@ void setup() |
|
|
|
#if NUM_DEXED > 1 |
|
|
|
#if NUM_DEXED > 1 |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
master_mixer_r.gain(instance_id, 1.0); |
|
|
|
master_mixer_r.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(instance_id, 1.0); |
|
|
|
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT); |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(0, 1.0); |
|
|
|
master_mixer_r.gain(0, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(0, 1.0); |
|
|
|
master_mixer_l.gain(0, VOL_MAX_FLOAT); |
|
|
|
master_mixer_r.gain(1, 0.0); |
|
|
|
master_mixer_r.gain(1, 0.0); |
|
|
|
master_mixer_l.gain(1, 0.0); |
|
|
|
master_mixer_l.gain(1, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
master_mixer_r.gain(2, 1.0); |
|
|
|
master_mixer_r.gain(2, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(2, 1.0); |
|
|
|
master_mixer_l.gain(2, VOL_MAX_FLOAT); |
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(2, 0.0); |
|
|
|
master_mixer_r.gain(2, 0.0); |
|
|
|
master_mixer_l.gain(2, 0.0); |
|
|
|
master_mixer_l.gain(2, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
master_mixer_r.gain(3, 1.0); |
|
|
|
master_mixer_r.gain(3, VOL_MAX_FLOAT); |
|
|
|
master_mixer_l.gain(3, 1.0); |
|
|
|
master_mixer_l.gain(3, VOL_MAX_FLOAT); |
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
audio_thru_mixer_r.gain(0, 1.0); // MD signal sum
|
|
|
|
audio_thru_mixer_r.gain(0, VOL_MAX_FLOAT); // MD signal sum
|
|
|
|
audio_thru_mixer_l.gain(0, 1.0); // MD signal sum
|
|
|
|
audio_thru_mixer_l.gain(0, VOL_MAX_FLOAT); // MD signal sum
|
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
audio_thru_mixer_r.gain(1, 1.0); // I2S nput
|
|
|
|
audio_thru_mixer_r.gain(1, VOL_MAX_FLOAT); // I2S input
|
|
|
|
audio_thru_mixer_l.gain(1, 1.0); // I2S input
|
|
|
|
audio_thru_mixer_l.gain(1, VOL_MAX_FLOAT); // I2S input
|
|
|
|
#else |
|
|
|
#else |
|
|
|
audio_thru_mixer_r.gain(1, 0.0); |
|
|
|
audio_thru_mixer_r.gain(1, 0.0); |
|
|
|
audio_thru_mixer_l.gain(1, 0.0); |
|
|
|
audio_thru_mixer_l.gain(1, 0.0); |
|
|
@ -692,8 +717,8 @@ void setup() |
|
|
|
audio_thru_mixer_l.gain(3, 0.0); |
|
|
|
audio_thru_mixer_l.gain(3, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
sequencer_timer.set_bpm(60); |
|
|
|
audio_timer.set_bpm(60); |
|
|
|
sequencer_timer.step_function(&testfunc); |
|
|
|
audio_timer.function(4, &testfunc); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
Serial.println(F("<setup end>")); |
|
|
|