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

148 lines
8.8 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<html><head><title>CutStream1</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>CutStream1</h1>
<div id='summary'>BBCut2 with live input</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutStream1.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutStream1.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='#-bbcutbuf'>bbcutbuf</a> </li>
<li class='toc3'><a href='#-free'>free</a> </li>
<li class='toc3'><a href='#-inbus'>inbus</a> </li>
<li class='toc3'><a href='#-initCutStream1'>initCutStream1</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 stream of audio which can be cut-up. The stream can be any bus on the Server, so might be a file streamed off disk, a current audio input or some synthesised data.
<p>Each grain may have associated parameters for enveloping and dutycycle (ratio of duration to inter-onset-interval).
<p>Note that CutStream1 uses In.ar rather than InFeedback.ar, for reaction speed, so execution order is important. you cannot cut-up a stream created later in the execution order. Change the SynthDefs in the class file to InFeedback if you want no execution order worries, at the expense of an audio block's delay (usually 64 samples). <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'>inbus</span>, <span class='argstr'>bbcutbuf</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><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>inbus<td class='argumentdesc'>
<p>Bus on the Server to be cut-up.<tr><td class='argumentname'>bbcutbuf<td class='argumentdesc'>
<p>A Server side buffer must exist for the use of the UGen- by default one is allocated for you.<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='-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='-free' href='./../Overviews/Methods.html#free'>free</a> </h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-inbus' href='./../Overviews/Methods.html#inbus'>inbus</a></h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-inbus' href='./../Overviews/Methods.html#inbus'>inbus</a> = value</h3>
<h3 class='imethodname'><span class='methprefix'>-</span><a name='-initCutStream1' href='./../Overviews/Methods.html#initCutStream1'>initCutStream1</a> (<span class='argstr'>ib</span>, <span class='argstr'>bcb</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='-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'>s=Server.default;
a=BBCut2(CutStream1.new).play;
a.end;
//dutycycle and envelope manipulations of first audio in channel
(
var buf, clock;
clock= ExternalClock(TempoClock(2.1));
clock.play;
Routine.run({
buf= BBCutBuffer.alloc(s,44100,1);
s.sync; //this forces a wait for the Buffer to be allocated
BBCut2(CutStream1(s.options.numOutputBusChannels, buf, 0.5, 0.001, 0.5, -4), WarpCutProc1.new).play(clock);
});
)
//dutycycle and envelope manipulations cutting up a stream being synthesised
(
var buf, clock, synthgroup, bbcutgroup, synthbus;
clock= ExternalClock(TempoClock(2.1));
synthgroup= Group.head(Node.basicNew(s,1));
bbcutgroup= Group.after(synthgroup);
synthbus= Bus.audio(s,1);
Routine.run({
SynthDef(\sourcesound,{Out.ar(synthbus.index,Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr(1,100,300),550,0.05,0.07))}).play(synthgroup);
buf= BBCutBuffer.alloc(s,44100,1);
s.sync; //this forces a wait for the Buffer to be allocated
BBCut2(CutGroup(CutStream1(synthbus.index, buf, 0.75, 0.01, 0.5, -4),bbcutgroup), WarpCutProc1.new).play(clock);
});
clock.play;
)
//source on its own for comparison
SynthDef(\sourcesound,{Out.ar(0,Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr(1,100,300),550,0.05,0.07)*0.1)}).play;
//cutup of stereo sound- note use of stereo Bus and creation of stereo buffer, CutGroup last argument is numChannels
(
var buf, clock, synthgroup, bbcutgroup, synthbus;
clock= ExternalClock(TempoClock(2.1));
synthgroup= Group.head(Node.basicNew(s,1));
bbcutgroup= Group.after(synthgroup);
synthbus= Bus.audio(s,2);
Routine.run({
SynthDef(\sourcesound,{Out.ar(synthbus.index,0.25*Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr([1.1,1.3],100,300),[650,750],0.05,0.07))}).play(synthgroup);
buf= BBCutBuffer.alloc(s,44100,2);
s.sync; //this forces a wait for the Buffer to be allocated
BBCut2(CutGroup(CutStream1(synthbus.index, buf, 0.75, 0.01, 0.5, -4),bbcutgroup,nil,2), WarpCutProc1.new).play(clock);
});
clock.play;
)</pre>
<div class='doclink'>helpfile source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/CutStream1.schelp'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/CutStream1.schelp</a><br>link::Classes/CutStream1::<br>sc version: 3.8.0</div></div></body></html>