From 5be3472f0f61d2e479f42759fed6fafd2a0e739a Mon Sep 17 00:00:00 2001 From: mick grierson Date: Tue, 22 Sep 2015 09:21:43 +0100 Subject: more work for kadenze mooc --- maximilian_examples/1.TestTone.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'maximilian_examples/1.TestTone.cpp') diff --git a/maximilian_examples/1.TestTone.cpp b/maximilian_examples/1.TestTone.cpp index b8da07c..c27941c 100755 --- a/maximilian_examples/1.TestTone.cpp +++ b/maximilian_examples/1.TestTone.cpp @@ -1,19 +1,15 @@ -//This example shows how to create one of the most fundamental building blocks in computer audio. The sine wave. -//The sine wave is an oscillator - it oscillates back and forth between two values in a particular shape. - - #include "maximilian.h" -maxiOsc mySine;//let's create an oscillator and give it a name. - +//This shows how the fundamental building block of digital audio - the sine wave. +// +maxiOsc mySine;//One oscillator - can be called anything. Can be any of the available waveforms. void setup() {//some inits //nothing to go here this time } -void play(double *output) {//this is where the magic happens. Very slow magic. - - //output[0] is the left output. output[1] is the right output - output[0]=mySine.sinewave(440);//simple as that! +void play(double *output) { + + output[0]=mySine.sinewave(440); + output[1]=output[0]; } - -- cgit v1.3