aboutsummaryrefslogtreecommitdiff
path: root/stkdrone~
diff options
context:
space:
mode:
authorN.N. <sevyves@users.sourceforge.net>2004-11-14 22:47:29 +0000
committerN.N. <sevyves@users.sourceforge.net>2004-11-14 22:47:29 +0000
commite625413ae9b5cb00209ab406283fff0b622eb5a7 (patch)
treee6508406183c02497ab10060c08db61928ca8ed8 /stkdrone~
parent4c34104a8fb52d339b9f43f9b851e65698998408 (diff)
adapted for STK 4.2.0
svn path=/trunk/externals/unauthorized/; revision=2271
Diffstat (limited to 'stkdrone~')
-rw-r--r--stkdrone~/Makefile4
-rw-r--r--stkdrone~/README2
-rw-r--r--stkdrone~/drone.cc28
-rw-r--r--stkdrone~/drone.h4
-rw-r--r--stkdrone~/help-stkdrone~.pd75
5 files changed, 94 insertions, 19 deletions
diff --git a/stkdrone~/Makefile b/stkdrone~/Makefile
index 5e621b0..705caad 100644
--- a/stkdrone~/Makefile
+++ b/stkdrone~/Makefile
@@ -1,6 +1,6 @@
NAME=stkdrone~
CSYM=stkdrone_tilde
-STK_HOME=/usr/local/stk-3.2
+STK_HOME=/usr/local/stk
current: pd_linux
@@ -21,7 +21,7 @@ LINUXINCLUDE = -I../../src -I/usr/local/include
.cc.pd_linux: drone.o
g++ -O3 -Wall -D__OS_Linux_ -g -I$(STK_HOME)/include -c drone.cc
g++ $(LINUXCCFLAGS) $(LINUXINCLUDE) -I$(STK_HOME)/include -o $*.o -c $*.cc
- ld -export_dynamic -shared -o $*.pd_linux *.o $(STK_HOME)/src/stklib.a -lc -lm -lstdc++ -lg++
+ g++ -export_dynamic -shared -o $*.pd_linux *.o $(STK_HOME)/src/libstk.a -lc -lm -lpthread
strip --strip-unneeded $*.pd_linux
rm -f *.o ../$*.pd_linux
ln -s $*/$*.pd_linux ..
diff --git a/stkdrone~/README b/stkdrone~/README
index 8ccb16c..493d12f 100644
--- a/stkdrone~/README
+++ b/stkdrone~/README
@@ -1,5 +1,5 @@
*****************************************************************************
-Version 0.01
+Version 0.2
embedding Perry Cook's ragamatic in Pure Data
copyright 2001 by Perry Cook
copyleft 2001 by Yves Degoyon
diff --git a/stkdrone~/drone.cc b/stkdrone~/drone.cc
index ba065ad..dcc3137 100644
--- a/stkdrone~/drone.cc
+++ b/stkdrone~/drone.cc
@@ -9,12 +9,12 @@
#include "drone.h"
-drone :: drone(MY_FLOAT lowestFreq)
+drone :: drone(StkFloat lowestFreq)
{
length = (long) (SRATE / lowestFreq + 1);
- loopGain = (MY_FLOAT) 0.999;
+ loopGain = (StkFloat) 0.999;
loopFilt = new OneZero();
- delayLine = new DLineA(length);
+ delayLine = new DelayA(0.5*length, length);
envelope = new ADSR();
noise = new Noise;
envelope->setAllTimes(2.0,0.5,0.0,0.5);
@@ -35,21 +35,21 @@ void drone :: clear()
delayLine->clear();
}
-void drone :: setFreq(MY_FLOAT frequency)
+void drone :: setFreq(StkFloat frequency)
{
- MY_FLOAT delay;
+ StkFloat delay;
delay = (SRATE / frequency);
delayLine->setDelay(delay - 0.5);
- loopGain = (MY_FLOAT) 0.997 + (frequency * (MY_FLOAT) 0.000002);
- if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
+ loopGain = (StkFloat) 0.997 + (frequency * (StkFloat) 0.000002);
+ if (loopGain>1.0) loopGain = (StkFloat) 0.99999;
}
-void drone :: pluck(MY_FLOAT amplitude)
+void drone :: pluck(StkFloat amplitude)
{
envelope->keyOn();
}
-void drone :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
+void drone :: noteOn(StkFloat freq, StkFloat amp)
{
this->setFreq(freq);
this->pluck(amp);
@@ -58,20 +58,20 @@ void drone :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
#endif
}
-void drone :: noteOff(MY_FLOAT amp)
+void drone :: noteOff(StkFloat amp)
{
- loopGain = (MY_FLOAT) 1.0 - amp;
+ loopGain = (StkFloat) 1.0 - amp;
#if defined(_debug_)
printf("drone : NoteOff: Amp=%lf\n",amp);
#endif
}
-MY_FLOAT drone :: tick()
+StkFloat drone :: tick()
{
/* check this out */
/* here's the whole inner loop of the instrument!! */
- lastOutput = delayLine->tick(loopFilt->tick((delayLine->lastOut() * loopGain))
+ lastOutput_ = delayLine->tick(loopFilt->tick((delayLine->lastOut() * loopGain))
+ (0.005 * envelope->tick() * noise->tick()));
- return lastOutput;
+ return lastOutput_;
}
diff --git a/stkdrone~/drone.h b/stkdrone~/drone.h
index c5f7a0d..9cfe448 100644
--- a/stkdrone~/drone.h
+++ b/stkdrone~/drone.h
@@ -11,7 +11,7 @@
#define __drone_h
#include "Instrmnt.h"
-#include "DLineA.h"
+#include "DelayA.h"
#include "OneZero.h"
#include "ADSR.h"
#include "Noise.h"
@@ -19,7 +19,7 @@
class drone : public Instrmnt
{
protected:
- DLineA *delayLine;
+ DelayA *delayLine;
ADSR *envelope;
Noise *noise;
OneZero *loopFilt;
diff --git a/stkdrone~/help-stkdrone~.pd b/stkdrone~/help-stkdrone~.pd
new file mode 100644
index 0000000..a65624b
--- /dev/null
+++ b/stkdrone~/help-stkdrone~.pd
@@ -0,0 +1,75 @@
+#N canvas 168 23 784 529 10;
+#X obj 112 311 dac~;
+#X obj 115 248 stkdrone~;
+#X obj 114 278 *~;
+#X floatatom 147 278 5 0 0;
+#X msg 162 172 stop;
+#X floatatom 197 201 5 0 0;
+#X floatatom 238 248 5 5 35;
+#X text 247 335 stkdrone~ : Object to embed stk-based drone synthesis
+;
+#X text 247 360 Comments and bugs @ ydegoyon@free.fr;
+#X msg 113 346 \; pd dsp 1;
+#X msg 179 346 \; pd dsp 0;
+#X msg 24 34 bang;
+#X msg 93 99 play;
+#X msg 113 173 play;
+#X obj 195 248 / 100;
+#X text 276 279 Master level;
+#X obj 23 99 metro 2000;
+#X floatatom 52 75 5 0 0;
+#X obj 134 78 / 1000;
+#X obj 134 98 + 0.05;
+#X floatatom 182 98 5 0 0;
+#X obj 217 278 loadbang;
+#X text 301 258 ( min=0.05 \, max=0.35 \, default = 0.25 );
+#X text 303 248 Strength of plucking;
+#X text 241 195 Frequency;
+#X obj 231 77 qlist;
+#X msg 274 76 read drone-freqs;
+#X msg 231 55 next;
+#X msg 274 55 rewind;
+#X text 247 348 Originally written by Perry Cook for STK/ragamatic
+;
+#X obj 386 76 loadbang;
+#X msg 189 278 40;
+#X obj 24 75 + 0;
+#X text 21 12 Ready for meditation ??;
+#X text 240 398 And now another message from Nancy Reagan : "Drugs
+destroy your brain";
+#X text 239 205 ( min=50Hz \, default=250 Hz );
+#X obj 134 59 random 100;
+#X obj 24 56 random 1000;
+#X floatatom 98 27 5 0 0;
+#X connect 1 0 2 0;
+#X connect 2 0 0 0;
+#X connect 2 0 0 1;
+#X connect 3 0 2 1;
+#X connect 4 0 1 0;
+#X connect 5 0 1 1;
+#X connect 6 0 14 0;
+#X connect 11 0 16 0;
+#X connect 11 0 37 0;
+#X connect 12 0 1 0;
+#X connect 13 0 1 0;
+#X connect 14 0 1 2;
+#X connect 16 0 12 0;
+#X connect 16 0 27 0;
+#X connect 16 0 36 0;
+#X connect 16 0 37 0;
+#X connect 17 0 16 1;
+#X connect 18 0 19 0;
+#X connect 19 0 20 0;
+#X connect 19 0 1 2;
+#X connect 21 0 31 0;
+#X connect 25 0 5 0;
+#X connect 25 1 28 0;
+#X connect 26 0 25 0;
+#X connect 27 0 25 0;
+#X connect 28 0 25 0;
+#X connect 30 0 26 0;
+#X connect 31 0 3 0;
+#X connect 32 0 17 0;
+#X connect 36 0 18 0;
+#X connect 37 0 32 0;
+#X connect 38 0 37 1;