|
|
@ -43,6 +43,9 @@ |
|
|
|
#include "UI.hpp" |
|
|
|
#include "UI.hpp" |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#include "drums.h" |
|
|
|
#include "drums.h" |
|
|
|
|
|
|
|
#if NUM_DRUMS > 4 |
|
|
|
|
|
|
|
#include "mixer8.h" |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Audio engines
|
|
|
|
// Audio engines
|
|
|
@ -89,11 +92,21 @@ AudioMixer4 audio_thru_mixer_l; |
|
|
|
AudioPlaySdRaw* Drum[NUM_DRUMS]; |
|
|
|
AudioPlaySdRaw* Drum[NUM_DRUMS]; |
|
|
|
AudioAmplifier* drum_volume[NUM_DRUMS]; |
|
|
|
AudioAmplifier* drum_volume[NUM_DRUMS]; |
|
|
|
AudioEffectMonoStereo* drum_mono2stereo[NUM_DRUMS]; |
|
|
|
AudioEffectMonoStereo* drum_mono2stereo[NUM_DRUMS]; |
|
|
|
|
|
|
|
#if NUM_DRUMS < 5 |
|
|
|
AudioMixer4 drum_mixer_r; |
|
|
|
AudioMixer4 drum_mixer_r; |
|
|
|
AudioMixer4 drum_mixer_l; |
|
|
|
AudioMixer4 drum_mixer_l; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioMixer8 drum_mixer_r; |
|
|
|
|
|
|
|
AudioMixer8 drum_mixer_l; |
|
|
|
|
|
|
|
#endif |
|
|
|
#ifdef USE_FX |
|
|
|
#ifdef USE_FX |
|
|
|
|
|
|
|
#if NUM_DRUMS < 5 |
|
|
|
AudioMixer4 drum_reverb_send_mixer_r; |
|
|
|
AudioMixer4 drum_reverb_send_mixer_r; |
|
|
|
AudioMixer4 drum_reverb_send_mixer_l; |
|
|
|
AudioMixer4 drum_reverb_send_mixer_l; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioMixer8 drum_reverb_send_mixer_r; |
|
|
|
|
|
|
|
AudioMixer8 drum_reverb_send_mixer_l; |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -585,7 +598,7 @@ void setup() |
|
|
|
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, 1.0); |
|
|
|
master_mixer_l.gain(3, 1.0); |
|
|
|
master_mixer_l.gain(3, 1.0); |
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
@ -810,6 +823,8 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) |
|
|
|
if (inNumber == drum_config[d].midinote) |
|
|
|
if (inNumber == drum_config[d].midinote) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t slot = drum_get_slot(drum_config[d].type); |
|
|
|
uint8_t slot = drum_get_slot(drum_config[d].type); |
|
|
|
|
|
|
|
if (Drum[slot]->isPlaying()) |
|
|
|
|
|
|
|
Drum[slot]->stop(); |
|
|
|
drum_volume[slot]->gain(pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); |
|
|
|
drum_volume[slot]->gain(pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); |
|
|
|
drum_mono2stereo[slot]->panorama(drum_config[d].pan); |
|
|
|
drum_mono2stereo[slot]->panorama(drum_config[d].pan); |
|
|
|
drum_reverb_send_mixer_r.gain(slot, pseudo_log_curve(drum_config[d].reverb_send)); |
|
|
|
drum_reverb_send_mixer_r.gain(slot, pseudo_log_curve(drum_config[d].reverb_send)); |
|
|
|