Added Mixer8 for using up to 8 simultanious drums.

pull/54/head
Holger Wirtz 3 years ago
parent 80aa2440e4
commit 5e19003eb9
  1. 17
      MicroDexed.ino
  2. 2
      config.h

@ -43,6 +43,9 @@
#include "UI.hpp"
#if NUM_DRUMS > 0
#include "drums.h"
#if NUM_DRUMS > 4
#include "mixer8.h"
#endif
#endif
// Audio engines
@ -89,11 +92,21 @@ AudioMixer4 audio_thru_mixer_l;
AudioPlaySdRaw* Drum[NUM_DRUMS];
AudioAmplifier* drum_volume[NUM_DRUMS];
AudioEffectMonoStereo* drum_mono2stereo[NUM_DRUMS];
#if NUM_DRUMS < 5
AudioMixer4 drum_mixer_r;
AudioMixer4 drum_mixer_l;
#else
AudioMixer8 drum_mixer_r;
AudioMixer8 drum_mixer_l;
#endif
#ifdef USE_FX
#if NUM_DRUMS < 5
AudioMixer4 drum_reverb_send_mixer_r;
AudioMixer4 drum_reverb_send_mixer_l;
#else
AudioMixer8 drum_reverb_send_mixer_r;
AudioMixer8 drum_reverb_send_mixer_l;
#endif
#endif
#endif
@ -585,7 +598,7 @@ void setup()
master_mixer_r.gain(2, 0.0);
master_mixer_l.gain(2, 0.0);
#endif
master_mixer_r.gain(3, 1.0);
master_mixer_r.gain(3, 1.0);
master_mixer_l.gain(3, 1.0);
#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)
{
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_mono2stereo[slot]->panorama(drum_config[d].pan);
drum_reverb_send_mixer_r.gain(slot, pseudo_log_curve(drum_config[d].reverb_send));

@ -110,7 +110,7 @@
#define USE_FX 1
// NUMBER OF SAMPLEDRUMS
#define NUM_DRUMS 4
#define NUM_DRUMS 8
#define DRUM_MIDI_CHANNEL 1
// CHORUS parameters

Loading…
Cancel
Save