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();
#endif
Serial.begin(SERIAL_SPEED);
Serial.println(CrashReport);
#endif
#ifndef ENABLE_LCD_UI
#ifdef DEBUG
@ -878,14 +879,12 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
if (inNumber == drum_config[d].midinote)
{
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);
//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_l.gain(slot, 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 - fsin) * mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max));
drum_mixer_l.gain(slot, fsin * mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max));
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));
float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0);
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);

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

Loading…
Cancel
Save