diff options
Diffstat (limited to 'externals/grill/xsample')
-rw-r--r-- | externals/grill/xsample/pd/xgroove~.help.pd | 16 | ||||
-rw-r--r-- | externals/grill/xsample/pd/xplay~.help.pd | 11 | ||||
-rw-r--r-- | externals/grill/xsample/pd/xrecord~.help.pd | 10 | ||||
-rw-r--r-- | externals/grill/xsample/readme.txt | 1 | ||||
-rw-r--r-- | externals/grill/xsample/source/groove.cpp | 38 | ||||
-rw-r--r-- | externals/grill/xsample/source/main.cpp | 6 | ||||
-rw-r--r-- | externals/grill/xsample/source/main.h | 25 | ||||
-rw-r--r-- | externals/grill/xsample/source/record.cpp | 39 |
8 files changed, 97 insertions, 49 deletions
diff --git a/externals/grill/xsample/pd/xgroove~.help.pd b/externals/grill/xsample/pd/xgroove~.help.pd index 74b9e312..da24d9ec 100644 --- a/externals/grill/xsample/pd/xgroove~.help.pd +++ b/externals/grill/xsample/pd/xgroove~.help.pd @@ -1,4 +1,4 @@ -#N canvas 92 110 837 556 12; +#N canvas 92 110 839 558 12; #X obj 258 240 hsl 128 15 0.001 3 1 1 empty empty empty 20 8 0 8 -225271 -1 -1 0 1; #X floatatom 255 261 8 0 0; @@ -88,12 +88,12 @@ -1 -1 0 1; #X floatatom 10 83 5 0 0; #X obj 258 32 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1 -1; +0; #X text 277 29 once; #X text 277 45 forward; #X text 277 61 bidir; #X obj 372 31 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1 -1; +0; #X text 391 28 none; #X text 391 44 linear; #X text 391 60 4-point; @@ -102,7 +102,7 @@ #X obj 521 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 256 134 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1 -2; +0; #X text 255 113 units; #X msg 256 199 units \$1; #X obj 364 134 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1 @@ -122,6 +122,10 @@ #X obj 536 467 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 557 468 stop; +#X obj 319 343 print A; +#X msg 131 213 getattributes; +#X msg 177 248 getmax; +#X msg 120 248 getmin; #X connect 0 0 1 0; #X connect 1 0 31 0; #X connect 2 0 31 1; @@ -143,6 +147,7 @@ #X connect 31 1 8 0; #X connect 31 2 4 0; #X connect 31 3 5 0; +#X connect 31 5 70 0; #X connect 34 0 37 0; #X connect 35 0 37 0; #X connect 36 0 14 0; @@ -164,3 +169,6 @@ #X connect 66 0 67 0; #X connect 68 0 67 0; #X connect 69 0 67 0; +#X connect 71 0 31 0; +#X connect 72 0 31 0; +#X connect 73 0 31 0; diff --git a/externals/grill/xsample/pd/xplay~.help.pd b/externals/grill/xsample/pd/xplay~.help.pd index 9bca8cbb..5bf89020 100644 --- a/externals/grill/xsample/pd/xplay~.help.pd +++ b/externals/grill/xsample/pd/xplay~.help.pd @@ -1,4 +1,4 @@ -#N canvas 297 114 616 300 12; +#N canvas 297 114 618 302 12; #X obj 69 252 dac~; #X obj 19 54 bng 15 250 50 0 empty empty empty 20 8 0 8 -258699 -1 -1; @@ -9,7 +9,7 @@ #X obj 125 155 *~ 300; #X text 107 176 position signal; #X msg 16 115 help; -#X graph graph7 0 -1 299 1 284 217 584 17; +#N canvas 0 0 450 300 graph7 0; #X array buf 300 float 1; #A 0 -0.03 -0.03 -0.03 -0.0366667 -0.0433333 -0.05 -0.065 -0.08 -0.085 -0.09 -0.096 -0.102 -0.108 -0.114 -0.12 -0.1275 -0.135 -0.1425 -0.15 @@ -39,12 +39,15 @@ 0.25 0.24 0.23 0.22 0.21 0.2 0.19 0.18 0.16 0.15 0.14 0.13 0.12 0.11 0.105 0.1 0.09 0.075 0.06 0.05 0.04 0.03 0.02 0 -0.02 -0.0266667 -0.0333333 -0.04 -0.05; -#X pop; +#X coords 0 1 299 -1 300 200 1; +#X restore 284 17 graph; #X obj 117 82 hsl 128 15 1 100 1 1 empty empty empty 20 8 0 8 -225271 -1 -1 11100 1; #X obj 77 203 xplay~ buf; #X msg 17 168 print; #X obj 124 124 phasor~ 100; +#X obj 151 237 print A; +#X msg 107 16 getattributes; #X connect 1 0 11 0; #X connect 2 0 11 0; #X connect 3 0 11 0; @@ -53,5 +56,7 @@ #X connect 10 0 13 0; #X connect 11 0 0 0; #X connect 11 0 0 1; +#X connect 11 1 14 0; #X connect 12 0 11 0; #X connect 13 0 6 0; +#X connect 15 0 11 0; diff --git a/externals/grill/xsample/pd/xrecord~.help.pd b/externals/grill/xsample/pd/xrecord~.help.pd index 5226f539..80c09f65 100644 --- a/externals/grill/xsample/pd/xrecord~.help.pd +++ b/externals/grill/xsample/pd/xrecord~.help.pd @@ -1,4 +1,4 @@ -#N canvas 134 12 855 608 12; +#N canvas 134 12 857 610 12; #X obj 14 15 bng 15 250 50 0 empty empty empty 20 8 0 8 -258699 -1 -1; #X msg 13 35 stop; @@ -52,7 +52,7 @@ #X obj 411 473 metro 30; #X obj 18 247 metro 30; #X obj 640 21 osc~ 10; -#X obj 91 133 r~ rec; +#X obj 86 78 r~ rec; #X obj 482 339 r~ rec; #X obj 678 95 s~ rec; #X obj 623 48 *~ 1; @@ -82,6 +82,9 @@ #X msg 488 206 100; #X obj 521 426 line~; #X msg 520 401 \$1 20; +#X msg 9 135 getattributes; +#X obj 208 211 print A; +#X msg 10 163 getbuffer; #X connect 0 0 7 0; #X connect 1 0 7 0; #X connect 4 0 7 2; @@ -89,6 +92,7 @@ #X connect 7 0 9 0; #X connect 7 1 2 0; #X connect 7 2 3 0; +#X connect 7 4 72 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 11 0 41 0; @@ -134,3 +138,5 @@ #X connect 68 0 32 0; #X connect 69 0 24 1; #X connect 70 0 69 0; +#X connect 71 0 7 0; +#X connect 73 0 7 0; diff --git a/externals/grill/xsample/readme.txt b/externals/grill/xsample/readme.txt index 74095a30..425b6a7a 100644 --- a/externals/grill/xsample/readme.txt +++ b/externals/grill/xsample/readme.txt @@ -77,6 +77,7 @@ Version history: - added MaxMSP buffer resize recognition - xgroove~: introduced a crossfading loop zone - adapted source for flext 0.4.1 +- introduced attributes 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 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(""); } |