teensy players => amp down to 20%

This commit is contained in:
Dooho Yi 2021-06-17 12:21:43 +09:00
parent 6188746811
commit ff99cf2a16

View file

@ -47,8 +47,7 @@ AudioConnection patchCord8(amp2, 0, dacs1, 1);
Scheduler runner;
//sample #
int sample_now = 0; //0~99
void sample_player_start()
{
void sample_player_start() {
//filename buffer - 8.3 naming convension! 8+1+3+1 = 13
char filename[13] = "NNN.WAV";
//search for the sound file
@ -164,7 +163,7 @@ void receiveEvent(int numBytes) {
int velocity = str_velocity.toInt(); // 0 ~ 127
float amp_gain = (float)velocity / 127.0;
//
amp_gain = amp_gain * 0.7; // additional amp down. * 70%
amp_gain = amp_gain * 0.2; // 1.0 was too loud. => 0.2 max.
//
amp1.gain(amp_gain);
amp2.gain(amp_gain);
@ -260,8 +259,8 @@ void setup() {
mixer2.gain(1,1.0);
mixer2.gain(2,0);
mixer2.gain(3,0);
amp1.gain(1.0);
amp2.gain(1.0);
amp1.gain(0.2); // 1.0 was too loud. => 0.2
amp2.gain(0.2);
//let auto-poweroff speakers stay turned ON!
sine1.frequency(IDLE_FREQ);