level(...) and xfade(...) --- A Fader for Each Sound
Every sound has a fader, named as the sound is. level() moves it --
at once, or over beats, along a curve -- and xfade() moves two at
once, one down and one up. The sound keeps running at any level: bring it
back with another level(). (hush() is the one that stops it.)
Syntax
level(NAME, TO, BEATS, CURVE) level([NAME, NAME], TO, BEATS) level(all, TO, BEATS) xfade(FROM_NAME, TO_NAME, BEATS, CURVE)
Parameters
| param | required | description |
|---|---|---|
| names | ✔ | The sound's uid (noise), a list ([noise, bass]), or all (every sound playing, and every one given a level before). Or uid: with one or a list. |
| to | ✖ | The level: 1 as the sound was written (its own amp), 0 silent, up to 2. Second positional, or to:. 1 if left out. |
| beats | ✖ | How long the move takes; 0 or left out: at once. Third positional, or dur:. |
| curve | ✖ | lin (the default), exp2, exp3, exp4, log, sqrt -- the curves of follow(), bent so the quiet end lasts: exp3 falls fast and lingers low going down, and starts slowly coming up, as fades are heard. Or curve:. |
For xfade, the first sound goes to 0 and the second to 1 over the
beats (4 if left out). Without a curve the two cross at equal power,
so the middle does not dip.
Examples
level(noise, 0, 12) noise fades out over 12 beats and keeps running level(noise, 1, 4) ... and back level([noise, bass], 0.5, 8, exp3) two at once, along a curve level(all, 0, 24, exp3) the end of the piece
A level going up on a sound not yet heard fades it in from silence -- the line and the level together, in either order:
synth(uid:noise, wave:pink, amp:1) level(noise, 1, 12, exp3) noise fades in over 12 beats
Run before the sound, level() waits for it to start: not a moment of it
is heard before the fade. Run just after (within half a second, with no
voice of it playing before), it takes the fader to 0 and brings it up from
there -- but the sound has started at its own level, and that moment is
heard. So in a #$ block, or with Ctrl+Shift+Enter, the console runs a
level() that fades in before the other lines, wherever it is written. Run
line by line, run the level() first. On a sound that has been playing, it
moves the fader from where it is, as always.
A sound can also start silent, to be crossfaded in later:
level(bass, 0) synth(uid:bass, wave:saw, freq:Pwhite(40, 90), dur:0.25) xfade(noise, bass, 8)
Notes
- The fader belongs to the name: a poly synth's voices, a pool's grains, and the voice a line run again makes all go through it.
hush()stops sounds and puts their faders back to 1, so the next sound of that name is heard.vu()reads after the fader: a sound at level 0 shows silent.- The fader is on the signal bus as
NAME.fader, so what is drawn can fade with it:gui(noise, opacity:follow(noise.fader)), or anything else that follows,bass > scale(follow(bass.fader, 0.5, 1)). - The level multiplies the sound's own
amp, which still changes as written (patterns,follow()).
Solo — solo()
Everything cut but one sound, as a musical event: the wall of noise drops and a single sine is left alone, then the wall slams back.
solo(sine) everything else cut, now solo(sine, 4) for 4 beats, then everything back solo(sine, 4, quant:4) the cut on the next bar, back 4 beats later solo(sine, 4, boost:2) the sine twice as loud while it is alone solo(sine, 4, fade:2) a duck over 2 beats instead of a cut solo(sine, 0.5, trig:every(16, beat.hit)) a half-beat hole every 16 beats synth(uid:sine, ..., trig:wait) the sine waits for its solo: run with its block, silent solo([sine, kick], 2) several -- or a group solo(off) all back now (and a trig: solo no longer comes round)
- The others drop in 5 ms -- a cut, not a click -- and come back the same
way, each to where its own fader was:
solo()never moves alevel(). Their reverb and echoes are cut with them. - A soloed sound that is not playing is started from the line it was last run with, at the cut, and goes again when the solo ends: it is there only for the hole -- from the line written for it in the console (or the one it was last run with): it need not have been run.
- A bus goes with what is in it. A soloed sound going through
bus:roomkeeps the room open (its reverb is how it is heard);solo(room)keeps what goes into the room, and cuts the rest. Run its line yourself -- during the solo or after -- and it is yours: it plays on, as you run it. A solo run again before the last one has ended (by hand, or atrig:coming round sooner than its length) takes it over: it goes when the new one ends. boost:(0 .. 4) is the soloed sound's level while it is alone -- against a heavy wall, a sine at its own level can feel small.- Times are beats;
quant:puts the cut on the grid like a synth's. - A sound started during a solo starts silent and comes in with the rest.
See also
Tip: use ← → or ↑ ↓ to navigate the docs