#include <Plaquette.h>
SineWave primary; // Main heartbeat wave
SineWave secondary; // Secondary beat
AnalogOut led(9); // LED for visualizing the heartbeat
void begin() {
primary.bpm(20); // Set primary beat to 80 beats per minute
secondary.bpm(primary.bpm()); // Set secondary beat to same value
secondary.phase(0.25); // Dephase secon
secondary.amplitude(0.5); // Secondary beat is less strong
}
void step() {
float combinedBeat = (primary.get() + secondary.get()) / 2.0; // Combine and normalize waves
led.put(combinedBeat); // Drive LED with combined signal
print(primary); print(" "); // Stream the combined wave for visualization
print(secondary); print(" "); // Stream the combined wave for visualization
// println();
println(combinedBeat); // Stream the combined wave for visualization
}