rsc3/doc-schelp/Help-3.12.2/Classes/MultiProc.html

156 lines
7.8 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<html><head><title>MultiProc</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='./../prettify.js' type='text/javascript'></script>
<script src='./../lang-sc.js' type='text/javascript'></script>
<script type='text/javascript'>var helpRoot='./..';</script>
</head>
<ul id='menubar'></ul>
<body onload='fixTOC();prettyPrint()'>
<div class='contents'>
<div class='header'>
<div id='label'>SuperCollider CLASSES (extension)</div>
<div id='categories'><a href='./../Browse.html#Libraries>BBCut'>Libraries>BBCut</a></div>
<h1>MultiProc</h1>
<div id='summary'>Allows selection between multiple breakbeat cutting algorithms</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/bbcutprocs/MultiProc.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/bbcutprocs/MultiProc.sc</a></div><div id='superclasses'>Inherits from: <a href="../Classes/BBCutProc.html">BBCutProc</a> : <a href="../Classes/Object.html">Object</a></div>
<div id='related'>See also: <a href="./../Overviews/BBCut.html">BBCut</a></div>
</div>
<div id='toc'>
<ul class='toc'><li class='toc1'><a href='#description'>Description</a></li>
<ul class='toc'></ul><li class='toc1'><a href='#classmethods'>Class methods</a></li>
<ul class='toc'><li class='toc3'><a href='#*new'>new</a> </li>
<li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
</ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
<ul class='toc'><li class='toc3'><a href='#-initMultiProc'>initMultiProc</a> </li>
<li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
<li class='toc2'><a href='#Undocumented%20instance%20methods'>Undocumented instance methods</a></li>
<ul class='toc'><li class='toc3'><a href='#-attachsynth'>attachsynth</a> </li>
<li class='toc3'><a href='#-chooseblock'>chooseblock</a> </li>
<li class='toc3'><a href='#-phraseover'>phraseover</a> </li>
</ul></ul><li class='toc1'><a href='#examples'>Examples</a></li>
<ul class='toc'></ul></ul></div><h2><a class='anchor' name='description'>Description</a></h2>
<p>With this class you may select which of a number of cut procedures to use on the fly. The selection is from an array of BBCutProc derived objects (which might include a further MultiProc!). The index is chosen on a per phrase, or per block basis, by passed valid index returning functions. If a blockfunc is provided, then the selection is always per block. Otherwise it is per phrase. Note that for convoluted switches between many cut procedures at block rate it becomes very unpredictable when phrases start and end, since multiple phrases are bundled together at once.<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='cmethodname'><span class='methprefix'>*</span><a name='*new' href='./../Overviews/Methods.html#new'>new</a> (<span class='argstr'>procs</span>, <span class='argstr'>phrasefunc</span>, <span class='argstr'>blockfunc</span>)</h3>
<div class='method'>
<p><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>procs<td class='argumentdesc'>
<p>An array of cut procedure objects.<tr><td class='argumentname'>phrasefunc<td class='argumentdesc'>
<p>a function that returns a valid index into the procs array. <tr><td class='argumentname'>blockfunc<td class='argumentdesc'>
<p>a function that returns a valid index into the procs array.
<p>phrasefunc and blockfunc may be set to nil if unneeded. The default behaviour with all nil is a phrasefunc that randomly selects any index up to procs.size.</table></div><h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
<div id='inheritedclassmets'></div><h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-initMultiProc' href='./../Overviews/Methods.html#initMultiProc'>initMultiProc</a> (<span class='argstr'>p</span>, <span class='argstr'>pf</span>, <span class='argstr'>bf</span>)</h3>
<div class='method'>
<p>Arguments as for new.
<p>All other methods override the base to pass messages to the currently selected procedure, and update that procedure based on the phrase or block func. </div><h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
<div id='inheritedinstmets'></div><h3><a class='anchor' name='Undocumented%20instance%20methods'>Undocumented instance methods</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-attachsynth' href='./../Overviews/Methods.html#attachsynth'>attachsynth</a> (<span class='argstr'>bbcs</span>)</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-chooseblock' href='./../Overviews/Methods.html#chooseblock'>chooseblock</a> </h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-phraseover' href='./../Overviews/Methods.html#phraseover'>phraseover</a> </h3>
<h2><a class='anchor' name='examples'>Examples</a></h2>
<pre class='code prettyprint lang-sc'>( //test- default behaviour (random choice between cutprocs after each phrase)
var sf, clock, cutsynth, cutproc;
clock= ExternalClock(TempoClock(2.7725));
clock.play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
cutsynth= CutBuf2(sf);
cutproc=MultiProc.new([WarpCutProc1.new,BBCutProc11.new]);
g=BBCut2(cutsynth,cutproc).play(clock);
});
)
( //test- block speed choice of procedure
var sf, clock, cutsynth, cutproc;
clock= ExternalClock(TempoClock(2.7725));
clock.play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
cutsynth= CutBuf2(sf);
cutproc=MultiProc.new([BBCPPermute(4.0,8,{|i,n| (i**(i+1))%n},{[1,2].choose}),SQPusher1(0.7,2,0.5)],nil,{2.rand});
g=BBCut2(cutsynth,cutproc).play(clock);
});
)
( //fill every 4th bar- plain loop otherwise
var sf, clock, cutsynth, cutproc, pseq;
pseq=Pseq([0,0,0,1],inf).asStream;
clock= ExternalClock(TempoClock(2.7725));
clock.play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
cutsynth= CutBuf1(sf);
cutproc=MultiProc.new([BBCutProc.new,WarpCutProc1(phraselength:4.0)],{pseq.next});
g=BBCut2(cutsynth,cutproc).play(clock);
});
)
( //fills 2- more complex pattern
var sf, clock, cutsynth, cutproc, pseq;
var x,y;
pseq=Pseq([0,0,0,1,0,0,0,2],inf).asStream;
clock= ExternalClock(TempoClock(2.7725));
clock.play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
cutsynth= CutBuf1(sf);
cutproc=MultiProc.new([
BBCutProc.new, //for plain play
WarpCutProc1({0.5},phraselength:4.0), //for obvious fill
BBCPPermute(4.0,8,{arg i,n; ((i*y)%n).asInteger},{z})
],{
z=[2,4,8].choose; y= rrand(3,12.3);
pseq.next});
g=BBCut2(cutsynth,cutproc).play(clock);
});
)</pre>
<div class='doclink'>helpfile source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/MultiProc.schelp'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/MultiProc.schelp</a><br>link::Classes/MultiProc::<br>sc version: 3.8.0</div></div></body></html>