ZeroXBufRd:
Filter:
miSCellaneous_lib/Classes (extension) | Libraries > miSCellaneous > ZeroX ugens

ZeroXBufRd
ExtensionExtension

reads consecutive sequences of segments between zero crossings from one or more buffers with demand-rate control

Description

ZeroXBufRd is for consecutive reading of segments between zero crossings (half wavesets) from one or more buffers, whereby several reading and processing parameters can be sequenced with demand rate ugens. Full waveset sequences can so be generated as a special case. It needs analysis data prepared with ZeroXBufWr. For triggering possibly overlapped (half) wavesets see TZeroXBufRd. ZeroXBufRd / TZeroXBufRd can be used for a number of synthesis / processing techniques in a field between wavesets [1, 4, 5], pulsar synthesis [1, 3], buffer modulation and rectification (which are both a kind of waveshaping) and stochastic concatenation methods [2, 6]. There are already existing SC waveset implementations like Alberto de Campo's Wavesets quark (https://github.com/supercollider-quarks/quarks) and Olaf Hochherz's SPList (https://github.com/olafklingt/SPList), which do language-side analysis and Fabian Seidl's RTWaveSets plugin (https://github.com/tai-studio/RTWaveSets). My focus has been server-side analysis and demand rate ugen control of half waveset parameters as well as multichannel and buffer switch options. Realtime control while analysis is possible, as long as reading is only refering to already analysed sections, but clearly most flexibility is given with a fully analysed buffer, which can also be done in quasi realtime.

NOTE: Depending on the multichannel sizes and the options used (rate and dir sequencing) it might be necessary to increase server resources, i.e. the number of interconnect buffers and / or memory size (e.g. s.options.numWireBufs = 256; s.options.memSize = 8192 * 32; s.reboot). Because of overlappings this is more relevant with TZeroXBufRd than with ZeroXBufRd.
NOTE: Often it pays to adjust zero crossings in the sound buffer effectively to 0, that way sawtooth-like interpolation artefacts can be avoided. See Ex. 7 and TZeroXBufRd: Ex. 1 and ZeroXBufWr: Ex. 2.
NOTE: The reading of consecutive half wavesets is implemented with Sweep and retriggering. For that reason each played back half waveset has a minimum length of 2 samples. In the case of adjusted zero crossings that immediately follow each other this can lead to flat sections of a few samples length. Normally this is irrelevant, but you might check setting ZeroXBufWr's flag 'adjustZeroXs' to 2, see Ex. 7 and ZeroXBufWr: Ex. 2.
NOTE: Demand rate UGens in ZeroXBufRd / TZeroXBufRd should always use inf as repeats arg, this is of course not necessary for nested ones. You might pass a length arg though (Ex. 5).
NOTE: For avoiding too long half wavesets it might be useful to apply LeakDC resp. a high pass filter before analysis.
NOTE: In rare cases I noticed corrupted buffers in multi buffer examples for no obvious reason.
NOTE: For full functionality at least SC 3.7 is recommended (rate sequencing doesn't work in 3.6)

Credits

Thanks to Tommaso Settimi for an inspiring discussion, which gave me a nudge to tackle these classes.

References

  1. de Campo, Alberto. "Microsound" In: Wilson, S., Cottle, D. and Collins, N. (eds). 2011. The SuperCollider Book. Cambridge, MA: MIT Press, 463-504.
  2. Luque, Sergio (2006). Stochastic Synthesis, Origins and Extensions. Institute of Sonology, Royal Conservatory, The Netherlands. https://sergioluque.com
  3. Roads, Curtis (2001). Microsound. Cambridge, MA: MIT Press.
  4. Seidl, Fabian (2016). Granularsynthese mit Wavesets für Live-Anwendungen. Master Thesis, TU Berlin. https://www2.ak.tu-berlin.de/~akgroup/ak_pub/abschlussarbeiten/2016/Seidl_MasA.pdf
  5. Wishart, Trevor (1994). Audible Design. York: Orpheus The Pantomime Ltd.
  6. Xenakis, Iannis (1992). Formalized Music. Hillsdale, NY: Pendragon Press, 2nd Revised edition.

Class Methods

.ar

Creates a new ZeroXBufRd ar UGen.

Arguments:

sndBuf

Buffer or SequenceableCollection of Buffers to read the data from, data must correspond to zeroXBuf.

zeroXBuf

Analysis Buffer resp. SequenceableCollection of such, prepared with ZeroXBufWr. Must refer to data passed to sndBuf.

bufMix

A Number indicating the sndBuf index, a demand rate or other ugens returning sndBuf indices or a SequenceableCollection of such. In contrast to other args combinations of demand rate and normal ugens are not valid. If bufMix equals nil (default) the size of the returned signal equals the size of sndBuf, otherwise it equals its own size.

zeroX

A Number indicating the index in zeroXBuf, a demand rate or other ugens returning zeroXBuf indices or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of zeroX and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 0.

power

Used for processing the buffer signal according to the formula: sig ** power * mul + add per half waveset. Must be a positive Number, a demand rate or other ugens returning power values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of power and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 1.

mul

Used for processing the buffer signal according to the formula: sig ** power * mul + add per half waveset. Must be a Number, a demand rate or other ugens returning mul values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of mul and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 1.

add

Used for processing the buffer signal according to the formula: sig ** power * mul + add per half waveset. Must be a Number, a demand rate or other ugens returning add values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of add and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 0.

rate

Determines the playback rate per half waveset together with rateMul. Must be a positive Number, a demand rate or other ugens returning rate values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of rate and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. In contrast to other args combinations of demand rate and normal ugens are not valid for implementational reasons. Though you can pass a demand rate ugen here and a normal ugen to rateMul (or vice versa) which are then multiplied per half waveset. Defaults to 1.

rateMul

Determines the playback rate per half waveset together with rate. Must be a positive Number, a demand rate or other ugens returning rateMul values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of rateMul and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. In contrast to other args combinations of demand rate and normal ugens are not valid for implementational reasons. Though you can pass a normal ugen here and a demand rate ugen to rate (or vice versa) which are then multiplied per half waveset. Defaults to 1.

dir

Determines the playback direction of half wavesets. Must be +1 or -1, a demand rate or other ugens returning dir values or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of dir and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. In contrast to other args combinations of demand rate and normal ugens are not valid. Defaults to 1.

interpl

Determines the interpolation type for the BufRd ugens. Must equal 1 (no), 2 (linear) or 4 (cubic) or a SequenceableCollection of these numbers. Defaults to 4.

dUniqueBufSize

Determines the buffer size for Dunique objects which have to be used in the case of demand rate ugens passed to rate, dir or bufMix. See Ex. 2. Must be an Integer or a SequenceableCollection of Integers. Defaults to 1048576.

length

Determines the number of triggers before release of the overall asr envelope. Can be a Sequenceable Collection too. Overruled by maxTime if this is reached before. Defaults to inf.

maxTime

Determines the time before release of the overall asr envelope. Can be a Sequenceable Collection too. Overruled by length if this is reached before. Defaults to inf.

att

Attack time of overall asr envelope or SequenceableCollection thereof. Defaults to 0.

rel

Release time of overall asr envelope or SequenceableCollection thereof. Defaults to 0.

curve

Curve of overall asr envelope or SequenceableCollection thereof. Defaults to -4.

doneAction

Done action of overall asr envelope or SequenceableCollection thereof. Defaults to 0.

Examples

 

Ex. 1: Basic usage

 

Ex. 2: The 'rate' and 'dir' args

 

Ex. 3: Passing ordinary UGens as args

 

Ex. 4: Multichannel usage and the 'bufMix' arg

 

Ex. 5: The overall envelope

 

Ex. 6: Simultaneous writing and reading

 

Ex. 7: Adjusting zero crossings

 

Ex. 8: Granulation with movement through a buffer

See Buffer_Granulation: Ex.1g

 

Ex. 9: Smooth concatenation of adjacent wavesets

 

Ex. 10: Smooth concatenation of adjacent segments restricted by turning points resp. local minima or maxima