Added Mixer8 for using up to 8 simultanious drums.

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

@ -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
@ -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));

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

Loading…
Cancel
Save