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

TZeroXBufRd
ExtensionExtension

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

Description

TZeroXBufRd is for triggering possibly overlapped 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 consecutive reading of segments between zero crossings see ZeroXBufRd. 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. 1 and ZeroXBufRd: Ex. 7.
NOTE: Demand rate UGens in ZeroXBufRd / TZeroXBufRd must 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: The distance between triggers must remain above control duration, otherwise the synthesis fails. For faster trigerring you'd have to use the server with a lower blocksize.
NOTE: As triggered half wavesets can overlap you'd have to care for a sufficiently large 'overlapSIze' arg. See Ex. 3 for possible estimations.
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.

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 TZeroXBufRd 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. If bufMix equals nil (default) the size of the returned signal equals the size of sndBuf, otherwise it equals its own size.

trig

A trigger signal for starting new half waveset groups.

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.

xNum

Determining the number of half wavesets starting at zeroX, a demand rate or other ugens returning these numbers or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of xNum and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 1.

xRep

Determining the number of repetitions of half wavesets resp. half waveset groups (given by xNum) starting at zeroX, a demand rate or other ugens returning these numbers or a SequenceableCollection of such. If in this case the overall multichannel size determined by sndBuf or bufMix is larger than the size of xRep and the latter contains demand rate ugens, they must all be wrapped into Functions for being used more than once. Defaults to 1.

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. 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. 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.

overlapSize

Determines the maximum overlap of half waveset groups. This is a fixed number or a SequenceableCollection thereof determining the size of internally used multichannel signals for overlappings. If this number is too low the synthesis fails. See Ex.3 for estimating a sufficiently large value. Defaults to 10.

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

See also the examples of ZeroXBufRd help. Most features work in the same way, this help file focusses rather on the differences.

 

Ex. 1: Basic usage

 

Ex. 2: The 'xNum' and 'xRep' args

 

Ex. 3: The 'overlapSize' arg

 

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

 

Ex. 5: The overall envelope

 

Ex. 6: Simultaneous writing and reading

 

Ex. 7: Granulation with movement through a buffer

See Buffer_Granulation: Ex.1h

 

Ex. 8: Pulsar synthesis with envelopes, variable number of source and envelope half wavesets

 

Ex. 9: Layers of pulsar streams