aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexternals/grill/fftease/fftease.cwbin207912 -> 207912 bytes
-rw-r--r--externals/grill/flext/flext.cwbin378067 -> 440355 bytes
-rw-r--r--externals/grill/flext/source/flbuf.cpp10
-rwxr-xr-xexternals/grill/flext/source/flprefix.h43
-rw-r--r--externals/grill/xsample/readme.txt1
-rw-r--r--externals/grill/xsample/source/groove.cpp25
-rw-r--r--externals/grill/xsample/source/inter.ci177
-rw-r--r--externals/grill/xsample/source/main.h6
-rwxr-xr-xexternals/grill/xsample/xsample.cwbin154591 -> 154591 bytes
9 files changed, 69 insertions, 193 deletions
diff --git a/externals/grill/fftease/fftease.cw b/externals/grill/fftease/fftease.cw
index 10939532..f31bf361 100755
--- a/externals/grill/fftease/fftease.cw
+++ b/externals/grill/fftease/fftease.cw
Binary files differ
diff --git a/externals/grill/flext/flext.cw b/externals/grill/flext/flext.cw
index 9e587165..2d1ea660 100644
--- a/externals/grill/flext/flext.cw
+++ b/externals/grill/flext/flext.cw
Binary files differ
diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp
index 4b4da40a..ebfe2abf 100644
--- a/externals/grill/flext/source/flbuf.cpp
+++ b/externals/grill/flext/source/flbuf.cpp
@@ -73,13 +73,13 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
arr = (t_garray *)pd_findbyclass(const_cast<t_symbol *>(sym), garray_class);
if(!arr)
{
- if (*sym->s_name) error("buffer: no such array '%s'",sym->s_name);
+ if (*GetString(sym)) error("buffer: no such array '%s'",GetString(sym));
sym = NULL;
if(valid) ret = -1;
}
else if(!garray_getfloatarray(arr, &frames1, &data1))
{
- error("buffer: bad template '%s'", sym->s_name);
+ error("buffer: bad template '%s'",GetString(sym));
data = NULL;
frames = 0;
if(valid) ret = -1;
@@ -95,12 +95,12 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
const _buffer *p = (const _buffer *)sym->s_thing;
if(NOGOOD(p)) {
- post("buffer: buffer object '%s' no good",sym->s_name);
+ post("buffer: buffer object '%s' no good",GetString(sym));
if(valid) ret = -1;
}
else {
#ifdef FLEXT_DEBUG
- post("%s: buffer object '%s' - valid:%i samples:%i channels:%i frames:%i",thisName(),bufname->s_name,p->b_valid,p->b_frames,p->b_nchans,p->b_frames);
+ post("flext: buffer object '%s' - valid:%i samples:%i channels:%i frames:%i",GetString(sym),p->b_valid,p->b_frames,p->b_nchans,p->b_frames);
#endif
if(data != p->b_samples) { data = p->b_samples; if(!ret) ret = 1; }
if(chns != p->b_nchans) { chns = p->b_nchans; if(!ret) ret = 1; }
@@ -108,7 +108,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
}
}
else {
- error("buffer: symbol '%s' not defined", sym->s_name);
+ error("buffer: symbol '%s' not defined", GetString(sym));
if(valid) ret = -1;
}
#else
diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h
index 51c88096..ad1d1edb 100755
--- a/externals/grill/flext/source/flprefix.h
+++ b/externals/grill/flext/source/flprefix.h
@@ -52,6 +52,11 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define FLEXT_OS_LINUX 3
#define FLEXT_OS_IRIX 4
+// --- definitions for FLEXT_OS_API ---------------------
+#define FLEXT_OSAPI_UNKNOWN 0
+#define FLEXT_OSAPI_MAC_CARBON 1
+#define FLEXT_OSAPI_MAC_OSX 2
+
// --- definitions for FLEXT_CPU ---------------------
#define FLEXT_CPU_UNKNOWN 0
#define FLEXT_CPU_INTEL 1
@@ -118,6 +123,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
#endif
+ #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN
+
#elif defined(__BORLANDC__)
// Borland C++
@@ -128,25 +135,33 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define FLEXT_OS FLEXT_OS_WIN
#endif
+ #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN
+
#elif defined(__MWERKS__)
// Metrowerks CodeWarrior
+ #ifndef __CONDITIONALMACROS__
+ #include <ConditionalMacros.h>
+ #endif
+
#ifndef FLEXT_CPU
- #if defined(__INTEL__)
+ #if TARGET_CPU_X86
#define FLEXT_CPU FLEXT_CPU_INTEL
- #elif defined(__POWERPC__)
+ #elif TARGET_CPU_PPC
#define FLEXT_CPU FLEXT_CPU_PPC
- #elif defined(__MIPS__)
+ #elif TARGET_CPU_MIPS
#define FLEXT_CPU FLEXT_CPU_MIPS
+ #elif TARGET_CPU_ALPHA
+ #define FLEXT_CPU FLEXT_CPU_ALPHA
#else
#define FLEXT_CPU FLEXT_CPU_UNKNOWN
#endif
#endif
#ifndef FLEXT_OS
- #if defined(macintosh)
+ #if TARGET_OS_MAC
#define FLEXT_OS FLEXT_OS_MACOS
- #elif defined(__INTEL__)
+ #elif TARGET_OS_WIN32
// assume Windows
#define FLEXT_OS FLEXT_OS_WIN
#else
@@ -154,6 +169,16 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
#endif
+ #ifndef FLEXT_OSAPI
+ #if TARGET_API_MAC_CARBON
+ #define FLEXT_OSAPI FLEXT_OSAPI_MAC_CARBON
+ #elif TARGET_API_MAC_OSX
+ #define FLEXT_OSAPI FLEXT_OSAPI_MAC_OSX
+ #else
+ #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN
+ #endif
+ #endif
+
// This is important for method and attribute callbacks
#pragma enumsalwaysint on
// This is important for everything
@@ -187,6 +212,12 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
#endif
+ #if FLEXT_OS == FLEXT_OS_MACOS
+ #define FLEXT_OSAPI FLEXT_OSAPI_MAC_OSX
+ #else
+ #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN
+ #endif
+
#elif defined(__MRC__) && defined(MPW_CPLUS)
// Apple MPW MrCpp
#if __MRC__ < 0x500
@@ -209,6 +240,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
#endif
+ #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN
+
#endif
#if FLEXT_OS == FLEXT_OS_WIN
diff --git a/externals/grill/xsample/readme.txt b/externals/grill/xsample/readme.txt
index 3beb2776..8f88cd2d 100644
--- a/externals/grill/xsample/readme.txt
+++ b/externals/grill/xsample/readme.txt
@@ -80,6 +80,7 @@ Version history:
- introduced attributes
- restructured make procedures
- corrected names of PD makefile, set help names
+- fixed scale mode bug
0.2.4:
- according to flext 0.2.3 changed sample type to t_sample (S)
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index e35f71dc..62f0c291 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -393,10 +393,13 @@ V xgroove::s_pos_off(I n,S *const *invecs,S *const *outvecs)
{
S *pos = outvecs[outchns];
- const F oscl = scale(curpos);
- for(I si = 0; si < n; ++si) pos[si] = oscl;
+ I si;
+ for(si = 0; si < n; ++si) pos[si] = curpos;
playfun(n,&pos,outvecs);
+
+ const F oscl = scale(curpos);
+ for(si = 0; si < n; ++si) pos[si] = oscl;
}
V xgroove::s_pos_once(I n,S *const *invecs,S *const *outvecs)
@@ -416,13 +419,15 @@ V xgroove::s_pos_once(I n,S *const *invecs,S *const *outvecs)
if(o >= smax) { o = smax; lpbang = true; }
else if(o < smin) { o = smin; lpbang = true; }
- pos[i] = scale(o);
+ pos[i] = o;
o += spd;
}
// normalize and store current playing position
setpos(o);
playfun(n,&pos,outvecs);
+
+ for(I i = 0; i < n; ++i) pos[i] = scale(pos[i]);
}
else
s_pos_off(n,invecs,outvecs);
@@ -454,13 +459,15 @@ V xgroove::s_pos_loop(I n,S *const *invecs,S *const *outvecs)
lpbang = true;
}
- pos[i] = scale(o);
+ pos[i] = o;
o += spd;
}
// normalize and store current playing position
setpos(o);
playfun(n,&pos,outvecs);
+
+ for(I i = 0; i < n; ++i) pos[i] = scale(pos[i]);
}
else
s_pos_off(n,invecs,outvecs);
@@ -502,13 +509,13 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
// in early cross-fade zone
register F inp = o-smin;
znidx[i] = inp*xf;
- znpos[i] = scale(lmax+inp);
+ znpos[i] = lmax+inp;
inzn = true;
}
else
znidx[i] = XZONE_TABLE,znpos[i] = 0;
- pos[i] = scale(o);
+ pos[i] = o;
o += spd;
}
// normalize and store current playing position
@@ -516,6 +523,8 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
playfun(n,&pos,outvecs);
+ for(I i = 0; i < n; ++i) pos[i] = scale(pos[i]);
+
if(inzn) {
// only if we were in cross-fade zone
playfun(n,&znpos,znbuf);
@@ -564,7 +573,7 @@ V xgroove::s_pos_bidir(I n,S *const *invecs,S *const *outvecs)
lpbang = true;
}
- pos[i] = scale(o);
+ pos[i] = o;
o += spd*bd;
}
// normalize and store current playing position
@@ -572,6 +581,8 @@ V xgroove::s_pos_bidir(I n,S *const *invecs,S *const *outvecs)
bidir = (I)bd;
playfun(n,&pos,outvecs);
+
+ for(I i = 0; i < n; ++i) pos[i] = scale(pos[i]);
}
else
s_pos_off(n,invecs,outvecs);
diff --git a/externals/grill/xsample/source/inter.ci b/externals/grill/xsample/source/inter.ci
index e7f37439..1ce98f61 100644
--- a/externals/grill/xsample/source/inter.ci
+++ b/externals/grill/xsample/source/inter.ci
@@ -16,7 +16,7 @@ TMPLDEF V xinter::st_play0(const S *bdt,const I smin,const I smax,const F s2u,co
// stopped
SIGCHNS(BCHNS,inchns,OCHNS,outchns);
- const S *pos = invecs[0];
+// const S *pos = invecs[0];
S *const *sig = outvecs;
for(I ci = 0; ci < outchns; ++ci)
@@ -35,7 +35,7 @@ TMPLDEF V xinter::st_play1(const S *bdt,const I smin,const I smax,const F s2u,co
// ----------------
for(I i = 0; i < n; ++i,++si) {
- register const I oint = (I)(*(pos++)/s2u);
+ register const I oint = (I)(*(pos++));
register const S *fp;
if(oint < smin) {
// position < 0 ... take only 0th sample
@@ -79,7 +79,7 @@ TMPLDEF V xinter::st_play2(const S *bdt,const I smin,const I smax,const F s2u,co
const I maxo = smax-1; // last sample in buffer
for(I i = 0; i < n; ++i,++si) {
- const F o = *(pos++)/s2u;
+ const F o = *(pos++);
register const I oint = (I)o;
if(oint < smin) {
@@ -129,84 +129,7 @@ TMPLDEF V xinter::st_play4(const S *bdt,const I smin,const I smax,const F s2u,co
const I maxo = smax-1; // last sample in play region
for(I i = 0; i < n; ++i,++si) {
- F o = *(pos++)/s2u;
- register I oint = (I)o,ointm,oint1,oint2;
-
- if(oint <= smin) {
- if(oint < smin) oint = smin,o = smin;
- // position is first simple
- ointm = smin; // first sample
- oint1 = oint+1;
- oint2 = oint1+1;
- }
- else if(oint >= maxo-2) {
- if(oint > maxo) oint = maxo,o = smax;
- ointm = oint-1;
- oint1 = oint >= maxo?maxo:oint+1;
- oint2 = oint1 >= maxo?maxo:oint1+1;
- }
- else {
- ointm = oint-1;
- oint1 = oint+1;
- oint2 = oint1+1;
- }
-
- register F frac = o-oint;
-
- register const S *fa = bdt+ointm*BCHNS;
- register const S *fb = bdt+oint*BCHNS;
- register const S *fc = bdt+oint1*BCHNS;
- register const S *fd = bdt+oint2*BCHNS;
-
- for(I ci = 0; ci < OCHNS; ++ci) {
- const F cmb = fc[ci]-fb[ci];
- sig[ci][si] = fb[ci] + frac*(
- cmb - 0.5f*(frac-1.) * ((fa[ci]-fd[ci]+3.0f*cmb)*frac + (fb[ci]-fa[ci]-cmb))
- );
- }
- }
-
- // clear rest of output channels (if buffer has less channels)
- for(I ci = OCHNS; ci < outchns; ++ci)
- for(si = 0; si < n; ++si) sig[ci][si] = 0;
-}
-
-#if 0
-
-TMPLDEF V xinter::s_play0(I n,S *const *invecs,S *const *outvecs)
-{
- // stopped
- SIGCHNS(BCHNS,buf->Channels(),OCHNS,outchns);
-
- const S *pos = invecs[0];
- S *const *sig = outvecs;
-
- for(I ci = 0; ci < outchns; ++ci)
- for(I si = 0; si < n; ++si) sig[ci][si] = 0;
-}
-
-TMPLDEF V xinter::s_play4(I n,S *const *invecs,S *const *outvecs)
-{
- const I smin = curmin,smax = curmax,plen = smax-smin; //curlen;
- if(plen < 4) {
- if(plen < 2) s_play1 TMPLCALL (n,invecs,outvecs);
- else s_play2 TMPLCALL (n,invecs,outvecs);
- return;
- }
-
- SIGCHNS(BCHNS,buf->Channels(),OCHNS,outchns);
-
- const S *pos = invecs[0];
- S *const *sig = outvecs;
- register I si = 0;
- const S *bdt = buf->Data();
-
- // 4-point interpolation
- // ---------------------
- const I maxo = smax-1; // last sample in play region
-
- for(I i = 0; i < n; ++i,++si) {
- F o = *(pos++)/s2u;
+ F o = *(pos++);
register I oint = (I)o,ointm,oint1,oint2;
if(oint <= smin) {
@@ -248,96 +171,6 @@ TMPLDEF V xinter::s_play4(I n,S *const *invecs,S *const *outvecs)
for(si = 0; si < n; ++si) sig[ci][si] = 0;
}
-TMPLDEF V xinter::s_play2(I n,S *const *invecs,S *const *outvecs)
-{
- const I smin = curmin,smax = curmax,plen = smax-smin; //curlen;
- if(plen < 2) {
- s_play1 TMPLCALL (n,invecs,outvecs);
- return;
- }
-
- SIGCHNS(BCHNS,buf->Channels(),OCHNS,outchns);
-
- const S *pos = invecs[0];
- S *const *sig = outvecs;
- register I si = 0;
-
- // linear interpolation
- // --------------------
-
- const I maxo = smax-1; // last sample in buffer
- const S *bdt = buf->Data();
-
- for(I i = 0; i < n; ++i,++si) {
- const F o = *(pos++)/s2u;
- register const I oint = (I)o;
-
- if(oint < smin) {
- // position is before first sample -> take the first sample
- register const S *const fp = bdt+smin*BCHNS;
- for(I ci = 0; ci < OCHNS; ++ci)
- sig[ci][si] = fp[ci];
- }
- else if(oint >= maxo) {
- // position is past last sample -> take the last sample
- register const S *const fp = bdt+maxo*BCHNS;
- for(I ci = 0; ci < OCHNS; ++ci)
- sig[ci][si] = fp[ci];
- }
- else {
- // normal interpolation
- register const F frac = o-oint;
- register const S *const fp0 = bdt+oint*BCHNS;
- register const S *const fp1 = fp0+BCHNS;
- for(I ci = 0; ci < OCHNS; ++ci)
- sig[ci][si] = fp0[ci]+frac*(fp1[ci]-fp0[ci]);
- }
- }
-
- // clear rest of output channels (if buffer has less channels)
- for(I ci = OCHNS; ci < outchns; ++ci)
- for(si = 0; si < n; ++si) sig[ci][si] = 0;
-}
-
-TMPLDEF V xinter::s_play1(I n,S *const *invecs,S *const *outvecs)
-{
- SIGCHNS(BCHNS,buf->Channels(),OCHNS,outchns);
-
- const S *pos = invecs[0];
- S *const *sig = outvecs;
- register I si = 0;
- const I smin = curmin,smax = curmax;
- const S *bdt = buf->Data();
-
- // no interpolation
- // ----------------
-
- for(I i = 0; i < n; ++i,++si) {
- register const I oint = (I)(*(pos++)/s2u);
- register const S *fp;
- if(oint < smin) {
- // position < 0 ... take only 0th sample
- fp = bdt+smin*BCHNS;
- }
- else if(oint >= smax) {
- // position > last sample ... take only last sample
- fp = bdt+(smax-1)*BCHNS;
- }
- else {
- // normal
- fp = bdt+oint*BCHNS;
- }
-
- for(I ci = 0; ci < OCHNS; ++ci)
- sig[ci][si] = fp[ci];
- }
-
- // clear rest of output channels (if buffer has less channels)
- for(I ci = OCHNS; ci < outchns; ++ci)
- for(si = 0; si < n; ++si) sig[ci][si] = 0;
-}
-
-#else
TMPLDEF V xinter::s_play0(I n,S *const *invecs,S *const *outvecs)
{
@@ -359,7 +192,5 @@ TMPLDEF V xinter::s_play4(I n,S *const *invecs,S *const *outvecs)
st_play4 TMPLCALL (buf->Data(),curmin,curmax,s2u,n,buf->Channels(),outchns,invecs,outvecs);
}
-#endif
-
#endif
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index 8f9d15dc..94f8885f 100644
--- a/externals/grill/xsample/source/main.h
+++ b/externals/grill/xsample/source/main.h
@@ -37,9 +37,9 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define TMPLOPT // only workable with gcc >= 3.0
#endif
#elif defined(__MWERKS__)
-// CodeWarrior can't take address of a template member function
+// CodeWarrior <= 8 can't take address of a template member function
#define TMPLOPT
- #define SIGSTATIC
+// #define SIGSTATIC // define that for CW6
#elif defined(__MRC__)
// Apple MPW - MrCpp
// #define TMPLOPT // template optimation for more speed
@@ -111,7 +111,7 @@ protected:
virtual V m_min(F mn);
virtual V m_max(F mx);
- virtual V m_dsp(I n,F *const *insigs,F *const *outsigs);
+ virtual V m_dsp(I n,S *const *insigs,S *const *outsigs);
virtual V s_dsp() = 0;
xs_unit unitmode; //iunitmode,ounitmode;
diff --git a/externals/grill/xsample/xsample.cw b/externals/grill/xsample/xsample.cw
index 9dacae68..d893d3ef 100755
--- a/externals/grill/xsample/xsample.cw
+++ b/externals/grill/xsample/xsample.cw
Binary files differ