aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample/source/groove.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-02-10 04:39:47 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-02-10 04:39:47 +0000
commit06f62d1168209ca6b9e2c3c5264c96a0a4c7cc98 (patch)
tree1523aa8e7032c786948912558b98810395672d58 /externals/grill/xsample/source/groove.cpp
parent1ad0b336ef24029311219bdb6c62a8208deef309 (diff)
""
svn path=/trunk/; revision=387
Diffstat (limited to 'externals/grill/xsample/source/groove.cpp')
-rw-r--r--externals/grill/xsample/source/groove.cpp25
1 files changed, 18 insertions, 7 deletions
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);