aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authormicknoise <mickgrierson@gmail.com>2015-08-08 21:37:11 +0100
committermicknoise <mickgrierson@gmail.com>2015-08-08 21:37:11 +0100
commit00840fe549f867eb8e4ab0f94ec3b11dd1b38272 (patch)
treef0051b8192f0a83c831bfc7d0cc0dd1bd70ff80a /main.cpp
parent1100fc8c462d9a17731340596e7d9c07adb3fe54 (diff)
Tested and Working in Visual Studio 2015. Commit!
Diffstat (limited to 'main.cpp')
-rwxr-xr-xmain.cpp34
1 files changed, 1 insertions, 33 deletions
diff --git a/main.cpp b/main.cpp
index 07795df..e3e50cb 100755
--- a/main.cpp
+++ b/main.cpp
@@ -1,5 +1,4 @@
#include "maximilian.h"
-#include "libs/maxim.h"
//This shows how to use maximilian to build a polyphonic synth.
@@ -17,27 +16,9 @@ int currentCount,lastCount,voice=0;//these values are used to check if we have a
double VCO1out[6],VCO2out[6],LFO1out[6],LFO2out[6],VCFout[6],ADSRout[6],mix,pitch[6];
-maxiFFTOctaveAnalyzer octo;
-int nAverages;
-float *ifftOutput;
-int ifftSize;
-
-maxiIFFT ifft;
-maxiFFT mfft;
-int fftSize;
-int bins, dataSize;
-
void setup() {//some inits
- fftSize = 1024;
- mfft.setup(fftSize, 1024, 256);
- ifft.setup(fftSize, 1024, 256);
-
-
- nAverages = 12;
- octo.setup(44100, fftSize/2, nAverages);
-
for (int i=0;i<6;i++) {
ADSR[i].setAttack(0);
@@ -66,13 +47,6 @@ void play(double *output) {
pitch[voice]=voice+1;
voice++;
- lastCount=0;
- cout << mfft.spectralFlatness() << ", " << mfft.spectralCentroid() << endl;
-
- for (int i=0; i<octo.nAverages; i++) {
- cout << octo.averages[i] << " ,";
- } cout << endl;
-
}
//and this is where we build the synth
@@ -97,13 +71,7 @@ void play(double *output) {
output[0]=mix*0.5;//left channel
output[1]=mix*0.5;//right channel
-
- if (mfft.process(mix)) {
- //do some manipulation
- mfft.magsToDB();
- octo.calculate(mfft.magnitudesDB);
- }
- //inverse fft
+
// This just sends note-off messages.
for (int i=0; i<6; i++) {