diff options
Diffstat (limited to 'externals/grill/flext/tutorial/stk1')
-rw-r--r-- | externals/grill/flext/tutorial/stk1/main.cpp | 95 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/stk1/stk1.dsp | 95 |
2 files changed, 190 insertions, 0 deletions
diff --git a/externals/grill/flext/tutorial/stk1/main.cpp b/externals/grill/flext/tutorial/stk1/main.cpp new file mode 100644 index 00000000..31e10e70 --- /dev/null +++ b/externals/grill/flext/tutorial/stk1/main.cpp @@ -0,0 +1,95 @@ +/* +flext tutorial - stk 1 + +Copyright (c) 2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +------------------------------------------------------------------------- + +This is an example of an external using the STK ("synthesis toolkit") library. +See http://ccrma-www.stanford.edu/software/stk + +*/ + +#define FLEXT_ATTRIBUTES 1 + +#include <flstk.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error You need at least flext version 0.4.1 +#endif + + +class stk1: + public flext_stk +{ + FLEXT_HEADER(stk1,flext_stk) + +public: + stk1(); + +protected: + + // these are obligatory! + virtual void NewObjs(); + virtual void FreeObjs(); + virtual void ProcessObjs(); + + // space for a few sndobjs +// Pitch *obj1,*obj2; + + float sh1,sh2; + + FLEXT_ATTRVAR_F(sh1) + FLEXT_ATTRVAR_F(sh2) +}; + +FLEXT_NEW_DSP("stk1~",stk1) + + +stk1::stk1(): + sh1(1),sh2(1) +{ + AddInSignal(2); // audio ins + AddOutSignal(2); // audio outs + +// obj1 = obj2 = NULL; + + FLEXT_ADDATTR_VAR1("shL",sh1); + FLEXT_ADDATTR_VAR1("shR",sh2); +} + +// construct needed SndObjs +void stk1::NewObjs() +{ + // set up objects +// obj1 = new Pitch(.1f,&InObj(0),sh1,Blocksize(),Samplerate()); +// obj2 = new Pitch(.1f,&InObj(1),sh2,Blocksize(),Samplerate()); +} + +// destroy the SndObjs +void stk1::FreeObjs() +{ +// if(obj1) delete obj1; +// if(obj2) delete obj2; +} + +// this is called on every DSP block +void stk1::ProcessObjs() +{ +/* + // set current pitch shift + obj1->SetPitch(sh1); + obj2->SetPitch(sh2); + + // do processing here!! + obj1->DoProcess(); + obj2->DoProcess(); + + // output + *obj1 >> OutObj(0); + *obj2 >> OutObj(1); +*/ +} + diff --git a/externals/grill/flext/tutorial/stk1/stk1.dsp b/externals/grill/flext/tutorial/stk1/stk1.dsp new file mode 100644 index 00000000..7ee60fdb --- /dev/null +++ b/externals/grill/flext/tutorial/stk1/stk1.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="stk1" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=stk1 - Win32 Debug +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "stk1.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "stk1.mak" CFG="stk1 - Win32 Debug" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "stk1 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "stk1 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "stk1" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "stk1 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "msvc" +# PROP Intermediate_Dir "msvc" +# 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 /W3 /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" /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" +# ADD RSC /l 0xc07 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib stk.lib /nologo /dll /machine:I386 /out:"../pd-msvc/stk1~.dll" /libpath:"..\..\pd-msvc" /libpath:"f:\prog\packs\stk\lib" + +!ELSEIF "$(CFG)" == "stk1 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "msvc-debug" +# PROP Intermediate_Dir "msvc-debug" +# 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 /W3 /Gm /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" /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" +# ADD RSC /l 0xc07 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# 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 flext_d-pdwin.lib stk.lib /nologo /dll /debug /machine:I386 /out:"msvc-debug/stk1~.dll" /pdbtype:sept /libpath:"..\..\pd-msvc" /libpath:"f:\prog\packs\stk\lib" + +!ENDIF + +# Begin Target + +# Name "stk1 - Win32 Release" +# Name "stk1 - Win32 Debug" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Target +# End Project |