aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-03-04 04:40:14 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-03-04 04:40:14 +0000
commit69f7f0c33559cf90e7d6ce7c0ddbd5501af7b1de (patch)
tree634c832e0e85566965ed8e0f489c7f7af7cf95d6 /externals/grill/xsample/source
parentc3ae6e7ab08db709ffa1975eea70bfc9461f1d6a (diff)
""
svn path=/trunk/; revision=452
Diffstat (limited to 'externals/grill/xsample/source')
-rw-r--r--externals/grill/xsample/source/groove.cpp43
-rw-r--r--externals/grill/xsample/source/main.h2
2 files changed, 16 insertions, 29 deletions
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index 60bf617b..6355b1a0 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -276,7 +276,7 @@ V xgroove::m_xzone(F xz)
{
bufchk();
_xzone = xz < 0?0:xz;
- do_xzone();
+// do_xzone();
s_dsp();
}
@@ -335,6 +335,8 @@ V xgroove::m_xkeep(BL k)
V xgroove::do_xzone()
{
+ if(!s2u) return; // this can happen if DSP is off
+
xzone = _xzone/s2u;
I smin = curmin,smax = curmax,plen = smax-smin; //curlen;
if(xsymm < 0) {
@@ -346,7 +348,7 @@ V xgroove::do_xzone()
// desired crossfade points
znmin = smin+xzone*xsymm,znmax = smax+xzone*(xsymm-1);
// extra space at beginning and end
- F o1 = znmin-xzone,o2 = buf->Frames()-(znmax+xzone);
+ F o1 = znmin-xzone,o2 = buf->Frames()-(znmax+xzone);
if(o1 < 0 || o2 < 0) { // or (o1*o2 < 0)
if(o1+o2 < 0) {
@@ -595,7 +597,9 @@ V xgroove::s_dsp()
switch(loopmode) {
case xsl_once: SETSIGFUN(posfun,SIGFUN(s_pos_once)); break;
case xsl_loop:
- if(xzone > 0) {
+ if(_xzone > 0) {
+ // xzone might not be set yet (is done in do_xzone() )
+
const I blksz = Blocksize();
if(pblksz != blksz) {
@@ -610,34 +614,17 @@ V xgroove::s_dsp()
pblksz = blksz;
}
+ do_xzone(); // recalculate (s2u may have been 0 before)
+
SETSIGFUN(posfun,SIGFUN(s_pos_loopzn));
// linear interpolation should be just ok for fade zone, no?
-/*
- if(interp == xsi_4p)
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play4,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play4,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play4,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play4,1,-1));
- }
- else if(interp == xsi_lin)
-*/
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play2,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play2,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play2,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play2,1,-1));
- }
-/*
- else
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play1,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play1,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play1,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play1,1,-1));
- }
-*/
+ switch(outchns) {
+ case 1: SETSTFUN(zonefun,TMPLSTF(st_play2,1,1)); break;
+ case 2: SETSTFUN(zonefun,TMPLSTF(st_play2,1,2)); break;
+ case 4: SETSTFUN(zonefun,TMPLSTF(st_play2,1,4)); break;
+ default: SETSTFUN(zonefun,TMPLSTF(st_play2,1,-1));
+ }
}
else
SETSIGFUN(posfun,SIGFUN(s_pos_loop));
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index 03d5d261..fbbb693b 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.0pre4"
+#define XSAMPLE_VERSION "0.3.0pre5"
#define FLEXT_ATTRIBUTES 1