aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/tutorial/stk2
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-02-13 04:37:27 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-02-13 04:37:27 +0000
commit34ce52e8bec33c97e9413917f0f4b221fa0c6734 (patch)
treeac6dfc0c3a10012441d8b82c29d9fc129f0635d8 /externals/grill/flext/tutorial/stk2
parent4aea9c983b78ba15fb4358175c0599f14969628d (diff)
""
svn path=/trunk/; revision=395
Diffstat (limited to 'externals/grill/flext/tutorial/stk2')
-rw-r--r--externals/grill/flext/tutorial/stk2/main.cpp18
-rw-r--r--externals/grill/flext/tutorial/stk2/stk2.dsp8
2 files changed, 16 insertions, 10 deletions
diff --git a/externals/grill/flext/tutorial/stk2/main.cpp b/externals/grill/flext/tutorial/stk2/main.cpp
index 5d6cb72c..bb440c91 100644
--- a/externals/grill/flext/tutorial/stk2/main.cpp
+++ b/externals/grill/flext/tutorial/stk2/main.cpp
@@ -45,6 +45,7 @@ public:
virtual void ProcessObjs(int n); // do DSP processing
PitShift *inst[2];
+ MY_FLOAT *vec;
private:
static void Setup(t_class *c);
@@ -76,10 +77,13 @@ bool stk2::NewObjs()
{
bool ok = true;
- // set up objects
try {
+ // set up objects
for(int i = 0; i < 2; ++i)
inst[i] = new PitShift;
+
+ // reserve one signal vector too
+ vec = new MY_FLOAT[Blocksize()];
}
catch (StkError &) {
post("%s - Noise() setup failed!",thisName());
@@ -94,16 +98,18 @@ void stk2::FreeObjs()
{
for(int i = 0; i < 2; ++i)
if(inst[i]) delete inst[i];
+ if(vec) delete[] vec;
}
// this is called on every DSP block
void stk2::ProcessObjs(int n)
{
- while(n--) {
- MY_FLOAT f = Inlet(0).tick();
- for(int i = 0; i < 2; ++i)
- Outlet(i).tick(inst[i]->tick(f));
- }
+ for(int i = 0; i < 2; ++i)
+ Outlet(i).tick(
+ inst[i]->tick(
+ Inlet(0).tick(vec,n)
+ ,n)
+ ,n);
}
diff --git a/externals/grill/flext/tutorial/stk2/stk2.dsp b/externals/grill/flext/tutorial/stk2/stk2.dsp
index 8ace2bf9..26cba580 100644
--- a/externals/grill/flext/tutorial/stk2/stk2.dsp
+++ b/externals/grill/flext/tutorial/stk2/stk2.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\source" /I "f:\prog\packs\sndobj\include" /I "f:\prog\packs\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /D "FLEXT_THREADS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\source" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /D "FLEXT_THREADS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib pd.lib pthreadVC.lib flext_t-pdwin.lib stk.lib /nologo /dll /machine:I386 /out:"../pd-msvc/stk2~.dll" /libpath:"..\..\pd-msvc" /libpath:"f:\prog\packs\stk\lib"
+# ADD LINK32 kernel32.lib user32.lib pd.lib pthreadVC.lib flext_t-pdwin.lib stk.lib /nologo /dll /machine:I386 /out:"../pd-msvc/stk2~.dll" /libpath:"..\..\pd-msvc" /libpath:"f:\prog\audio\stk\lib"
!ELSEIF "$(CFG)" == "stk2 - Win32 Debug"
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\source" /I "f:\prog\packs\sndobj\include" /I "f:\prog\packs\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /D "FLEXT_THREADS" /Fr /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\source" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /D "FLEXT_THREADS" /Fr /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib pd.lib pthreadVC.lib flext_td-pdwin.lib stk_d.lib /nologo /dll /debug /machine:I386 /out:"msvc-debug/stk2~.dll" /pdbtype:sept /libpath:"..\..\pd-msvc" /libpath:"f:\prog\packs\stk\lib"
+# ADD LINK32 kernel32.lib user32.lib pd.lib pthreadVC.lib flext_td-pdwin.lib stk_d.lib /nologo /dll /debug /machine:I386 /out:"msvc-debug/stk2~.dll" /pdbtype:sept /libpath:"..\..\pd-msvc" /libpath:"f:\prog\audio\stk\lib"
!ENDIF