aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-12-06 05:34:40 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-12-06 05:34:40 +0000
commitaf12d7d5cd541b0d02b31a00e6e3918ae209d8eb (patch)
treeacf0f8d8341dc0583651a665c62a522585e7ec30 /externals/grill/xsample/source
parent420a758195fea188311fdcd24bff4be2c2afebfb (diff)
""
svn path=/trunk/; revision=280
Diffstat (limited to 'externals/grill/xsample/source')
-rw-r--r--externals/grill/xsample/source/groove.cpp38
-rw-r--r--externals/grill/xsample/source/main.cpp6
-rw-r--r--externals/grill/xsample/source/main.h25
-rw-r--r--externals/grill/xsample/source/record.cpp39
4 files changed, 68 insertions, 40 deletions
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index b4748a6f..795eb654 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -84,6 +84,8 @@ protected:
curpos = pos;
}
+ V mg_pos(F &v) const { v = curpos*s2u; }
+
private:
// static V setup(t_class *c);
@@ -108,16 +110,20 @@ private:
}
FLEXT_CALLBACK_F(m_pos)
- FLEXT_CALLBACK(m_all)
FLEXT_CALLBACK_F(m_min)
FLEXT_CALLBACK_F(m_max)
-
+ FLEXT_CALLBACK(m_all)
+
FLEXT_CALLBACK_F(m_xzone)
FLEXT_CALLBACK_F(m_xsymm)
FLEXT_CALLBACK_V(m_xshape)
FLEXT_CALLBACK_B(m_xkeep)
- FLEXT_CALLBACK_1(m_loop,xs_loop)
+ FLEXT_CALLVAR_F(mg_pos,m_pos)
+ FLEXT_CALLSET_F(m_min)
+ FLEXT_CALLSET_F(m_max)
+ FLEXT_CALLSET_E(m_loop,xs_loop)
+ FLEXT_ATTRGET_E(loopmode,xs_loop)
};
@@ -169,13 +175,15 @@ xgroove::xgroove(I argc,const t_atom *argv):
AddOutFloat(2); // play min & max
AddOutBang(); // loop bang
+ FLEXT_ADDMETHOD_(0,"all",m_all);
FLEXT_ADDMETHOD(1,m_min);
FLEXT_ADDMETHOD(2,m_max);
- FLEXT_ADDMETHOD_F(0,"min",m_min);
- FLEXT_ADDMETHOD_F(0,"max",m_max);
- FLEXT_ADDMETHOD_F(0,"pos",m_pos);
- FLEXT_ADDMETHOD_(0,"all",m_all);
- FLEXT_ADDMETHOD_B(0,"loop",m_loop);
+
+ FLEXT_ADDATTR_VAR("min",mg_min,m_min);
+ FLEXT_ADDATTR_VAR("max",mg_max,m_max);
+ FLEXT_ADDATTR_VAR("pos",mg_pos,m_pos);
+
+ FLEXT_ADDATTR_VAR_E("loop",loopmode,m_loop);
FLEXT_ADDMETHOD_F(0,"xzone",m_xzone);
FLEXT_ADDMETHOD_F(0,"xsymm",m_xsymm);
@@ -634,21 +642,21 @@ V xgroove::m_help()
post("Outlets: 1:Audio signal, 2:Position signal, 3:Min position (rounded), 4:Max position (rounded)");
post("Methods:");
post("\thelp: shows this help");
- post("\tset [name]: set buffer or reinit");
+ post("\tset [name] / @buffer [name]: set buffer or reinit");
post("\tenable 0/1: turn dsp calculation off/on");
post("\treset: reset min/max playing points and playing offset");
post("\tprint: print current settings");
- post("\tloop 0/1/2: sets looping to off/forward/bidirectional");
- post("\tinterp 0/1/2: set interpolation to off/4-point/linear");
- post("\tmin {unit}: set minimum playing point");
- post("\tmax {unit}: set maximum playing point");
+ post("\t@loop 0/1/2: sets looping to off/forward/bidirectional");
+ post("\t@interp 0/1/2: set interpolation to off/4-point/linear");
+ post("\t@min {unit}: set minimum playing point");
+ post("\t@max {unit}: set maximum playing point");
post("\tall: select entire buffer length");
post("\tpos {unit}: set playing position (obeying the current scale mode)");
post("\tbang/start: start playing");
post("\tstop: stop playing");
post("\trefresh: checks buffer and refreshes outlets");
- post("\tunits 0/1/2/3: set units to frames/buffer size/ms/s");
- post("\tsclmode 0/1/2/3: set range of position to units/units in loop/buffer/loop");
+ 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)");
diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp
index 30aad069..d8182f57 100644
--- a/externals/grill/xsample/source/main.cpp
+++ b/externals/grill/xsample/source/main.cpp
@@ -55,8 +55,10 @@ xsample::xsample():
FLEXT_ADDMETHOD_(0,"refresh",m_refresh);
FLEXT_ADDMETHOD_(0,"reset",m_reset);
- FLEXT_ADDMETHOD_E(0,"units",m_units);
- FLEXT_ADDMETHOD_E(0,"sclmode",m_sclmode);
+ FLEXT_ADDATTR_VAR("buffer",mg_buffer,ms_buffer);
+ FLEXT_ADDATTR_VAR_E("units",unitmode,m_units);
+ FLEXT_ADDATTR_VAR_E("sclmode",sclmode,m_sclmode);
+ FLEXT_ADDATTR_GET("scale",s2u);
}
xsample::~xsample()
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index c50f8dd6..f0c1bff9 100644
--- a/externals/grill/xsample/source/main.h
+++ b/externals/grill/xsample/source/main.h
@@ -11,9 +11,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#ifndef __XSAMPLE_H
#define __XSAMPLE_H
-#define XSAMPLE_VERSION "0.2.5pre1"
+#define XSAMPLE_VERSION "0.2.5pre2"
+
+#define FLEXT_ATTRIBUTES 1
-
#include <flext.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401)
@@ -118,6 +119,12 @@ protected:
BL bufchk() { if(buf->Update()) { m_refresh(); return true; } return false; }
+ V mg_buffer(AtomList &l) { if(buf) { l(1); SetSymbol(l[0],buf->Symbol()); } else l(); }
+ V ms_buffer(const AtomList &l) { m_set(l.Count(),l.Atoms()); }
+
+ V mg_min(F &v) const { v = curmin*s2u; }
+ V mg_max(F &v) const { v = curmax*s2u; }
+
private:
FLEXT_CALLBACK(m_start)
@@ -128,8 +135,18 @@ private:
FLEXT_CALLBACK(m_refresh)
FLEXT_CALLBACK(m_reset)
- FLEXT_CALLBACK_1(m_units,xs_unit)
- FLEXT_CALLBACK_1(m_sclmode,xs_sclmd)
+ FLEXT_CALLVAR_V(mg_buffer,ms_buffer)
+
+ FLEXT_CALLSET_E(m_units,xs_unit)
+ FLEXT_ATTRGET_E(unitmode,xs_unit)
+ FLEXT_CALLSET_E(m_sclmode,xs_sclmd)
+ FLEXT_ATTRGET_E(sclmode,xs_sclmd)
+
+ FLEXT_ATTRGET_F(s2u)
+
+protected:
+ FLEXT_CALLGET_F(mg_min)
+ FLEXT_CALLGET_F(mg_max)
};
diff --git a/externals/grill/xsample/source/record.cpp b/externals/grill/xsample/source/record.cpp
index 052bcc06..d3ce5cee 100644
--- a/externals/grill/xsample/source/record.cpp
+++ b/externals/grill/xsample/source/record.cpp
@@ -46,10 +46,10 @@ public:
virtual V m_min(F mn);
virtual V m_max(F mx);
- virtual V m_mixmode(BL mx) { mixmode = mx; }
- virtual V m_sigmode(BL mode) { /*dorec =*/ sigmode = mode; }
- virtual V m_loop(BL lp) { doloop = lp; }
- virtual V m_append(BL app) { if(!(appmode = app)) m_pos(0); }
+// V m_mixmode(BL mx) { mixmode = mx; }
+// V m_sigmode(BL mode) { sigmode = mode; }
+// V m_loop(BL lp) { doloop = lp; }
+ V m_append(BL app) { if(!(appmode = app)) m_pos(0); }
virtual V m_draw(I argc,const t_atom *argv);
@@ -85,10 +85,11 @@ private:
FLEXT_CALLBACK_F(m_min)
FLEXT_CALLBACK_F(m_max)
- FLEXT_CALLBACK_B(m_loop)
- FLEXT_CALLBACK_B(m_mixmode)
- FLEXT_CALLBACK_B(m_sigmode)
- FLEXT_CALLBACK_B(m_append)
+ FLEXT_ATTRVAR_B(doloop)
+ FLEXT_ATTRVAR_B(mixmode)
+ FLEXT_ATTRVAR_B(sigmode)
+ FLEXT_CALLSET_B(m_append)
+ FLEXT_ATTRGET_B(appmode)
FLEXT_CALLBACK_V(m_draw)
};
@@ -150,12 +151,12 @@ xrecord::xrecord(I argc,const t_atom *argv):
FLEXT_ADDMETHOD_F(0,"max",m_max);
FLEXT_ADDMETHOD_(0,"all",m_all);
- FLEXT_ADDMETHOD_B(0,"loop",m_loop);
- FLEXT_ADDMETHOD_B(0,"mixmode",m_mixmode);
- FLEXT_ADDMETHOD_B(0,"sigmode",m_sigmode);
- FLEXT_ADDMETHOD_B(0,"append",m_append);
-
FLEXT_ADDMETHOD_(0,"draw",m_draw);
+
+ FLEXT_ADDATTR_VAR1("loop",doloop);
+ FLEXT_ADDATTR_VAR1("mixmode",mixmode);
+ FLEXT_ADDATTR_VAR1("sigmode",sigmode);
+ FLEXT_ADDATTR_VAR("append",appmode,m_append);
}
@@ -435,10 +436,10 @@ V xrecord::m_help()
post("\tenable 0/1: turn dsp calculation off/on");
post("\treset: reset min/max recording points and recording offset");
post("\tprint: print current settings");
- post("\tsigmode 0/1: specify message or signal triggered recording");
- post("\tappend 0/1: reset recording position or append to current position");
- post("\tloop 0/1: switches looping off/on");
- post("\tmixmode 0/1: specify if audio signal should be mixed in");
+ post("\t@sigmode 0/1: specify message or signal triggered recording");
+ post("\t@append 0/1: reset recording position or append to current position");
+ post("\t@loop 0/1: switches looping off/on");
+ post("\t@mixmode 0/1: specify if audio signal should be mixed in");
post("\tmin {unit}: set minimum recording point");
post("\tmax {unit}: set maximum recording point");
post("\tall: select entire buffer length");
@@ -446,8 +447,8 @@ V xrecord::m_help()
post("\tbang/start: start recording");
post("\tstop: stop recording");
post("\trefresh: checks buffer and refreshes outlets");
- post("\tunits 0/1/2/3: set units to frames/buffer size/ms/s");
- post("\tsclmode 0/1/2/3: set range of position to units/units in loop/buffer/loop");
+ 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("\tdraw [{float}]: redraw buffer immediately (arg omitted) or periodic (in ms)");
post("");
}