aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2004-10-17 20:04:36 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2004-10-17 20:04:36 +0000
commit363ca0a4a7b39f7d357cd5e71bd480a9ecccf5a7 (patch)
treecadb729e91943d984255e0518946c8a166a1c656
parent7a5827762f088090859eeb20591412a6178210ca (diff)
updated stk to stk version 4.2.0, added README file
svn path=/trunk/externals/ggee/; revision=2112
-rw-r--r--experimental/README.stk25
-rw-r--r--experimental/makefile46
-rwxr-xr-xexperimental/stk.cpp80
-rwxr-xr-xexperimental/stk.h183
4 files changed, 203 insertions, 131 deletions
diff --git a/experimental/README.stk b/experimental/README.stk
new file mode 100644
index 0000000..4b1a1b3
--- /dev/null
+++ b/experimental/README.stk
@@ -0,0 +1,25 @@
+
+
+In order to compile the stk external you have to put the latest
+stk release (4.2.0) in this directory.
+
+* First compile stk
+
+if stk is compiled just do a make stk.pd_linux.
+
+
+Hint:
+You may have to set the rawwaves path in stk in so that the external
+can find them. See the STK INSTALL file for details.
+You do not have to specify a special audio API, as audio I/O is done
+through pd.
+
+The stk configure command should be something like this:
+
+./configure RAWWAVE_PATH="/home/gary/rawwaves/"
+
+
+Guenter Geiger
+
+
+
diff --git a/experimental/makefile b/experimental/makefile
new file mode 100644
index 0000000..4c0c51a
--- /dev/null
+++ b/experimental/makefile
@@ -0,0 +1,46 @@
+
+EXTERNALS = $(shell ls *.c)
+CPPEXTERNALS = $(shell ls *.cpp)
+
+STRIP = strip --strip-unneeded -R .note -R .comment
+
+all: $(EXTERNALS:.c=.pd_linux) $(CPPEXTERNALS:.cpp=.pd_linux)
+
+# this might be a better way to do this:
+# EXTERNALS := ${patsubst %.c, %.o, ${wildcard *.c}}
+# all: ${EXTERNALS}
+
+.SUFFIXES: .pd_linux
+
+STK = $(shell ls -d stk*/)
+
+CFLAGS = -I$(STK)include
+
+# cross-platform default
+CPU_FLAGS = -O2
+OPTIM_FLAGS = -funroll-loops -fomit-frame-pointer $(CPU_FLAGS)
+
+FLAGS = -fPIC -DPD -DUNIX $(OPTIM_FLAGS) \
+ -Wall -W -Wshadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
+
+INCLUDES = -I. -I.. -I../../build/include
+
+%.pd_linux: %.c
+ $(CC) $(FLAGS) $(INCLUDES) -o "$*.o" -c "$+"
+ gcc -Wl,-export_dynamic -shared -o "$@" "$*.o" -lc -lm
+ chmod a-x "$@"
+ $(STRIP) $@
+ rm -f "$*.o"
+
+%.pd_linux: %.cpp
+ $(CXX) $(FLAGS) $(INCLUDES) -o "$*.o" -c "$+"
+ $(CXX) -Wl,-export_dynamic -shared -o "$@" "$*.o" -lc -lm $(STK)src/libstk.a
+ chmod a-x "$@"
+ $(STRIP) $@
+ rm -f "$*.o"
+
+clean:
+ -rm *.pd_linux *~ *.o
+ -rm link.stamp
+
diff --git a/experimental/stk.cpp b/experimental/stk.cpp
index e6229f7..6538238 100755
--- a/experimental/stk.cpp
+++ b/experimental/stk.cpp
@@ -32,52 +32,52 @@ void stk_print(t_stk* x) {
}
-#define DECL_INST(name) if ((stk_instruments[i++] = #name) && !strcmp(s->s_name, #name )) \
+#define DI(name) if ((stk_instruments[i++] = #name) && !strcmp(s->s_name, #name )) \
{ x->instrument = new name;}
-#define DECL_INST2(name) if ((stk_instruments[i++] = #name) && !strcmp(s->s_name, #name )) \
-{ x->instrument = new name(80.);}
+#define DI2(name,y) if ((stk_instruments[i++] = #name) && !strcmp(s->s_name, #name )) \
+{ x->instrument = new name(y);}
static void stk_set_instrument(t_stk* x,t_symbol* s)
{
int i = 0;
- if (!strcmp(s->s_name,"Simple")) x->instrument = new Simple;
- DECL_INST2(Plucked)
- DECL_INST2(Plucked2)
- DECL_INST2(Mandolin)
- DECL_INST2(Bowed)
- DECL_INST2(Brass)
- DECL_INST2(Clarinet)
- DECL_INST2(BlowHole)
- DECL_INST2(Flute)
- DECL_INST(BowedBar)
- DECL_INST(Modal4)
- DECL_INST(ModalBar)
- DECL_INST(FM4Op)
- DECL_INST(FM4Alg3)
- DECL_INST(FM4Alg4)
- DECL_INST(FM4Alg5)
- DECL_INST(FM4Alg6)
- DECL_INST(FM4Alg8)
- DECL_INST(HeavyMtl)
- DECL_INST(PercFlut)
- DECL_INST(Rhodey)
- DECL_INST(Wurley)
- DECL_INST(TubeBell)
- DECL_INST(FMVoices)
- DECL_INST(BeeThree)
- DECL_INST(Sampler)
- DECL_INST(SamplFlt)
- DECL_INST(Moog1)
- // DECL_INST(VoicForm)
- DECL_INST(DrumSynt)
- DECL_INST(Shakers)
- DECL_INST2(Sitar1)
- DECL_INST2(StrDrone)
- else {
+
+ x->instrument = NULL;
+ DI2(Clarinet,10.0);
+ DI2(BlowHole,10.0);
+ DI2(Saxofony,10.0);
+ DI2(Flute,10.0);
+ DI2(Brass,10.0);
+ DI(BlowBotl);
+ DI2(Bowed,10.0);
+ DI2(Plucked,5.0);
+ DI2(StifKarp,5.0);
+ DI2(Sitar,5.0);
+ DI2(Mandolin,5.0);
+
+ DI(Rhodey);
+ DI(Wurley);
+ DI(TubeBell);
+ DI(HevyMetl);
+ DI(PercFlut);
+ DI(BeeThree);
+ DI(FMVoices);
+
+ DI(VoicForm);
+ DI(Moog);
+ DI(Simple);
+ DI(Drummer);
+ DI(BandedWG);
+ DI(Shakers);
+ DI(ModalBar);
+ // DI2(Mesh2D,10, 10);
+ DI(Resonate);
+ DI(Whistle);
+
+ if (!x->instrument)
error("No such instrument %s",s->s_name);
- }
+
stk_instruments[i] = "LastInst";
}
@@ -123,7 +123,7 @@ static void stk_noteOff(t_stk *x)
static void stk_control(t_stk *x,t_floatarg f1,t_floatarg f2)
{
- x->instrument->controlChange(f1,f2);
+ x->instrument->controlChange((int)f1,f2);
}
static void stk_control1(t_stk *x,t_floatarg f1)
@@ -153,7 +153,7 @@ static void stk_aftertouch(t_stk *x,t_floatarg f1)
static void stk_pitchbend(t_stk *x,t_floatarg f1)
{
- x->instrument->setFreq(f1);
+ x->instrument->setFrequency(f1);
}
static void stk_float(t_stk* x,t_floatarg f)
diff --git a/experimental/stk.h b/experimental/stk.h
index 2fa1ec0..9b7dfaf 100755
--- a/experimental/stk.h
+++ b/experimental/stk.h
@@ -1,91 +1,92 @@
-#include <ADSR.h>
-#include <AifWvIn.h>
-#include <AifWvOut.h>
-#include <BeeThree.h>
-#include <BiQuad.h>
-#include <BlowHole.h>
-#include <BowTabl.h>
-#include <Bowed.h>
-#include <BowedBar.h>
-#include <Brass.h>
-#include <ByteSwap.h>
-#include <Clarinet.h>
-#include <Controller.h>
-#include <DCBlock.h>
-#include <DLineA.h>
-#include <DLineL.h>
-#include <DLineN.h>
-#include <DrumSynt.h>
-#include <Envelope.h>
-#include <FIR.h>
-#include <FM4Alg3.h>
-#include <FM4Alg4.h>
-#include <FM4Alg5.h>
-#include <FM4Alg6.h>
-#include <FM4Alg8.h>
-#include <FM4Op.h>
-#include <FMVoices.h>
-#include <Filter.h>
-#include <Flute.h>
-#include <FormSwep.h>
-#include <HeavyMtl.h>
-#include <Instrmnt.h>
-#include <JCRev.h>
-#include <JetTabl.h>
-//#include <LipFilt.h>
-#include <Mandolin.h>
-#include <MatWvIn.h>
-#include <MatWvOut.h>
-#include <Modal4.h>
-#include <ModalBar.h>
-#include <Modulatr.h>
-#include <Moog1.h>
-#include <NRev.h>
-#include <Noise.h>
-#include <Object.h>
-#include <OnePole.h>
-#include <OneZero.h>
-#include <PRCRev.h>
-#include <PercFlut.h>
-#include <Plucked.h>
-#include <Plucked2.h>
-#include <PoleZero.h>
-#include <RawWvIn.h>
-#include <RawWvOut.h>
-#include <ReedTabl.h>
-#include <Reverb.h>
-#include <Rhodey.h>
-#include <RtAudio.h>
-#include <RtDuplex.h>
-#include <RtMidi.h>
-#include <RtWvIn.h>
-#include <RtWvOut.h>
-#include <SKINI11.h>
-#include <SKINI11.msg>
-#include <SamplFlt.h>
-#include <Sampler.h>
-#include <Shakers.h>
-#include <Simple.h>
-#include <SingWave.h>
-#include <SndWvIn.h>
-#include <SndWvOut.h>
-#include <StkError.h>
-#include <StrmWvIn.h>
-#include <StrmWvOut.h>
-#include <SubNoise.h>
-#include <TablLook.h>
-#include <TubeBell.h>
-#include <TwoPole.h>
-#include <TwoZero.h>
-#include <VoicForm.h>
-#include <VoicMang.h>
-#include <WavWvIn.h>
-#include <WavWvOut.h>
-#include <Wurley.h>
-#include <WvIn.h>
-#include <WvOut.h>
-#include <mandplyr.h>
-#include <miditabl.h>
-#include <phontabl.h>
-#include <Sitar1.h>
-#include <StrDrone.h>
+#ifdef __linux__
+#define __OS_LINUX__
+#endif
+
+#include<Stk.h>
+#include<ADSR.h>
+#include<Asymp.h>
+#include<BandedWG.h>
+#include<BeeThree.h>
+#include<BiQuad.h>
+#include<BlowBotl.h>
+#include<BlowHole.h>
+#include<BowTable.h>
+#include<Bowed.h>
+#include<Brass.h>
+#include<Chorus.h>
+#include<Clarinet.h>
+#include<Delay.h>
+#include<DelayA.h>
+#include<DelayL.h>
+#include<Drummer.h>
+#include<Echo.h>
+#include<Effect.h>
+#include<Envelope.h>
+#include<FM.h>
+#include<FMVoices.h>
+#include<Filter.h>
+#include<Flute.h>
+#include<FormSwep.h>
+#include<Function.h>
+#include<Generator.h>
+#include<HevyMetl.h>
+#include<Instrmnt.h>
+#include<JCRev.h>
+#include<JetTable.h>
+#include<Mandolin.h>
+#include<Mesh2D.h>
+#include<Messager.h>
+#include<MidiFileIn.h>
+#include<Modal.h>
+#include<ModalBar.h>
+#include<Modulate.h>
+#include<Moog.h>
+#include<Mutex.h>
+#include<NRev.h>
+#include<Noise.h>
+#include<OnePole.h>
+#include<OneZero.h>
+#include<PRCRev.h>
+#include<PercFlut.h>
+#include<Phonemes.h>
+#include<PitShift.h>
+#include<PluckTwo.h>
+#include<Plucked.h>
+#include<PoleZero.h>
+#include<ReedTable.h>
+#include<Resonate.h>
+#include<Rhodey.h>
+#include<RtAudio.h>
+#include<RtDuplex.h>
+#include<RtError.h>
+#include<RtMidi.h>
+#include<RtWvIn.h>
+#include<RtWvOut.h>
+#include<SKINI.msg>
+#include<SKINI.tbl>
+#include<Sampler.h>
+#include<Saxofony.h>
+#include<Shakers.h>
+#include<Simple.h>
+#include<SingWave.h>
+#include<Sitar.h>
+#include<Skini.h>
+#include<Socket.h>
+#include<Sphere.h>
+#include<StifKarp.h>
+#include<SubNoise.h>
+#include<Table.h>
+#include<TcpWvIn.h>
+#include<TcpWvOut.h>
+#include<Thread.h>
+#include<TubeBell.h>
+#include<TwoPole.h>
+#include<TwoZero.h>
+#include<Vector3D.h>
+#include<VoicForm.h>
+#include<Voicer.h>
+#include<WaveLoop.h>
+#include<Whistle.h>
+#include<Wurley.h>
+#include<WvIn.h>
+#include<WvOut.h>