Fixing drums panning.

pull/65/head
Holger Wirtz 3 years ago
parent d1be990130
commit b2459d980d
  1. 15
      MicroDexed.ino
  2. 14
      drums.h

@ -466,6 +466,7 @@ void setup()
setup_debug_message(); setup_debug_message();
#endif #endif
Serial.begin(SERIAL_SPEED); Serial.begin(SERIAL_SPEED);
Serial.println(CrashReport);
#endif #endif
#ifndef ENABLE_LCD_UI #ifndef ENABLE_LCD_UI
#ifdef DEBUG #ifdef DEBUG
@ -878,14 +879,12 @@ 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].drum_class); uint8_t slot = drum_get_slot(drum_config[d].drum_class);
float fsin = mapfloat(arm_sin_f32(drum_config[d].pan * PI / 2.0), -1.0, 1.0, 0.0, 1.0); float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0);
//drum_mixer_r.gain(slot, (1.0 - fsin) * pseudo_log_curve(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max))); 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, fsin * 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_mixer_r.gain(slot, (1.0 - fsin) * 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_mixer_l.gain(slot, fsin * mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max)); drum_reverb_send_mixer_l.gain(slot, pan * pseudo_log_curve(drum_config[d].reverb_send));
drum_reverb_send_mixer_r.gain(slot, (1.0 - fsin) * pseudo_log_curve(drum_config[d].reverb_send));
drum_reverb_send_mixer_l.gain(slot, fsin * pseudo_log_curve(drum_config[d].reverb_send));
if (drum_config[d].drum_data != NULL) if (drum_config[d].drum_data != NULL)
Drum[slot]->play(drum_config[d].drum_data); Drum[slot]->play(drum_config[d].drum_data);

@ -89,8 +89,8 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
AudioSampleHh01, AudioSampleHh01,
"h", "h",
0.8, 0.8,
0.8, 1.0,
0.0, 0.5,
0.0 0.0
}, },
{ {
@ -100,8 +100,8 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
AudioSampleHh02, AudioSampleHh02,
"h", "h",
0.8, 0.8,
0.8, 1.0,
0.0, 0.5,
0.0 0.0
}, },
{ {
@ -110,9 +110,9 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
"oh02", "oh02",
AudioSampleOh02, AudioSampleOh02,
"H", "H",
0.8, -0.8,
0.8, 1.0,
0.0, 0.5,
0.0 0.0
}, },
{ {

Loading…
Cancel
Save