StreamKrDur:
Filter:
crucial-library/Classes (extension) | Libraries > crucial > Players

StreamKrDur
ExtensionExtension

a 'control' rate player that combines a stream of values with a stream of durations and plays them

Description

This plays a pattern in real time in the language, and sends those values as /c_set messages to its bus on the server. Durations are specified in beats by a second pattern.

Timings are exact, its messages are sent to the server with a small latency period before they should be played. That is to say when you start playing a StreamKrDur, it will run slightly and exactly ahead of time. It is cancellable and stoppable within Server-latency.

Class Methods

.new

Arguments:

values

a Pattern or Stream of floats or a Ref of an array of values

1.0 Prand([1,0],inf) { 1.0.rand } `[ 1,0,1,0,] // Ref converted into Pseq([1,0,1,0],inf)

durations

A stream of values for the duration in beats between each value change.

0.25 Prand([0.25,0.5],inf) FuncStream({ rrand(0.125,16.0) }) `[1.0,0.25,0.5] // Ref

lag

lag time for a Lag.kr that will be added to the output. if 0.0 (default) no Lag will be used.

Instance Methods

.values

.durations

.lastValue

.delta

.beat

.skdinit

.didStop

.stopRoutine

.resetRoutine

.spawnToBundle

Arguments:

bundle

.didSpawn

.poll

.spec

.children

.storeArgs

.guiClass

.wigglyness

Examples

dalek mating season II

same thing with a separated Instr

A metronome

In this case since the beat clock, and both stream kr durs are running all at the same tempo, it would be slightly more efficient to use an InstrGateSpawner and do separate events. Only one scheduler then instead of 2. See the example in InstrGateSpawner

But if you wanted them in different syncs, different streams and a continuos running synth (and have fun with the Decay), then this would be a good starting point.

With a Pbind you are creating a new event for every note and creating new UGens and a new Synth each time. This is more like an analog synth: the oscillators play constantly and they are gated to create notes.