Fix for drum panorama problems.

pull/68/head
Holger Wirtz 3 years ago
parent 7ad3d2f528
commit fe556bebb5
  1. 14
      MicroDexed.ino
  2. 17
      drums.h

@ -276,10 +276,10 @@ void create_audio_drum_chain(uint8_t instance_id)
Drum[instance_id] = new AudioPlayMemory();
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_mixer_r, instance_id);
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 1, drum_mixer_l, instance_id);
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_mixer_l, instance_id);
#ifdef USE_FX
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_reverb_send_mixer_r, instance_id);
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 1, drum_reverb_send_mixer_l, instance_id);
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, drum_reverb_send_mixer_l, instance_id);
#endif
#ifdef DEBUG
@ -783,10 +783,10 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
uint8_t slot = drum_get_slot(drum_config[d].drum_class);
float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0);
drum_mixer_r.gain(slot, pan * pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)));
drum_mixer_l.gain(slot, (1.0 - pan) * pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)));
drum_reverb_send_mixer_r.gain(slot, pan * pseudo_log_curve(drum_config[d].reverb_send));
drum_reverb_send_mixer_l.gain(slot, (1.0 - pan) * pseudo_log_curve(drum_config[d].reverb_send));
drum_mixer_r.gain(slot, (1.0 - pan) * pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)));
drum_mixer_l.gain(slot, (pan) * pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)));
drum_reverb_send_mixer_r.gain(slot, (1.0 - pan) * pseudo_log_curve(drum_config[d].reverb_send));
drum_reverb_send_mixer_l.gain(slot, pan * pseudo_log_curve(drum_config[d].reverb_send));
if (drum_config[d].drum_data != NULL)
Drum[slot]->play(drum_config[d].drum_data);
@ -802,6 +802,8 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
Serial.print(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max), 2);
Serial.print(F(" P"));
Serial.print(drum_config[d].pan, 2);
Serial.print(F(" PAN"));
Serial.print(pan, 2);
Serial.print(F(" RS"));
Serial.println(drum_config[d].reverb_send, 2);
#endif

@ -46,7 +46,7 @@ typedef struct drum_config_s {
enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CHRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION};
#define NUM_DRUMSET_CONFIG 15
#define NUM_DRUMSET_CONFIG 16
drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
{
{
@ -63,10 +63,21 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
{
DRUM_HANDCLAP,
MIDI_CIS3,
"cp02",
"cp02l",
AudioSampleCp02,
"C",
-0.4,
-1.0,
0.6,
0.0,
0.4
},
{
DRUM_HANDCLAP,
MIDI_DIS3,
"cp02r",
AudioSampleCp02,
"C",
1.0,
0.6,
0.0,
0.4

Loading…
Cancel
Save