-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayPureTone.ino
30 lines (24 loc) · 1009 Bytes
/
playPureTone.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
void playPureTone() {
/*This comes from teensytap directly.
We probably don't need metronome_nclicks_predelay (ask Clara).
This servers to schedule the auditory feedback which we will not have (I think, ask CZ)
*/
if (next_metronome_t == 0) { next_metronome_t = current_t + metronome_interval; }
/*
* Deal with the metronome
*/
// Is this a time to play a metronome click?
// if (metronome && (metronome_clicks_played < metronome_nclicks_predelay + metronome_nclicks)) {
if (metronome) { //AN: changed this to allow for infinite clicks until active = false.
if (current_t >= next_metronome_t) {
// Mark that we have another click played
metronome_clicks_played += 1;
// Play metronome click
sound1.play(AudioSampleSndstandard);
// And schedule the next upcoming metronome click
next_metronome_t += metronome_interval;
// Proudly tell the world that we have played the metronome click
// send_metronome_to_serial();
}
}
}