aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-04-06 02:44:31 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-04-06 02:44:31 +0000
commit4b30c6a7955f3ec61b6d9112b2a42e83e03f8729 (patch)
treeb07c9bac9cae52f4c1441e70034e867ccce04c17 /externals/grill/xsample/source
parent5d0898c3082a45cc05953e78705314b44da64a3f (diff)
""
svn path=/trunk/; revision=548
Diffstat (limited to 'externals/grill/xsample/source')
-rw-r--r--externals/grill/xsample/source/groove.cpp22
-rw-r--r--externals/grill/xsample/source/main.cpp12
-rw-r--r--externals/grill/xsample/source/main.h2
3 files changed, 20 insertions, 16 deletions
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index 5ddb997e..1c6f195f 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -311,7 +311,7 @@ V xgroove::m_xshape(I argc,const t_atom *argv)
switch(xshape) {
case 1:
for(i = 0; i <= XZONE_TABLE; ++i)
- znmul[i] = sin(i*(pi/2./XZONE_TABLE))*xshparam+i*(1./XZONE_TABLE)*(1-xshparam);
+ znmul[i] = ((sin(i*(pi/XZONE_TABLE)-pi/2.)+1)/2)*xshparam+i*(1./XZONE_TABLE)*(1-xshparam);
break;
case 0:
default:
@@ -358,15 +358,14 @@ V xgroove::do_xzone()
// must reduce crossfade/loop length
if(!xkeep) {
// prefer preservation of cross-fade length
- if(xzone >= plen) // have to reduce cross-fade length
- xzone = plen-1;
-// znmin = smin+xzone,znmax = smax-xzone;
+ if(xzone*2 >= plen) // have to reduce cross-fade length
+ xzone = plen/2;
znmin = xzone,znmax = buf->Frames()-xzone;
}
else {
// prefer preservation of loop length
znmin += o1,znmax -= o2;
- xzone = (buf->Frames()-znmax+znmin)/2;
+ xzone = (buf->Frames()-(znmax-znmin))/2;
}
znsmin = 0,znsmax = buf->Frames();
}
@@ -484,7 +483,7 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
S *pos = outvecs[outchns];
BL lpbang = false;
- const F xz = xzone,lmin = znmin,lmax = znmax;
+ const F xz = xzone,lmin = znmin,lmax = znmax,lsh = lmax+xz-lmin;
const F xf = (F)XZONE_TABLE/xz;
// adapt the playing bounds to the current cross-fade zone
@@ -511,14 +510,13 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
// in late cross-fade zone
// shift it into early zone
- o -= plen;
+ o -= lsh;
}
// now: lmin-xz <= o < lmax
if(o < lmin) {
// in early cross-fade zone
-// register F inp = o-smin; // -xz/2 <= inp <= xz/2
register F inp = xz-(lmin-o); // 0 <= inp < xz
znidx[i] = inp*xf;
znpos[i] = lmax+inp;
@@ -685,10 +683,10 @@ V xgroove::m_help()
post("\trefresh: checks buffer and refreshes outlets");
post("\t@units 0/1/2/3: set units to frames/buffer size/ms/s");
post("\t@sclmode 0/1/2/3: set range of position to units/units in loop/buffer/loop");
- post("\txzone {unit}: length of loop crossfade zone");
- post("\txsymm -1,0...1: symmetry of crossfade zone inside/outside point");
- post("\txshape 0/1 [param 0...1]: shape of crossfading (linear/trig)");
- post("\txkeep 0/1: try to preserve xzone/loop length");
+ post("\t@xzone {unit}: length of loop crossfade zone");
+ post("\t@xsymm -1,0...1: symmetry of crossfade zone inside/outside point");
+ post("\t@xshape 0/1 [param 0...1]: shape of crossfading (linear/trig)");
+ post("\t@xkeep 0/1: try to preserve xzone/loop length");
post("");
}
diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp
index aa1f731e..1f79335f 100644
--- a/externals/grill/xsample/source/main.cpp
+++ b/externals/grill/xsample/source/main.cpp
@@ -14,9 +14,15 @@ WARRANTIES, see the file, "license.txt," in this distribution.
// Initialization function for xsample library
static V xsample_main()
{
- post("xsample objects, version " XSAMPLE_VERSION ", (C)2001-2003 Thomas Grill");
- post("xsample: xrecord~, xplay~, xgroove~ - send objects a 'help' message to get assistance");
- post("");
+ post("-------------------------------");
+ post("xsample objects, version " XSAMPLE_VERSION);
+ post("");
+ post(" xrecord~, xplay~, xgroove~ ");
+ post(" (C)2001-2003 Thomas Grill ");
+#ifdef FLEXT_DEBUG
+ post(" DEBUG BUILD ");
+#endif
+ post("-------------------------------");
// call the objects' setup routines
FLEXT_DSP_SETUP(xrecord);
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index 3ea04d70..2bbe71c7 100644
--- a/externals/grill/xsample/source/main.h
+++ b/externals/grill/xsample/source/main.h
@@ -11,7 +11,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#ifndef __XSAMPLE_H
#define __XSAMPLE_H
-#define XSAMPLE_VERSION "0.3.0pre7"
+#define XSAMPLE_VERSION "0.3.0pre8"
#define FLEXT_ATTRIBUTES 1