From 60341ac292bb9ba6f1d33632f8fd8e767c6a99d4 Mon Sep 17 00:00:00 2001 From: mick grierson Date: Tue, 27 Oct 2015 17:05:12 +0000 Subject: clean up --- .../bin/FreeImage.dll | Bin 2404352 -> 0 bytes .../bin/FreeType-6.dll | Bin 364726 -> 0 bytes .../ofMaximWindowsVS2008_emptyExample/bin/Zlib.dll | Bin 69632 -> 0 bytes .../bin/data/Low.wav | Bin 508660 -> 0 bytes .../bin/data/beat2.wav | Bin 211140 -> 0 bytes .../bin/emptyExample_debug.ilk | Bin 4640468 -> 0 bytes .../bin/fmodex.dll | Bin 289280 -> 0 bytes .../bin/fmodexL.dll | Bin 330752 -> 0 bytes .../bin/glut32.dll | Bin 237568 -> 0 bytes .../emptyExample.ncb | Bin 13945856 -> 0 bytes .../emptyExample.sln | 28 - .../emptyExample.suo | Bin 27648 -> 0 bytes .../emptyExample.vcproj | 217 ------- ...ample.vcproj.GOLDSMIT-282193.Administrator.user | 65 -- .../emptyExample.vcproj.user | 25 - .../ofMaximWindowsVS2008_emptyExample/src/main.cpp | 16 - .../src/maximilian.cpp | 709 --------------------- .../src/maximilian.h | 321 ---------- .../src/testApp.cpp | 162 ----- .../src/testApp.h | 47 -- 20 files changed, 1590 deletions(-) delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeImage.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeType-6.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/Zlib.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/Low.wav delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/beat2.wav delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/emptyExample_debug.ilk delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodex.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodexL.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/glut32.dll delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.ncb delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.sln delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.suo delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.GOLDSMIT-282193.Administrator.user delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.user delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/main.cpp delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.cpp delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.h delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.cpp delete mode 100755 ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.h (limited to 'ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample') diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeImage.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeImage.dll deleted file mode 100755 index e5b1afe..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeImage.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeType-6.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeType-6.dll deleted file mode 100755 index c13d534..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/FreeType-6.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/Zlib.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/Zlib.dll deleted file mode 100755 index 198f0ec..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/Zlib.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/Low.wav b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/Low.wav deleted file mode 100755 index e0308f5..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/Low.wav and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/beat2.wav b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/beat2.wav deleted file mode 100755 index c71cee6..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/data/beat2.wav and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/emptyExample_debug.ilk b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/emptyExample_debug.ilk deleted file mode 100755 index 3d9958f..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/emptyExample_debug.ilk and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodex.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodex.dll deleted file mode 100755 index e8ff8f0..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodex.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodexL.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodexL.dll deleted file mode 100755 index b5c7125..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/fmodexL.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/glut32.dll b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/glut32.dll deleted file mode 100755 index 106646f..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/bin/glut32.dll and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.ncb b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.ncb deleted file mode 100755 index 3577c98..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.ncb and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.sln b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.sln deleted file mode 100755 index 5a9e6e6..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.sln +++ /dev/null @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emptyExample", "emptyExample.vcproj", "{7FD42DF7-442E-479A-BA76-D0022F99702A}" - ProjectSection(ProjectDependencies) = postProject - {5837595D-ACA9-485C-8E76-729040CE4B0B} = {5837595D-ACA9-485C-8E76-729040CE4B0B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs2008\openframeworksLib.vcproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.Build.0 = Debug|Win32 - {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.ActiveCfg = Release|Win32 - {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.Build.0 = Release|Win32 - {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.ActiveCfg = Debug|Win32 - {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.Build.0 = Debug|Win32 - {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.ActiveCfg = Release|Win32 - {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.suo b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.suo deleted file mode 100755 index 73c79ae..0000000 Binary files a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.suo and /dev/null differ diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj deleted file mode 100755 index a03cbaf..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.GOLDSMIT-282193.Administrator.user b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.GOLDSMIT-282193.Administrator.user deleted file mode 100755 index 4c12e85..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.GOLDSMIT-282193.Administrator.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.user b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.user deleted file mode 100755 index 801522b..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/emptyExample.vcproj.user +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/main.cpp b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/main.cpp deleted file mode 100755 index 312c54e..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "ofMain.h" -#include "testApp.h" -#include "ofAppGlutWindow.h" - -//======================================================================== -int main( ){ - - ofAppGlutWindow window; - ofSetupOpenGL(&window, 800,600, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new testApp()); - -} diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.cpp b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.cpp deleted file mode 100755 index adb0068..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.cpp +++ /dev/null @@ -1,709 +0,0 @@ - -/* - * maximilian.cpp - * platform independent synthesis library using portaudio or rtaudio - * - * Created by Mick Grierson on 29/12/2009. - * Copyright 2009 Mick Grierson & Strangeloop Limited. All rights reserved. - * Thanks to the Goldsmiths Creative Computing Team. - * Special thanks to Arturo Castro for the PortAudio implementation. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#include "maximilian.h" -#include "math.h" - -int channels=2; -int samplerate=44100; -int buffersize=1024; -float chandiv= 1; - -double sineBuffer[514]={0,0.012268,0.024536,0.036804,0.049042,0.06131,0.073547,0.085785,0.097992,0.1102,0.12241,0.13455,0.1467,0.15884,0.17093,0.18301,0.19507,0.20709,0.21909,0.23105,0.24295,0.25485,0.26669,0.2785,0.29025,0.30197,0.31366,0.32529,0.33685,0.34839,0.35986,0.37128,0.38266,0.39395,0.40521,0.41641,0.42752,0.4386,0.44958,0.46051,0.47137,0.48215,0.49286,0.50351,0.51407,0.52457,0.53497,0.54529,0.55554,0.5657,0.57578,0.58575,0.59567,0.60547,0.6152,0.62482,0.63437,0.6438,0.65314,0.66238,0.67151,0.68057,0.68951,0.69833,0.70706,0.7157,0.72421,0.7326,0.74091,0.74908,0.75717,0.76514,0.77298,0.7807,0.7883,0.79581,0.80316,0.81042,0.81754,0.82455,0.83142,0.8382,0.84482,0.85132,0.8577,0.86392,0.87006,0.87604,0.88187,0.8876,0.89319,0.89862,0.90396,0.90912,0.91415,0.91907,0.92383,0.92847,0.93295,0.93729,0.9415,0.94556,0.94949,0.95325,0.95691,0.96039,0.96375,0.96692,0.97,0.9729,0.97565,0.97827,0.98074,0.98306,0.98523,0.98724,0.98914,0.99084,0.99243,0.99387,0.99515,0.99628,0.99725,0.99808,0.99875,0.99927,0.99966,0.99988,0.99997,0.99988,0.99966,0.99927,0.99875,0.99808,0.99725,0.99628,0.99515,0.99387,0.99243,0.99084,0.98914,0.98724,0.98523,0.98306,0.98074,0.97827,0.97565,0.9729,0.97,0.96692,0.96375,0.96039,0.95691,0.95325,0.94949,0.94556,0.9415,0.93729,0.93295,0.92847,0.92383,0.91907,0.91415,0.90912,0.90396,0.89862,0.89319,0.8876,0.88187,0.87604,0.87006,0.86392,0.8577,0.85132,0.84482,0.8382,0.83142,0.82455,0.81754,0.81042,0.80316,0.79581,0.7883,0.7807,0.77298,0.76514,0.75717,0.74908,0.74091,0.7326,0.72421,0.7157,0.70706,0.69833,0.68951,0.68057,0.67151,0.66238,0.65314,0.6438,0.63437,0.62482,0.6152,0.60547,0.59567,0.58575,0.57578,0.5657,0.55554,0.54529,0.53497,0.52457,0.51407,0.50351,0.49286,0.48215,0.47137,0.46051,0.44958,0.4386,0.42752,0.41641,0.40521,0.39395,0.38266,0.37128,0.35986,0.34839,0.33685,0.32529,0.31366,0.30197,0.29025,0.2785,0.26669,0.25485,0.24295,0.23105,0.21909,0.20709,0.19507,0.18301,0.17093,0.15884,0.1467,0.13455,0.12241,0.1102,0.097992,0.085785,0.073547,0.06131,0.049042,0.036804,0.024536,0.012268,0,-0.012268,-0.024536,-0.036804,-0.049042,-0.06131,-0.073547,-0.085785,-0.097992,-0.1102,-0.12241,-0.13455,-0.1467,-0.15884,-0.17093,-0.18301,-0.19507,-0.20709,-0.21909,-0.23105,-0.24295,-0.25485,-0.26669,-0.2785,-0.29025,-0.30197,-0.31366,-0.32529,-0.33685,-0.34839,-0.35986,-0.37128,-0.38266,-0.39395,-0.40521,-0.41641,-0.42752,-0.4386,-0.44958,-0.46051,-0.47137,-0.48215,-0.49286,-0.50351,-0.51407,-0.52457,-0.53497,-0.54529,-0.55554,-0.5657,-0.57578,-0.58575,-0.59567,-0.60547,-0.6152,-0.62482,-0.63437,-0.6438,-0.65314,-0.66238,-0.67151,-0.68057,-0.68951,-0.69833,-0.70706,-0.7157,-0.72421,-0.7326,-0.74091,-0.74908,-0.75717,-0.76514,-0.77298,-0.7807,-0.7883,-0.79581,-0.80316,-0.81042,-0.81754,-0.82455,-0.83142,-0.8382,-0.84482,-0.85132,-0.8577,-0.86392,-0.87006,-0.87604,-0.88187,-0.8876,-0.89319,-0.89862,-0.90396,-0.90912,-0.91415,-0.91907,-0.92383,-0.92847,-0.93295,-0.93729,-0.9415,-0.94556,-0.94949,-0.95325,-0.95691,-0.96039,-0.96375,-0.96692,-0.97,-0.9729,-0.97565,-0.97827,-0.98074,-0.98306,-0.98523,-0.98724,-0.98914,-0.99084,-0.99243,-0.99387,-0.99515,-0.99628,-0.99725,-0.99808,-0.99875,-0.99927,-0.99966,-0.99988,-0.99997,-0.99988,-0.99966,-0.99927,-0.99875,-0.99808,-0.99725,-0.99628,-0.99515,-0.99387,-0.99243,-0.99084,-0.98914,-0.98724,-0.98523,-0.98306,-0.98074,-0.97827,-0.97565,-0.9729,-0.97,-0.96692,-0.96375,-0.96039,-0.95691,-0.95325,-0.94949,-0.94556,-0.9415,-0.93729,-0.93295,-0.92847,-0.92383,-0.91907,-0.91415,-0.90912,-0.90396,-0.89862,-0.89319,-0.8876,-0.88187,-0.87604,-0.87006,-0.86392,-0.8577,-0.85132,-0.84482,-0.8382,-0.83142,-0.82455,-0.81754,-0.81042,-0.80316,-0.79581,-0.7883,-0.7807,-0.77298,-0.76514,-0.75717,-0.74908,-0.74091,-0.7326,-0.72421,-0.7157,-0.70706,-0.69833,-0.68951,-0.68057,-0.67151,-0.66238,-0.65314,-0.6438,-0.63437,-0.62482,-0.6152,-0.60547,-0.59567,-0.58575,-0.57578,-0.5657,-0.55554,-0.54529,-0.53497,-0.52457,-0.51407,-0.50351,-0.49286,-0.48215,-0.47137,-0.46051,-0.44958,-0.4386,-0.42752,-0.41641,-0.40521,-0.39395,-0.38266,-0.37128,-0.35986,-0.34839,-0.33685,-0.32529,-0.31366,-0.30197,-0.29025,-0.2785,-0.26669,-0.25485,-0.24295,-0.23105,-0.21909,-0.20709,-0.19507,-0.18301,-0.17093,-0.15884,-0.1467,-0.13455,-0.12241,-0.1102,-0.097992,-0.085785,-0.073547,-0.06131,-0.049042,-0.036804,-0.024536,-0.012268,0,0.012268 -}; - -void setup();//use this to do any initialisation if you want. - -void play(double *channels);//run dac! - -maxiOsc::maxiOsc(){ - phase = 0.0; -// memset(phases,0,500); -// memset(freqs,0,500); -} - -double maxiOsc::noise() { - //always the same unless you seed it. - float r = rand()/(float)RAND_MAX; - output=r*2-1; - return(output); -} - -double maxiOsc::sinewave(double frequency) { - output=sin (phase*(TWOPI)); - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency))); - return(output); - -} - -double maxiOsc::sinebuf4(double frequency) { - double remainder; - double a,b,c,d,a1,a2,a3; - phase += 512./(samplerate/(frequency)); - if ( phase >= 511 ) phase -=512; - remainder = phase - floor(phase); - - if (phase==0) { - a=sineBuffer[(long) 512]; - b=sineBuffer[(long) phase]; - c=sineBuffer[(long) phase+1]; - d=sineBuffer[(long) phase+2]; - - } else { - a=sineBuffer[(long) phase-1]; - b=sineBuffer[(long) phase]; - c=sineBuffer[(long) phase+1]; - d=sineBuffer[(long) phase+2]; - - } - - a1 = 0.5f * (c - a); - a2 = a - 2.5 * b + 2.f * c - 0.5f * d; - a3 = 0.5f * (d - a) + 1.5f * (b - c); - output = double (((a3 * remainder + a2) * remainder + a1) * remainder + b); - return(output); -} - -double maxiOsc::sinebuf(double frequency) { - double remainder=0.0; - phase += 512./(samplerate/(frequency*chandiv)); - if ( phase >= 511.0 ) phase -=512.0; - remainder = phase - floor(phase); - output = (double) ((1-remainder) * sineBuffer[1+ (long) phase] + remainder * sineBuffer[2+(long) phase]); - return(output); -} - -double maxiOsc::coswave(double frequency) { - output=cos (phase*(TWOPI)); - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency))); - return(output); - -} - -double maxiOsc::phasor(double frequency) { - output=phase; - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency))); - return(output); -} - -double maxiOsc::square(double frequency) { - if (phase<0.5) output=-1; - if (phase>0.5) output=1; - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency))); - return(output); -} - -double maxiOsc::pulse(double frequency, double duty) { - if (duty<0.) duty=0; - if (duty>1.) duty=1; - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency))); - if (phaseduty) output=1.; - return(output); -} - -double maxiOsc::phasor(double frequency, double startphase, double endphase) { - output=phase; - if (phase= endphase ) phase = startphase; - phase += ((endphase-startphase)/(samplerate/(frequency))); - return(output); -} - - -double maxiOsc::saw(double frequency) { - - output=phase; - if ( phase >= 1.0 ) phase -= 2.0; - phase += (1./(samplerate/(frequency))); - return(output); - -} - -double maxiOsc::triangle(double frequency, double phase) { - output=tri*2; - if ( phase >= 1.0 ) phase -= 1.0; - phase += (1./(samplerate/(frequency*chandiv))); - if (phase <= 0.5 ) { - tri = phase; - } else { - tri =(1-phase); - } - return(output); - -} - - -//I like this. -double maxiEnvelope::line(int numberofsegments,double segments[1000]) { - period=2./(segments[valindex+1]*0.004); - nextval=segments[valindex+2]; - currentval=segments[valindex]; - if (currentval-amplitude > 0.0000001 && valindex < numberofsegments) { - amplitude += ((currentval-startval)/(samplerate/period)); - } else if (currentval-amplitude < -0.0000001 && valindex < numberofsegments) { - amplitude -= (((currentval-startval)*(-1))/(samplerate/period)); - } else if (valindex >numberofsegments-1) { - valindex=numberofsegments-2; - } else { - valindex=valindex+2; - startval=currentval; - } - output=amplitude; - return(output); -} - -//and this -void maxiEnvelope::trigger(int index,double amp) { - valindex=index; - amplitude=amp; - -} - -//and this -double maxiDelayline::dl(double input, int size, double feedback) { - if ( phase >=size ) phase = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5; - phase+=1; - output=memory[phase+1]; - return(output); - -} - -double maxiDelayline::dl(double input, int size, double feedback, int position) { - if ( phase >=size ) phase = 0; - if ( position >=size ) position = 0; - memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv; - phase+=1; - output=memory[position]; - return(output); - -} - -//I particularly like these. cutoff between 0 and 1 -double maxiFilter::lopass(double input, double cutoff) { - output=outputs[0] + cutoff*(input-outputs[0]); - outputs[0]=output; - return(output); -} -//as above -double maxiFilter::hipass(double input, double cutoff) { - output=input-(outputs[0] + cutoff*(input-outputs[0])); - outputs[0]=output; - return(output); -} -//awesome. cuttof is freq in hz. res is between 1 and whatever. Watch out! -double maxiFilter::lores(double input,double cutoff1, double resonance) { - cutoff=cutoff1*0.5; - if (cutoff>(samplerate*0.25)) cutoff=(samplerate*0.25); - if (resonance<1.) resonance = 1.; - z=cos(TWOPI*cutoff/samplerate); - c=2-2*z; - double r=(sqrt(2.0)*sqrt(-pow((z-1),3.0))+resonance*(z-1))/(resonance*(z-1)); - x=x+(input-y)*c; - y=y+x; - x=x*r; - output=y; - return(output); -} - -//this is just stupid. Kindof works. -double maxiFilter::hires(double input,double cutoff1, double resonance) { - cutoff=cutoff1*0.5; - if (cutoff>(samplerate*0.25)) cutoff=(samplerate*0.25); - if (resonance<1.) resonance = 1.; - z=cos(TWOPI*cutoff/samplerate); - c=2-2*z; - double r=(sqrt(2.0)*sqrt(-pow((z-1),3.0))+resonance*(z-1))/(resonance*(z-1)); - x=x+(input-y)*c; - y=y+x; - x=x*r; - output=input-y; - return(output); -} - -//This works a bit. Needs attention. -double maxiFilter::bandpass(double input,double cutoff1, double resonance) { - cutoff=cutoff1; - if (cutoff>(samplerate*0.5)) cutoff=(samplerate*0.5); - if (resonance>=1.) resonance=0.999999; - z=cos(TWOPI*cutoff/samplerate); - inputs[0] = (1-resonance)*(sqrt(resonance*(resonance-4*pow(z,2)+2)+1)); - inputs[1] = 2*z*resonance; - inputs[2] = pow((resonance*-1),2); - - output=inputs[0]*input+inputs[1]*outputs[1]+inputs[2]*outputs[2]; - outputs[2]=outputs[1]; - outputs[1]=output; - return(output); -} - -//stereo bus -double *maxiMix::stereo(double input,double two[2],double x) { - if (x>1) x=1; - if (x<0) x=0; - two[0]=input*sqrt(1-x); - two[1]=input*sqrt(x); - return(two); -} - -//quad bus -double *maxiMix::quad(double input,double four[4],double x,double y) { - if (x>1) x=1; - if (x<0) x=0; - if (y>1) y=1; - if (y<0) y=0; - four[0]=input*sqrt((1-x)*y); - four[1]=input*sqrt((1-x)*(1-y)); - four[2]=input*sqrt(x*y); - four[3]=input*sqrt(x*(1-y)); - return(four); -} - -//ambisonic bus -double *maxiMix::ambisonic(double input,double eight[8],double x,double y,double z) { - if (x>1) x=1; - if (x<0) x=0; - if (y>1) y=1; - if (y<0) y=0; - if (z>1) y=1; - if (z<0) y=0; - eight[0]=input*(sqrt((1-x)*y)*1-z); - eight[1]=input*(sqrt((1-x)*(1-y))*1-z); - eight[2]=input*(sqrt(x*y)*1-z); - eight[3]=input*(sqrt(x*(1-y))*1-z); - eight[4]=input*(sqrt((1-x)*y)*z); - eight[5]=input*(sqrt((1-x)*(1-y))*z); - eight[6]=input*sqrt((x*y)*z); - eight[7]=input*sqrt((x*(1-y))*z); - return(eight); -} - - -bool maxiSample::load(string fileName) { - myPath = ofToDataPath(fileName); - return read(); -} - -double maxiSample::play() { - long length=myDataSize*(1./myChannels); - double remainder; - short* buffer = (short *)myData; - position=(position+1); - remainder = position - (long) position; - if ((long) position>length) position=0; - output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation - return(output); -} - -double maxiSample::play(double speed) { - double remainder; - long a,b; -// long length=myDataSize*0.5; - short* buffer = (short *)myData; - position=position+((speed*chandiv*myChannels)/(samplerate/mySampleRate)); - if (speed >=0) { - - if ((long) position>=length-1) position=1; - remainder = position - floor(position); - if (position+1=0) { - a=position-1; - - } - else { - a=0; - } - if (position-2>=0) { - b=position-2; - } - else { - b=0; - } - output = (double) ((-1-remainder) * buffer[a] + remainder * buffer[b])/32767;//linear interpolation - } - return(output); -} - -double maxiSample::play(double frequency, double start, double end) { - double remainder; -// long length=myDataSize; - if (end>=length) end=length-1; - long a,b; - short* buffer = (short *)myData; - if (frequency >0.) { - if (position= end ) position = start; - position += ((end-start)/(samplerate/(frequency*chandiv))); - remainder = position - floor(position); - long pos = floor(position); - if (pos+1=0) { - a=pos-1; - } - else { - a=0; - } - if (pos-2>=0) { - b=pos-2; - } - else { - b=0; - } - output = (double) ((-1-remainder) * buffer[a] + - remainder * buffer[b])/32767;//linear interpolation - - } - - return(output); -} - -//better cubic inerpolation. Cobbled together from various (pd externals, yehar, other places). -double maxiSample::play4(double frequency, double start, double end) { - double remainder; - double a,b,c,d,a1,a2,a3; - short* buffer = (short*)myData; - if (frequency >0.) { - if (position= end ) position = start; - position += ((end-start)/(samplerate/(frequency*chandiv))); - remainder = position - floor(position); - if (position>0) { - a=buffer[(int)(floor(position))-1]; - - } else { - a=buffer[0]; - - } - - b=buffer[(long) position]; - if (positionstart && position < end-1) { - a=buffer[(long) position+1]; - - } else { - a=buffer[0]; - - } - - b=buffer[(long) position]; - if (position>start) { - c=buffer[(long) position-1]; - - } else { - c=buffer[0]; - - } - if (position>start+1) { - d=buffer[(long) position-2]; - - } else { - d=buffer[0]; - } - a1 = 0.5f * (c - a); - a2 = a - 2.5 * b + 2.f * c - 0.5f * d; - a3 = 0.5f * (d - a) + 1.5f * (b - c); - output = (double) (((a3 * remainder + a2) * -remainder + a1) * -remainder + b) / 32767; - - } - - return(output); -} - -double maxiSample::bufferPlay(unsigned char &bufferin,long length) { - double remainder; - short* buffer = (short *)&bufferin; - position=(position+1); - remainder = position - (long) position; - if ((long) position>length) position=0; - output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation - return(output); -} - -double maxiSample::bufferPlay(unsigned char &bufferin,double speed,long length) { - double remainder; - long a,b; - short* buffer = (short *)&bufferin; - position=position+((speed*chandiv*myChannels)/(samplerate/mySampleRate)); - if (speed >=0) { - - if ((long) position>=length-1) position=1; - remainder = position - floor(position); - if (position+1=0) { - a=position-1; - - } - else { - a=0; - } - if (position-2>=0) { - b=position-2; - } - else { - b=0; - } - output = (double) ((-1-remainder) * buffer[a] + remainder * buffer[b])/32767;//linear interpolation - } - return(output); -} - -double maxiSample::bufferPlay(unsigned char &bufferin,double frequency, double start, double end) { - double remainder; - length=end; - long a,b; - short* buffer = (short *)&bufferin; - if (frequency >0.) { - if (position= end ) position = start; - position += ((end-start)/(samplerate/(frequency*chandiv))); - remainder = position - floor(position); - long pos = floor(position); - if (pos+1=0) { - a=pos-1; - } - else { - a=0; - } - if (pos-2>=0) { - b=pos-2; - } - else { - b=0; - } - output = (double) ((-1-remainder) * buffer[a] + - remainder * buffer[b])/32767;//linear interpolation - - } - - return(output); -} - -//better cubic inerpolation. Cobbled together from various (pd externals, yehar, other places). -double maxiSample::bufferPlay4(unsigned char &bufferin,double frequency, double start, double end) { - double remainder; - double a,b,c,d,a1,a2,a3; - short* buffer = (short*)&bufferin; - if (frequency >0.) { - if (position= end ) position = start; - position += ((end-start)/(samplerate/(frequency*chandiv))); - remainder = position - floor(position); - if (position>0) { - a=buffer[(int)(floor(position))-1]; - - } else { - a=buffer[0]; - - } - - b=buffer[(long) position]; - if (positionstart && position < end-1) { - a=buffer[(long) position+1]; - - } else { - a=buffer[0]; - - } - - b=buffer[(long) position]; - if (position>start) { - c=buffer[(long) position-1]; - - } else { - c=buffer[0]; - - } - if (position>start+1) { - d=buffer[(long) position-2]; - - } else { - d=buffer[0]; - } - a1 = 0.5f * (c - a); - a2 = a - 2.5 * b + 2.f * c - 0.5f * d; - a3 = 0.5f * (d - a) + 1.5f * (b - c); - output = (double) (((a3 * remainder + a2) * -remainder + a1) * -remainder + b) / 32767; - - } - - return(output); -} - - -void maxiSample::getLength() { - length=myDataSize*0.5; -} - - diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.h b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.h deleted file mode 100755 index e12297e..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/maximilian.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * maximilian.h - * platform independent synthesis library using portaudio or rtaudio - * - * Created by Mick Grierson on 29/12/2009. - * Copyright 2009 Mick Grierson & Strangeloop Limited. All rights reserved. - * Thanks to the Goldsmiths Creative Computing Team. - * Special thanks to Arturo Castro for the PortAudio implementation. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef MAXIMILIAN_H -#define MAXIMILIAN_H - -//#define MAXIMILIAN_PORTAUDIO -#define MAXIMILIAN_RT_AUDIO - -#include "ofMain.h" -#include "ofUtils.h" - - -#include -#include -#include -#include - -using namespace std; -#define TWOPI 3.14159*2 - -class maxiOsc { - - double frequency; - double phase; - double startphase; - double endphase; - double output; - double tri; - - -public: - maxiOsc(); - double sinewave(double frequency); - double coswave(double frequency); - double phasor(double frequency); - double phasor(double frequency, double startphase, double endphase); - double saw(double frequency); - double triangle(double frequency,double phase); - double square(double frequency); - double pulse(double frequency, double duty); - double additive(unsigned int waves, double freq1[100]); - double noise(); - double sinebuf(double frequency); - double sinebuf4(double frequency); - -}; - - -class maxiEnvelope { - - double period; - double output; - double startval; - double currentval; - double nextval; - -public: - double line(int numberofsegments,double segments[100]); - void trigger(int index,double amp); - int valindex; - double amplitude; - -}; - - -class maxiDelayline { - double frequency; - int phase; - double startphase; - double endphase; - double output; - double memory[88200]; - -public: - double dl(double input, int size, double feedback); - double dl(double input, int size, double feedback, int position); - - -}; - - -class maxiFilter { - double gain; - double input; - double output; - double inputs[10]; - double outputs[10]; - double cutoff1; - double x;//speed - double y;//pos - double z;//pole - double c;//filter coefficient -public: - double cutoff; - double resonance; - double lores(double input,double cutoff1, double resonance); - double hires(double input,double cutoff1, double resonance); - double bandpass(double input,double cutoff1, double resonance); - double lopass(double input,double cutoff); - double hipass(double input,double cutoff); - -}; - -class maxiMix { - double input; - double two[2]; - double four[4]; - double eight[8]; -public: - double x; - double y; - double z; - double *stereo(double input,double two[2],double x); - double *quad(double input,double four[4], double x,double y); - double *ambisonic(double input,double eight[8],double x,double y, double z); - -}; - - -class maxiSample { - -private: - string myPath; - int myChunkSize; - int mySubChunk1Size; - short myFormat; - short myChannels; - int mySampleRate; - int myByteRate; - short myBlockAlign; - short myBitsPerSample; - int myDataSize; - double position; - double speed; - double output; - -public: - long length; - void getLength(); - - char* myData; - - // get/set for the Path property - - ~maxiSample() - { - delete myData; - myChunkSize = NULL; - mySubChunk1Size = NULL; - myFormat = NULL; - myChannels = NULL; - mySampleRate = NULL; - myByteRate = NULL; - myBlockAlign = NULL; - myBitsPerSample = NULL; - myDataSize = NULL; - } - -// maxiSample(); - - bool load(string fileName); - - // read a wav file into this class - bool read() - { - bool result; - ifstream inFile( myPath.c_str(), ios::in | ios::binary); - result = inFile > 0; - //printf("Reading wav file...\n"); // for debugging only - - inFile.seekg(4, ios::beg); - inFile.read( (char*) &myChunkSize, 4 ); // read the ChunkSize - - inFile.seekg(16, ios::beg); - inFile.read( (char*) &mySubChunk1Size, 4 ); // read the SubChunk1Size - - //inFile.seekg(20, ios::beg); - inFile.read( (char*) &myFormat, sizeof(short) ); // read the file format. This should be 1 for PCM - - //inFile.seekg(22, ios::beg); - inFile.read( (char*) &myChannels, sizeof(short) ); // read the # of channels (1 or 2) - - //inFile.seekg(24, ios::beg); - inFile.read( (char*) &mySampleRate, sizeof(int) ); // read the samplerate - - //inFile.seekg(28, ios::beg); - inFile.read( (char*) &myByteRate, sizeof(int) ); // read the byterate - - //inFile.seekg(32, ios::beg); - inFile.read( (char*) &myBlockAlign, sizeof(short) ); // read the blockalign - - //inFile.seekg(34, ios::beg); - inFile.read( (char*) &myBitsPerSample, sizeof(short) ); // read the bitspersample - - inFile.seekg(40, ios::beg); - inFile.read( (char*) &myDataSize, sizeof(int) ); // read the size of the data - - - // read the data chunk - myData = new char[myDataSize]; - inFile.seekg(44, ios::beg); - inFile.read(myData, myDataSize); - length=myDataSize*(0.5/myChannels); - - inFile.close(); // close the input file - - return result; // this should probably be something more descriptive - } - - - double play(); - - double play(double speed); - - double play(double frequency, double start, double end); - - double play4(double frequency, double start, double end); - - double bufferPlay(unsigned char &bufferin,long length); - - double bufferPlay(unsigned char &bufferin,double speed,long length); - - double bufferPlay(unsigned char &bufferin,double frequency, double start, double end); - - double bufferPlay4(unsigned char &bufferin,double frequency, double start, double end); - - //int open(char *filename) { - // // open the wav file - // char *path = new char[50]; - // strcpy(path, filename); - // sample *myWav = new sample(path); - // return 0; - // } - // // print a summary of the wav file - // int info() { - // char *summary = myWav->getSummary(); - // printf("Summary:\n%s", summary); - // return 0; - // } - // int savefile() { - // // write the summary back out - // strcpy(path, "testout.wav"); - // myWav->setPath(path); - // myWav->save(); - // return 0: - // } - // int close() { - // // collect the garbage - // delete summary; - // delete path; - // delete myWav; - // - // return 0; - // } - // write out the wav file - bool save() - { - fstream myFile (myPath.c_str(), ios::out | ios::binary); - - // write the wav file per the wav file format - myFile.seekp (0, ios::beg); - myFile.write ("RIFF", 4); - myFile.write ((char*) &myChunkSize, 4); - myFile.write ("WAVE", 4); - myFile.write ("fmt ", 4); - myFile.write ((char*) &mySubChunk1Size, 4); - myFile.write ((char*) &myFormat, 2); - myFile.write ((char*) &myChannels, 2); - myFile.write ((char*) &mySampleRate, 4); - myFile.write ((char*) &myByteRate, 4); - myFile.write ((char*) &myBlockAlign, 2); - myFile.write ((char*) &myBitsPerSample, 2); - myFile.write ("data", 4); - myFile.write ((char*) &myDataSize, 4); - myFile.write (myData, myDataSize); - - return true; - } - - // return a printable summary of the wav file - char *getSummary() - { - char *summary = new char[250]; - sprintf(summary, " Format: %d\n Channels: %d\n SampleRate: %d\n ByteRate: %d\n BlockAlign: %d\n BitsPerSample: %d\n DataSize: %d\n", myFormat, myChannels, mySampleRate, myByteRate, myBlockAlign, myBitsPerSample, myDataSize); - std::cout << myDataSize; - return summary; - } -}; - - -#endif diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.cpp b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.cpp deleted file mode 100755 index 0d02a2f..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* This is an example of how to integrate maximilain into openFrameworks, - including using audio received for input and audio requested for output. - - - You can copy and paste this and use it as a starting example. - - */ - - -#include "testApp.h" -#include "maximilian.h"/* include the lib */ - - - -//------------------------------------------------------------- -testApp::~testApp() { - - delete beat.myData; /*you should probably delete myData for any sample object - that you've created in testApp.h*/ - -} - - -//-------------------------------------------------------------- -void testApp::setup(){ - /* some standard setup stuff*/ - - ofEnableAlphaBlending(); - ofSetupScreen(); - ofBackground(0, 0, 0); - - /* This is stuff you always need.*/ - - sampleRate = 44100; /* Sampling Rate */ - initialBufferSize = 512; /* Buffer Size. you have to fill this buffer with sound*/ - lAudioOut = new float[initialBufferSize];/* outputs */ - rAudioOut = new float[initialBufferSize]; - lAudioIn = new float[initialBufferSize];/* inputs */ - rAudioIn = new float[initialBufferSize]; - - - /* This is a nice safe piece of code */ - memset(lAudioOut, 0, initialBufferSize * sizeof(float)); - memset(rAudioOut, 0, initialBufferSize * sizeof(float)); - - memset(lAudioIn, 0, initialBufferSize * sizeof(float)); - memset(rAudioIn, 0, initialBufferSize * sizeof(float)); - - /* Now you can put anything you would normally put in maximilian's 'setup' method in here. */ - - - beat.load("beat2.wav"); - beat.getLength(); - - - - ofSoundStreamSetup(2,0,this, sampleRate, initialBufferSize, 4);/* Call this last ! */ -} - -//-------------------------------------------------------------- -void testApp::update(){ - -} - -//-------------------------------------------------------------- -void testApp::draw(){ - - /* You can use any of the data from audio received and audiorequested to draw stuff here. - Importantly, most people just use the input and output arrays defined above. - Clever people don't do this. This bit of code shows that by default, each signal is going to flip - between -1 and 1. You need to account for this somehow. Get the absolute value for example. - - */ - - ofSetColor(255, 255, 255,255); - ofRect(600, 300, sample*150, sample*150); /* audio sigs go between -1 and 1. See?*/ - ofCircle(200, 300, wave*150); - - -} - -//-------------------------------------------------------------- -void testApp::audioRequested (float * output, int bufferSize, int nChannels){ - - for (int i = 0; i < bufferSize; i++){ - - /* Stick your maximilian 'play()' code in here ! Declare your objects in testApp.h. - - For information on how maximilian works, take a look at the example code at - - http://www.maximilian.strangeloop.co.uk - - under 'Tutorials'. - - */ - - sample=beat.play(0.5, 0, beat.length); - wave=sine1.sinebuf(440);/* mouse controls sinewave pitch. we get abs value to stop it dropping - //delow zero and killing the soundcard*/ - - mymix.stereo((wave+sample)/2.0, outputs, 0.5); - - - lAudioOut[i] = output[i*nChannels ] = outputs[0]; /* You may end up with lots of outputs. add them here */ - rAudioOut[i] = output[i*nChannels + 1] = outputs[1]; - } - -} - -//-------------------------------------------------------------- -void testApp::audioReceived (float * input, int bufferSize, int nChannels){ - - - /* You can just grab this input and stick it in a double, then use it above to create output*/ - - for (int i = 0; i < bufferSize; i++){ - - /* you can also grab the data out of the arrays*/ - - lAudioIn[i] = input[i*2]; - rAudioIn[i] = input[i*2+1]; - } - -} - -//-------------------------------------------------------------- -void testApp::keyPressed(int key){ - -} - -//-------------------------------------------------------------- -void testApp::keyReleased(int key){ - -} - -//-------------------------------------------------------------- -void testApp::mouseMoved(int x, int y ){ - - - -} - -//-------------------------------------------------------------- -void testApp::mouseDragged(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mousePressed(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mouseReleased(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::windowResized(int w, int h){ - -} - diff --git a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.h b/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.h deleted file mode 100755 index 132a3a1..0000000 --- a/ofxMaxim/openFrameworksExamples/windows/ofMaximWindowsVS2008_emptyExample/src/testApp.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _TEST_APP -#define _TEST_APP - - -#include "ofMain.h" -#include "maximilian.h"/* you need this*/ - - -class testApp : public ofBaseApp{ - - public: - ~testApp();/* deconsructor is very useful */ - void setup(); - void update(); - void draw(); - - void keyPressed (int key); - void keyReleased(int key); - void mouseMoved(int x, int y ); - void mouseDragged(int x, int y, int button); - void mousePressed(int x, int y, int button); - void mouseReleased(int x, int y, int button); - void windowResized(int w, int h); - - void audioRequested (float * input, int bufferSize, int nChannels); /* output method */ - void audioReceived (float * input, int bufferSize, int nChannels); /* input method */ - - float * lAudioOut; /* outputs */ - float * rAudioOut; - - float * lAudioIn; /* inputs */ - float * rAudioIn; - - int initialBufferSize; /* buffer size */ - int sampleRate; - - - /* stick you maximilian stuff below */ - - double wave,sample,outputs[2]; - maxiMix mymix; - maxiOsc sine1; - maxiSample beats,beat; - -}; - -#endif -- cgit v1.3