/ Examples / Control / CCSampler

Projects .. AudioIO .. Control
NoteStreams .. Instruments
Filters .. Effects .. LiCK Effects
Plot .. Utility .. Pure ChucK


Wherein we demonstrate the generation of control signals with CCSampler.

Right-click to copy this example to your workspace

CCSampler is used in a variety of settings to generate control signals to drive behavior of other nodes. It is also a handy diagnostic tool since it has built-in support for Graphical Plotting. CCSampler is a sibling of CCGenerator. It samples arbitrary signals while CCGenerator samples simple mathematical functions.

One application of CCSampler is to perform effects that rely on Side-Chaining.

Here's our graph, CCSampler.chg.

Player0 is responsible for providing regular beats to the kick drum sound found in the SoundBuf Inst node. The pattern is quite simple and easy to express with AbcSequencer. Player1 delivers rapid arpeggiated notes produced by the Scale node.

The goal of this example is to attenuate the fluttery square wave whenever the kick drum sounds. We accomplish by routing the output of SoundBuf Inst through Low Pass and into the CCSampler. From there, the control signal dBGain is sent to Chan1 and has the effect of produce low numbers where the kick is active and high numbers where it's silent. This inversion of the natural order of things occurs in the Remapper via these settings:

As we see, the input signal range is expected to be quite small. CCSampler is running in RMS mode meaning that the results are averaged over the FFT sample period to produce signal values usually between 0 and 1. Inspection of the plot window revealed that the peak RMS value of this signal was around .04. The remapper takes that input range then inverts on an output of 1 to .4. You can play with the OutputMax value to increase or reduce the effect. For example, if we set it to .9 the maximum amount o attenuation is (1 - .9) or 10%. Here's the plot with the remapping above.

The region where we see the flatline is where the arpegiattor comes through cleanly. Elsewhere we attentuate by the bumpy kick. The attenuation value is delivered to Chan1 under the name dbGain. This CC is known to the Channel node and signals the intent that the [0-1] CC value range be interpretted in perceptual space and that it be mapped to signal values.

home .. topics .. interface .. reference .. examples .. tipjar