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

150 lines
10 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<html><head><title>CutBuf2</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>CutBuf2</h1>
<div id='summary'>BBCut2 buffer playback with modulatable grain parameters</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutBuf2.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutBuf2.sc</a></div><div id='superclasses'>Inherits from: <a href="../Classes/CutSynth.html">CutSynth</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='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='#-atkprop'>atkprop</a> </li>
<li class='toc3'><a href='#-bbcutbuf'>bbcutbuf</a> </li>
<li class='toc3'><a href='#-curve'>curve</a> </li>
<li class='toc3'><a href='#-dutycycle'>dutycycle</a> </li>
<li class='toc3'><a href='#-initCutBuf2'>initCutBuf2</a> </li>
<li class='toc3'><a href='#-offset'>offset</a> </li>
<li class='toc3'><a href='#-pbsfunc'>pbsfunc</a> </li>
<li class='toc3'><a href='#-relprop'>relprop</a> </li>
<li class='toc3'><a href='#-renderBlock'>renderBlock</a> </li>
<li class='toc3'><a href='#-setup'>setup</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>Playback for a buffer, with individual grains spawned for each cut. Each grain may have associated parameters for playback speed, enveloping and dutycycle (ratio of duration to inter-onset-interval). <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'>bbcutbuf</span>, <span class='argstr'>offset</span>, <span class='argstr'>pbsfunc</span>, <span class='argstr'>dutycycle</span>, <span class='argstr'>atkprop</span>, <span class='argstr'>relprop</span>, <span class='argstr'>curve</span>)</h3>
<div class='method'>
<p>All of the arguments apart from bbcutbuf can have more complex objects than SimpleNumbers passed in. You can pass in anything which responds to value (like a Function) or even objects which respond to the updateblock method such as CutPBS1 (see examples below).<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>bbcutbuf<td class='argumentdesc'>
<p>An instance of BBCutBuffer representing the buffer to be cut-up.<tr><td class='argumentname'>offset<td class='argumentdesc'>
<p>A parameter to be passed to any cut playback position determining routine. The default chooseoffset method is in BBCutBuffer and the parameter is a single number from 0.0 to 1.0 giving the chance of a jump to a random event in the source.<tr><td class='argumentname'>pbsfunc<td class='argumentdesc'>
<p>Playback speed (rate) control for each cut. This can be a constant, or some other object that responds to .value, which is called for every repeat in a block. The first argument is the repeat number in the block, and the second argument is the block itself. If pbsfunc responds to .updateblock, that will also be called every block with the current block passed as an argument.<tr><td class='argumentname'>dutycycle<td class='argumentdesc'>
<p>Ratio of duration to inter-onset-interval (IOI). 0.5 would mean that the duration of grains is only half the length between cut start times. <tr><td class='argumentname'>atkprop<td class='argumentdesc'>
<p>Enveloping parameter for attack speed. Rated as a proportion of the overall envelope (0.0 to 1.0) <tr><td class='argumentname'>relprop<td class='argumentdesc'>
<p>Enveloping parameter for release speed. Rated as a proportion of the overall envelope (0.0 to 1.0) <tr><td class='argumentname'>curve<td class='argumentdesc'>
<p>Envelope curve</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><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='-atkprop' href='./../Overviews/Methods.html#atkprop'>atkprop</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-atkprop' href='./../Overviews/Methods.html#atkprop'>atkprop</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-bbcutbuf' href='./../Overviews/Methods.html#bbcutbuf'>bbcutbuf</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-bbcutbuf' href='./../Overviews/Methods.html#bbcutbuf'>bbcutbuf</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-curve' href='./../Overviews/Methods.html#curve'>curve</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-curve' href='./../Overviews/Methods.html#curve'>curve</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-dutycycle' href='./../Overviews/Methods.html#dutycycle'>dutycycle</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-dutycycle' href='./../Overviews/Methods.html#dutycycle'>dutycycle</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-initCutBuf2' href='./../Overviews/Methods.html#initCutBuf2'>initCutBuf2</a> (<span class='argstr'>bcb</span>, <span class='argstr'>off</span>, <span class='argstr'>pf</span>, <span class='argstr'>dc</span>, <span class='argstr'>ap</span>, <span class='argstr'>rp</span>, <span class='argstr'>c</span>)</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-offset' href='./../Overviews/Methods.html#offset'>offset</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-offset' href='./../Overviews/Methods.html#offset'>offset</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-pbsfunc' href='./../Overviews/Methods.html#pbsfunc'>pbsfunc</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-pbsfunc' href='./../Overviews/Methods.html#pbsfunc'>pbsfunc</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-relprop' href='./../Overviews/Methods.html#relprop'>relprop</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-relprop' href='./../Overviews/Methods.html#relprop'>relprop</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-renderBlock' href='./../Overviews/Methods.html#renderBlock'>renderBlock</a> (<span class='argstr'>block</span>, <span class='argstr'>clock</span>)</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-setup' href='./../Overviews/Methods.html#setup'>setup</a> </h3>
<h2><a class='anchor' name='examples'>Examples</a></h2>
<pre class='code prettyprint lang-sc'>(
var sf, clock;
s=Server.default;
clock= ExternalClock(TempoClock(2.1)).play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break.aiff",8);
s.sync; //this forces a wait for the Buffer to load
BBCut2(CutBuf2(sf,0.3), BBCutProc11.new).play(clock);
});
)
//dutycycle and envelope manipulations, CutPBS1 instance used to control repitching of rolls
(
var sf, clock;
clock= ExternalClock(TempoClock(2.1)).play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break.aiff",8);
s.sync; //this forces a wait for the Buffer to load
BBCut2(CutBuf2(sf,0.3, CutPBS1(0.97,{1.rand2}), 0.5, 0.001, 0.5, -4), WarpCutProc1.new).play(clock);
});
)
//showing passing of functions, the block argument passed to the dutycycle function is a BBCutBlock object
(
var sf, clock;
clock=ExternalClock(TempoClock(3.3)).play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
BBCut2(CutBuf2(sf,0.3, {rrand(0.9,1.1)}, {arg i, block; var ioi; ioi= block.iois[i]; ioi.min(0.75)/ioi},{exprand(0.001,0.5)}), ChooseCutProc({[0.5,1.0,1.25].choose},{rrand(1,4)})).play(clock);
});
)
(
var sf, clock;
clock=ExternalClock(TempoClock(3.3)).play;
Routine.run({
sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);
s.sync; //this forces a wait for the Buffer to load
BBCut2(CutBuf2(sf, relprop:0.8, curve:{rrand(-16,-1)}), ChooseCutProc({[0.5,1.0,0.25].choose},{rrand(1,4)})).play(clock);
});
)</pre>
<div class='doclink'>helpfile source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/CutBuf2.schelp'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/CutBuf2.schelp</a><br>link::Classes/CutBuf2::<br>sc version: 3.8.0</div></div></body></html>