Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tonesweep ignores t_time if t_lo = t_hi #296

Open
waltsatan opened this issue Mar 28, 2019 · 1 comment
Open

Tonesweep ignores t_time if t_lo = t_hi #296

waltsatan opened this issue Mar 28, 2019 · 1 comment

Comments

@waltsatan
Copy link

Description

Tonesweep ignores t_time if t_lo = t_hi. If both values are the same, the tone plays continually.

Hardware & Software

Teensy 3.2
Arduino IDE 1.85
Teensyduino 1.45

Arduino Sketch

#include <Audio.h>

AudioSynthToneSweep      tonesweep;
AudioOutputAnalog        dac;
AudioConnection          patchCord1(tonesweep1, dac);

void setup() {
	AudioMemory(16);
}

unsigned long lastTone;

void loop() {
	if ( millis() - lastTone > 2000 ) {
		tonesweep.play(1.0, 659, 659, 0.5);
		lastTone=millis();
	}
}
@waltsatan
Copy link
Author

I was just inspecting synth_tonesweep.cpp and sweep_busy requires an incremental value derived from the hi-low value for it to stop playback (line 109). I think storing the start play time and stopping it if the current millis() - start_time is > t_time would be the only fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant