diff options
| author | Chris Kiefer <chrisk13fer@gmail.com> | 2013-09-30 17:47:32 +0100 |
|---|---|---|
| committer | Chris Kiefer <chrisk13fer@gmail.com> | 2013-09-30 17:47:32 +0100 |
| commit | 598ecac2402b2fa54e198696a0f4d4c154297590 (patch) | |
| tree | cdc7c0e570c74aac97f5a7770a8d034d32e3d564 /main.cpp | |
| parent | 2f47aad97f83758d1197009db7cb94c9ce9243a4 (diff) | |
test project for osx 10.8
Diffstat (limited to 'main.cpp')
| -rwxr-xr-x | main.cpp | 36 |
1 files changed, 7 insertions, 29 deletions
@@ -1,36 +1,14 @@ #include "maximilian.h" -//Look mum no aliasing - -//synthesiser bits -maxiOsc VCO1,VCO2; -maxiOsc ramp,ramp2,ramp3; -double out; - +maxiOsc mySine;//let's create an oscillator and give it a name. void setup() {//some inits - - //we need this to set the duty cycle for the sqaure wave otherwise it don't work - VCO2.phaseReset(0.5); - + //nothing to go here this time } -void play(double *output) { - -// no noise here -// out=VCO1.sawn(ramp.phasor(0.1,50,8000)); - - -// Band limited square using two band limited saws. Comment the above and uncomment the below. -// you can hear a tiny bit of aliasing approaching 8000 hz but it should do. -// It's actually a bit of a weird hack but has nice response. -// out=VCO1.sawn(ramp.phasor(0.1,50,8000))-VCO2.sawn(ramp2.phasor(0.1,50,8000)); - -// When you're done testing with the ramps, see here for an easy PWM hack with this approach - out=VCO1.sawn(100)-(VCO2.sawn(100.1)*0.9); - - - output[0]=out*0.5;//left channel - output[1]=out*0.5;//right channel - +void play(double *output) {//this is where the magic happens. Very slow magic. + + *output=mySine.sinewave(440);//simple as that! + } + |
