├── .github └── workflows │ └── ci.yml ├── .gitlab-ci.yml ├── .hlint.yaml ├── Help ├── Graph │ ├── adc-bit-reduction.hs │ ├── adc-down-sample.hs │ ├── adc-kabelscahden.hs │ ├── adc-shepard-tones.hs │ ├── bb-microhelix.hs │ ├── cr-lucier.hs │ ├── dm-shift-register.hs │ ├── ds-sos-bell.hs │ ├── es-tw-570012853274615808.hs │ ├── f0-1-4Q6-p.hs │ ├── f0-2012-04-19.hs │ ├── f0-pkt-00.hs │ ├── f0-pkt-07.hs │ ├── f0-pkt-26.hs │ ├── f0-pkt-28.hs │ ├── f0-red-frik.hs │ ├── f0-tw-0454598285861617665.hs │ ├── f0-tw-0456384156159574016.hs │ ├── f0-tw-0839296011982024704.hs │ ├── f0-tw-1105496695637454848.hs │ ├── f0-tw-1125557217086857216.hs │ ├── f0-tw-1136928201886904320.hs │ ├── f0-tw-1138498427241861122.hs │ ├── f0-tw-1210118661022867458.hs │ ├── f0-tw-1254441448327479299.hs │ ├── f0-tw-1338987643057688579.hs │ ├── f0-tw-1343283697840226307.hs │ ├── f0-tw-1367808902457397250.hs │ ├── f0-tw-15eN.hs │ ├── f0-tw0011.hs │ ├── f0-tw0014.hs │ ├── f0-tw0020.hs │ ├── f0-tw0028.hs │ ├── f0-tw0030.hs │ ├── f0-tw0033.hs │ ├── f0-tw0041.hs │ ├── f0-tw0045.hs │ ├── f0-tw0049.hs │ ├── f0-tw0051.hs │ ├── f0-tw0077.hs │ ├── f0-tw0084.hs │ ├── f0-tw0120.hs │ ├── f0-tw0121.hs │ ├── f0-tw0125.hs │ ├── f0-tw0134.hs │ ├── f0-tw0220.hs │ ├── f0-tw0224.hs │ ├── f0-tw0225.hs │ ├── jar-1-4Qx.hs │ ├── jar-rk_20120422.hs │ ├── jh-4157.hs │ ├── jl-1-9.hs │ ├── jl-bitwise.hs │ ├── jl-dark-sea-horns.hs │ ├── jl-jl-1-Z.hs │ ├── jl-pwm-crossfade.hs │ ├── jl-rain-thunder.hs │ ├── jmcc-aleatoric-quartet.hs │ ├── jmcc-alien-froggies.hs │ ├── jmcc-alien-meadow.hs │ ├── jmcc-analog-bubbles-mouse.hs │ ├── jmcc-analog-bubbles.hs │ ├── jmcc-analogue-daze.hs │ ├── jmcc-babbling-brook.hs │ ├── jmcc-bach-prelude.hs │ ├── jmcc-berlin-1977.hs │ ├── jmcc-birdies.hs │ ├── jmcc-birds.hs │ ├── jmcc-blips.hs │ ├── jmcc-bouncing-objects.hs │ ├── jmcc-bowed-string.hs │ ├── jmcc-clustered-sines.hs │ ├── jmcc-coolant.hs │ ├── jmcc-cymbalism-accelerando.hs │ ├── jmcc-cymbalism.hs │ ├── jmcc-data-space.hs │ ├── jmcc-deep-trip.hs │ ├── jmcc-demanding-studies.hs │ ├── jmcc-filter-input.hs │ ├── jmcc-harmonic-swimming.hs │ ├── jmcc-harmonic-tumbling.hs │ ├── jmcc-hell-is-busy.hs │ ├── jmcc-impulse-sequencer.hs │ ├── jmcc-landon-rose.hs │ ├── jmcc-lfo-modulation.hs │ ├── jmcc-lots-o-sines.hs │ ├── jmcc-metal-plate.hs │ ├── jmcc-modal-space.hs │ ├── jmcc-moto-rev.hs │ ├── jmcc-narrow-band-filtered-crackle-noise.hs │ ├── jmcc-noise-burst-sweep.hs │ ├── jmcc-phase-modulation.hs │ ├── jmcc-plucked-strings.hs │ ├── jmcc-police-state.hs │ ├── jmcc-pond-life.hs │ ├── jmcc-pulsing-bottles.hs │ ├── jmcc-rails.hs │ ├── jmcc-random-panning-sines.hs │ ├── jmcc-random-pulsations.hs │ ├── jmcc-random-sine-waves.hs │ ├── jmcc-resonant-dust.hs │ ├── jmcc-resonators-harmonic-series.hs │ ├── jmcc-reverberated-sine-percussion.hs │ ├── jmcc-ring-modulated-klank.hs │ ├── jmcc-sample-and-hold-liquidities.hs │ ├── jmcc-saucer-base.hs │ ├── jmcc-sawed-cymbals.hs │ ├── jmcc-scratchy.hs │ ├── jmcc-sidereal-time.hs │ ├── jmcc-snare-909.hs │ ├── jmcc-spe.hs │ ├── jmcc-sprinkler-mouse.hs │ ├── jmcc-sprinkler.hs │ ├── jmcc-strummable-guitar.hs │ ├── jmcc-strummable-silk.hs │ ├── jmcc-sweepy-noise.hs │ ├── jmcc-swept-resonant-noise.hs │ ├── jmcc-synthetic-piano.hs │ ├── jmcc-tank.hs │ ├── jmcc-theremin.hs │ ├── jmcc-tremulate.hs │ ├── jmcc-uplink.hs │ ├── jmcc-what-was-i-thinking.hs │ ├── jmcc-why-supercollider.hs │ ├── jmcc-wind-metals.hs │ ├── jmcc-zizle.hs │ ├── jp-record-scratcher.hs │ ├── ljp-one-line.hs │ ├── lkp-chaos-engine.hs │ ├── mn-k2ws.hs │ ├── mp-rm-octaver.hs │ ├── my-mouse.hs │ ├── np-pebble-beach.hs │ ├── nv-ml-2014-06-03.hs │ ├── nv-tw-01.hs │ ├── nv-tw-2013-01-11.hs │ ├── nv-tw-2013-12-04.hs │ ├── nv-tw-2014-02-21.hs │ ├── nv-tw-40.hs │ ├── nv-tw-41.hs │ ├── nv-tw-43.hs │ ├── nv-tw-52.hs │ ├── or-gong.hs │ ├── pc-thx.hs │ ├── pj-forest-sounds-m.hs │ ├── pmi.hs │ ├── rb-hh-808.hs │ ├── rd-20060909.hs │ ├── rd-20060910.hs │ ├── rd-20060911.hs │ ├── rd-20060914.hs │ ├── rd-20060918.hs │ ├── rd-20060921.hs │ ├── rd-20060925.hs │ ├── rd-20060928.hs │ ├── rd-20061007.hs │ ├── rd-20061008.hs │ ├── rd-20061015.hs │ ├── rd-20061017.hs │ ├── rd-20061022.hs │ ├── rd-20061028.hs │ ├── rd-20061030.hs │ ├── rd-20070423.hs │ ├── rd-lg-timed.hs │ ├── rd-tgrn.hs │ ├── rd-trmlo.hs │ ├── sc-bottle-m.hs │ ├── sp-insects-m.hs │ ├── tb-1-4Tw.hs │ ├── tm-drummer.hs │ ├── tm-tw-463992770596577280.hs │ ├── tw-tw-01.hs │ ├── tw-tw-02.hs │ ├── unk-laser-bubble.hs │ ├── unk-m21360.hs │ ├── unk-no-input-fft.hs │ ├── unk-sin-gliss.hs │ └── unk-train.hs ├── Notes │ ├── mul-add.help.hs │ ├── overloaded-lists.text │ ├── sample-accuracy.help.hs │ └── signal-effect-group.help.hs ├── Nrt │ ├── nrt.01.scd │ └── nrt.02.hs ├── README ├── Server │ ├── b_alloc.help.hs │ ├── b_allocRead.help.hs │ ├── b_allocReadChannel.help.hs │ ├── b_close.help.hs │ ├── b_fill.help.hs │ ├── b_free.help.hs │ ├── b_gen.help.hs │ ├── b_get.help.hs │ ├── b_getn.help.hs │ ├── b_info.help.hs │ ├── b_query.help.hs │ ├── b_read.help.hs │ ├── b_readChannel.help.hs │ ├── b_set.help.hs │ ├── b_setn.help.hs │ ├── b_write.help.hs │ ├── b_zero.help.hs │ ├── c_fill.help.hs │ ├── c_get.help.hs │ ├── c_getn.help.hs │ ├── c_set.help.hs │ ├── c_setn.help.hs │ ├── clearSched.help.hs │ ├── d_free.help.hs │ ├── d_load.help.hs │ ├── d_loadDir.help.hs │ ├── d_recv.help.hs │ ├── dumpOSC.help.hs │ ├── g_deepFree.help.hs │ ├── g_freeAll.help.hs │ ├── g_head.help.hs │ ├── g_new.help.hs │ ├── g_queryTree.help.hs │ ├── g_tail.help.hs │ ├── n_after.help.hs │ ├── n_before.help.hs │ ├── n_fill.help.hs │ ├── n_free.help.hs │ ├── n_map.help.hs │ ├── n_mapn.help.hs │ ├── n_query.help.hs │ ├── n_run.help.hs │ ├── n_set.help.hs │ ├── n_setn.help.hs │ ├── n_trace.help.hs │ ├── notify.help.hs │ ├── quit.help.hs │ ├── s_get.help.hs │ ├── s_getn.help.hs │ ├── s_new.help.hs │ ├── s_noid.help.hs │ ├── status.help.hs │ ├── sync.help.hs │ ├── tr.help.hs │ └── u_cmd.help.hs ├── Svg │ ├── blip.0.svg │ ├── blip.1.svg │ ├── brownNoise.0.svg │ ├── brownNoise.1.svg │ ├── cOsc.0.svg │ ├── clipNoise.0.svg │ ├── crackle.0.svg │ ├── crackle.1.svg │ ├── decay.0.svg │ ├── decay2.0.svg │ ├── decay2.1.svg │ ├── dust.0.svg │ ├── dust.1.svg │ ├── dust2.0.svg │ ├── dust2.1.svg │ ├── grayNoise.0.svg │ ├── grayNoise.1.svg │ ├── henonN.0.svg │ ├── integrator.0.svg │ ├── lfClipNoise.0.svg │ ├── lfCub.0.svg │ ├── lfCub.1.svg │ ├── lfGauss.0.svg │ ├── lfGauss.1.svg │ ├── lfGauss.2.svg │ ├── lfGauss.3.svg │ ├── lfNoise0.0.svg │ ├── lfNoise0.1.svg │ ├── lfNoise0.2.svg │ ├── lfNoise2.0.svg │ ├── lfPulse.0.svg │ ├── lfSaw.0.svg │ ├── lfSaw.1.svg │ ├── lfTri.0.svg │ ├── lfTri.1.svg │ ├── lfdNoise0.0.svg │ ├── lfdNoise0.1.svg │ ├── lfdNoise0.2.svg │ ├── lfdNoise3.0.svg │ ├── pinkNoise.0.svg │ ├── pinkNoise.1.svg │ ├── saw.0.svg │ ├── saw.1.svg │ ├── shaper.0.svg │ ├── shaper.1.svg │ ├── shaper.2.svg │ ├── shaper.3.svg │ ├── slew.0.svg │ ├── slew.1.svg │ ├── slew.2.svg │ ├── slope.0.svg │ ├── whiteNoise.0.svg │ ├── whiteNoise.1.svg │ └── whiteNoise.2.svg └── Ugen │ ├── abs.help.hs │ ├── absDif.help.hs │ ├── acos.help.hs │ ├── add.help.hs │ ├── allpassC.help.hs │ ├── allpassL.help.hs │ ├── allpassN.help.hs │ ├── amClip.help.hs │ ├── ampComp.help.hs │ ├── ampDb.help.hs │ ├── amplitude.help.hs │ ├── analogBassDrum.help.hs │ ├── analogPhaser.help.hs │ ├── analogPhaserMod.help.hs │ ├── analogSnareDrum.help.hs │ ├── analogTape.help.hs │ ├── analogVintageDistortion.help.hs │ ├── arrayMax.help.hs │ ├── arrayMin.help.hs │ ├── asin.help.hs │ ├── atan.help.hs │ ├── atan2.help.hs │ ├── atari2600.help.hs │ ├── atsNoiSynth.help.lhs │ ├── atsSynth.help.lhs │ ├── audioMSG.help.hs │ ├── ay.help.hs │ ├── bAllPass.help.hs │ ├── bBandPass.help.hs │ ├── bBandStop.help.hs │ ├── bGen.help.hs │ ├── bHiPass.help.hs │ ├── bHiPass4.help.hs │ ├── bHiShelf.help.hs │ ├── bLowPass.help.hs │ ├── bLowPass4.help.hs │ ├── bLowShelf.help.hs │ ├── bMoog.help.hs │ ├── bPeakEQ.help.hs │ ├── balance2.help.hs │ ├── beatTrack.help.hs │ ├── bezier.help.hs │ ├── blOsc.help.hs │ ├── blip.help.hs │ ├── blitB3.help.hs │ ├── blitB3Saw.help.hs │ ├── blitB3Square.help.hs │ ├── blitB3Tri.help.hs │ ├── blockSize.help.hs │ ├── bpf.help.hs │ ├── bpz2.help.hs │ ├── brf.help.hs │ ├── brownNoise.help.hs │ ├── brz2.help.hs │ ├── bufAllpassC.help.hs │ ├── bufAllpassL.help.hs │ ├── bufAllpassN.help.hs │ ├── bufChannels.help.hs │ ├── bufCombC.help.hs │ ├── bufCombL.help.hs │ ├── bufCombN.help.hs │ ├── bufDelayC.help.hs │ ├── bufDelayL.help.hs │ ├── bufDelayN.help.hs │ ├── bufDur.help.hs │ ├── bufFrames.help.hs │ ├── bufGrain.help.hs │ ├── bufRateScale.help.hs │ ├── bufRd.help.hs │ ├── bufSampleRate.help.hs │ ├── bufWr.help.hs │ ├── cOsc.help.hs │ ├── changed.help.hs │ ├── checkBadValues.help.hs │ ├── chen.help.hs │ ├── choose.help.hs │ ├── chromagram.help.hs │ ├── circleRamp.help.hs │ ├── clearBuf.help.hs │ ├── clip.help.hs │ ├── clip2.help.hs │ ├── clipNoise.help.hs │ ├── coinGate.help.hs │ ├── combC.help.hs │ ├── combL.help.hs │ ├── combN.help.hs │ ├── compander.help.hs │ ├── complexRes.help.hs │ ├── concat.help.hs │ ├── control.hs │ ├── controlDur.help.hs │ ├── controlRate.help.hs │ ├── convolution.help.hs │ ├── cos.help.hs │ ├── cosh.help.hs │ ├── coyote.help.hs │ ├── crackle.help.hs │ ├── crest.help.hs │ ├── crossoverDistortion.help.hs │ ├── ctl8Voicer.help.hs │ ├── cuspL.help.hs │ ├── cuspN.help.hs │ ├── dNoiseRing.help.hs │ ├── dbAmp.help.hs │ ├── dbrown.help.hs │ ├── dbufrd.help.hs │ ├── dbufwr.help.hs │ ├── dc.help.hs │ ├── dconst.help.hs │ ├── decay.help.hs │ ├── decay2.help.hs │ ├── decodeB2.help.lhs │ ├── degreeToKey.help.hs │ ├── delTapWr.help.hs │ ├── delay1.help.hs │ ├── delay2.help.hs │ ├── delayC.help.hs │ ├── delayL.help.hs │ ├── delayN.help.hs │ ├── demand.help.hs │ ├── demandEnvGen.help.hs │ ├── detectIndex.help.hs │ ├── detectSilence.help.hs │ ├── dfm1.help.hs │ ├── dgeom.help.hs │ ├── dibrown.help.hs │ ├── difSqr.help.hs │ ├── diodeRingMod.help.hs │ ├── disintegrator.help.hs │ ├── diskIn.help.hs │ ├── diskOut.help.lhs │ ├── distort.help.hs │ ├── div.help.hs │ ├── diwhite.help.hs │ ├── dneuromodule.help.hs │ ├── done.help.hs │ ├── doubleWell3.help.hs │ ├── dpw3Tri.help.hs │ ├── dpw4Saw.help.hs │ ├── drand.help.hs │ ├── dseq.help.hs │ ├── dser.help.hs │ ├── dseries.help.hs │ ├── dshuf.help.hs │ ├── dstutter.help.hs │ ├── dswitch.help.hs │ ├── dswitch1.help.hs │ ├── dust.help.hs │ ├── dust2.help.hs │ ├── dustRange.help.hs │ ├── duty.help.hs │ ├── dwgBowed.help.hs │ ├── dwgBowedTor.help.hs │ ├── dwgClarinet3.help.hs │ ├── dwgFlute.help.hs │ ├── dwgPlucked2.help.hs │ ├── dwgPluckedStiff.help.hs │ ├── dwgSoundBoard.help.hs │ ├── dwhite.help.hs │ ├── dwrand.help.hs │ ├── dwt.help.lhs │ ├── dx7.help.hs │ ├── dxrand.help.hs │ ├── dynKlang.help.hs │ ├── dynKlank.help.hs │ ├── envAdsr.help.hs │ ├── envAsr.help.hs │ ├── envCoord.help.hs │ ├── envDetect.help.hs │ ├── envFollow.help.hs │ ├── envGate.help.hs │ ├── envGen.help.hs │ ├── envLinen.help.hs │ ├── envPairs.help.hs │ ├── envPerc.help.hs │ ├── envSine.help.hs │ ├── envStep.help.hs │ ├── envTrapezoid.help.hs │ ├── envTriangle.help.hs │ ├── envXyc.help.hs │ ├── equal_to.help.hs │ ├── eventVoicer.help.hs │ ├── excess.help.hs │ ├── expRand.help.hs │ ├── expRandN.help.hs │ ├── fSinOsc.help.hs │ ├── fbSineC.help.hs │ ├── fbSineL.help.hs │ ├── fbSineN.help.hs │ ├── fdiv.help.hs │ ├── fft.help.hs │ ├── fftTrigger.help.hs │ ├── fm7.help.hs │ ├── fmGrain.help.hs │ ├── fmGrainB.help.hs │ ├── fold2.help.hs │ ├── formant.help.hs │ ├── formlet.help.hs │ ├── fos.help.hs │ ├── frac.help.hs │ ├── free.help.hs │ ├── freeSelf.help.hs │ ├── freeSelfWhenDone.help.hs │ ├── freeVerb.help.hs │ ├── freezer.help.hs │ ├── freqShift.help.hs │ ├── friction.help.hs │ ├── gVerb.help.hs │ ├── gammatone.help.hs │ ├── gate.help.hs │ ├── gateReset.help.hs │ ├── gaussTrig.help.hs │ ├── gbmanL.help.hs │ ├── gbmanN.help.hs │ ├── gcd.help.hs │ ├── gendy1.help.hs │ ├── grainBuf.help.hs │ ├── grainFM.help.hs │ ├── grainIn.help.hs │ ├── grainSin.help.hs │ ├── grayNoise.help.hs │ ├── greater_than.help.hs │ ├── greyholeRaw.help.hs │ ├── hairCell.help.hs │ ├── harmonicOsc.help.hs │ ├── hasher.help.hs │ ├── henonC.help.hs │ ├── henonL.help.hs │ ├── henonN.help.hs │ ├── hilbert.help.hs │ ├── hilbertFIR.help.hs │ ├── hpf.help.hs │ ├── hpz1.help.hs │ ├── hpz2.help.hs │ ├── hypot.help.hs │ ├── iEnvGen.help.hs │ ├── iRand.help.hs │ ├── iRandN.help.hs │ ├── idwt.help.lhs │ ├── ifft.help.hs │ ├── iirFilter.help.hs │ ├── impulse.help.hs │ ├── in.help.hs │ ├── inFeedback.help.hs │ ├── inRange.help.hs │ ├── inTrig.help.hs │ ├── index.help.hs │ ├── indexInBetween.help.hs │ ├── indexL.help.hs │ ├── integrator.help.hs │ ├── ix.md │ ├── jPverbRaw.help.hs │ ├── k2a.help.hs │ ├── keyState.help.hs │ ├── keyTrack.help.hs │ ├── klang.help.hs │ ├── klank.help.hs │ ├── ladspa.help.hs │ ├── lag.help.hs │ ├── lag2.help.hs │ ├── lag3.help.hs │ ├── lagIn.help.hs │ ├── lagUD.help.hs │ ├── lastValue.help.hs │ ├── latch.help.hs │ ├── latoocarfianC.help.hs │ ├── lcm.help.hs │ ├── leakDC.help.hs │ ├── lfBrownNoise0.help.hs │ ├── lfBrownNoise2.help.hs │ ├── lfClipNoise.help.hs │ ├── lfCub.help.hs │ ├── lfGauss.help.hs │ ├── lfNoise0.help.hs │ ├── lfNoise1.help.hs │ ├── lfNoise2.help.hs │ ├── lfPar.help.hs │ ├── lfPulse.help.hs │ ├── lfSaw.help.hs │ ├── lfTri.help.hs │ ├── lfdClipNoise.help.hs │ ├── lfdNoise0.help.hs │ ├── lfdNoise1.help.hs │ ├── lfdNoise3.help.hs │ ├── limiter.help.hs │ ├── linCongC.help.hs │ ├── linCongL.help.hs │ ├── linCongN.help.hs │ ├── linExp.help.hs │ ├── linLin.help.hs │ ├── linPan2.help.hs │ ├── linRand.help.hs │ ├── linXFade2.help.hs │ ├── line.help.hs │ ├── linen.help.hs │ ├── localBuf.help.hs │ ├── localIn.help.hs │ ├── localOut.help.hs │ ├── log.help.hs │ ├── logistic.help.hs │ ├── loopBuf.help.hs │ ├── lorenzL.help.hs │ ├── lorenzTrig.help.hs │ ├── lores.help.hs │ ├── loudness.help.hs │ ├── lpcAnalyzer.help.hs │ ├── lpcSynth.help.lhs │ ├── lpcVals.help.lhs │ ├── lpf.help.hs │ ├── lpg.help.hs │ ├── lpz1.help.hs │ ├── lpz2.help.hs │ ├── lti.help.hs │ ├── mantissaMask.help.hs │ ├── max.help.hs │ ├── mce.help.hs │ ├── mdaPiano.help.hs │ ├── meddis.help.hs │ ├── median.help.hs │ ├── membraneCircle.help.hs │ ├── membraneHexagon.help.hs │ ├── metro.help.hs │ ├── miBraids.help.hs │ ├── miClouds.help.hs │ ├── miElements.help.hs │ ├── miOmi.help.hs │ ├── miPlaits.help.hs │ ├── miRings.help.hs │ ├── miRipples.help.hs │ ├── miTides.help.hs │ ├── miVerb.help.hs │ ├── midEQ.help.hs │ ├── midiCPS.help.hs │ ├── min.help.hs │ ├── mix.help.hs │ ├── mod.help.hs │ ├── modDif.help.hs │ ├── monoGrain.help.hs │ ├── moogFF.help.hs │ ├── moogLadder.help.hs │ ├── moogVCF.help.hs │ ├── mostChange.help.hs │ ├── mouseButton.help.hs │ ├── mouseX.help.hs │ ├── mouseY.help.hs │ ├── mrg2.help.hs │ ├── mul.help.hs │ ├── mulAdd.help.hs │ ├── mzPokey.help.lhs │ ├── nRand.help.hs │ ├── neg.help.hs │ ├── neoFormant.help.hs │ ├── nestedAllpassC.help.hs │ ├── nhHall.help.hs │ ├── nodeId.help.hs │ ├── normalizer.help.hs │ ├── numAudioBuses.help.lhs │ ├── numBuffers.help.hs │ ├── numControlBuses.help.lhs │ ├── numInputBuses.help.lhs │ ├── numOutputBuses.help.lhs │ ├── numRunningSynths.help.hs │ ├── obxdFilter.help.hs │ ├── offsetOut.help.hs │ ├── onePole.help.hs │ ├── oneZero.help.hs │ ├── onsets.help.hs │ ├── osc.help.hs │ ├── osc1.help.hs │ ├── oscN.help.hs │ ├── oteyPianoStrings.help.hs │ ├── oteySoundBoard.help.hs │ ├── out.help.hs │ ├── packFFT.help.hs │ ├── pan2.help.hs │ ├── panAz.help.hs │ ├── partConv.help.lhs │ ├── pause.help.hs │ ├── pauseSelf.help.hs │ ├── pauseSelfWhenDone.help.hs │ ├── peak.help.hs │ ├── peakFollower.help.hs │ ├── perlin3.help.hs │ ├── phasor.help.hs │ ├── phasorModal.help.hs │ ├── pinkNoise.help.hs │ ├── pitch.help.hs │ ├── pitchShift.help.hs │ ├── playBuf.help.hs │ ├── playBufCF.help.hs │ ├── pluck.help.hs │ ├── pmOsc.help.hs │ ├── poll.help.hs │ ├── pow.help.hs │ ├── pulse.help.hs │ ├── pulseCount.help.hs │ ├── pulseDPW.help.hs │ ├── pulseDivider.help.hs │ ├── pv_BinBufRd.help.hs │ ├── pv_BinDelay.help.lhs │ ├── pv_BinScramble.help.hs │ ├── pv_BinShift.help.hs │ ├── pv_BinWipe.help.hs │ ├── pv_BrickWall.help.hs │ ├── pv_BufRd.help.hs │ ├── pv_Compander.help.hs │ ├── pv_ConformalMap.help.hs │ ├── pv_Copy.help.lhs │ ├── pv_Diffuser.help.hs │ ├── pv_Freeze.help.hs │ ├── pv_HainsworthFoote.help.hs │ ├── pv_Invert.help.hs │ ├── pv_JensenAndersen.help.hs │ ├── pv_LocalMax.help.hs │ ├── pv_MagAbove.help.hs │ ├── pv_MagBelow.help.hs │ ├── pv_MagClip.help.hs │ ├── pv_MagFreeze.help.hs │ ├── pv_MagGate.help.hs │ ├── pv_MagMap.help.lhs │ ├── pv_MagMul.help.hs │ ├── pv_MagSmear.help.hs │ ├── pv_Morph.help.hs │ ├── pv_Mul.help.hs │ ├── pv_PlayBuf.help.hs │ ├── pv_RandComb.help.hs │ ├── pv_RandWipe.help.hs │ ├── pv_RecordBuf.help.hs │ ├── pv_RectComb.help.hs │ ├── pv_SpectralMap.help.hs │ ├── pv_Split.help.hs │ ├── pv_xFade.help.hs │ ├── pvcollect.help.lhs │ ├── qitch.help.lhs │ ├── quadC.help.hs │ ├── quadL.help.hs │ ├── quadN.help.hs │ ├── rDelayMap.help.hs │ ├── rDelaySet.help.hs │ ├── rDelaySetBuf.help.hs │ ├── rLagC.help.hs │ ├── rLoopSet.help.hs │ ├── rShufflerL.help.hs │ ├── rSmplrIndex.help.hs │ ├── rTracePlay.help.hs │ ├── rTraceRd.help.hs │ ├── radiansPerSample.help.hs │ ├── ramp.help.hs │ ├── rand.help.hs │ ├── rand2.help.hs │ ├── randID.help.lhs │ ├── randN.help.hs │ ├── randSeed.help.hs │ ├── rcd.help.hs │ ├── rdl.help.hs │ ├── rdx7Env.help.hs │ ├── recordBuf.help.hs │ ├── redPhasor.help.hs │ ├── redPhasor2.help.hs │ ├── replaceOut.help.hs │ ├── resonator.help.hs │ ├── resonz.help.hs │ ├── rhpf.help.hs │ ├── ring1.help.hs │ ├── ring2.help.hs │ ├── ring3.help.hs │ ├── ring4.help.hs │ ├── ringz.help.hs │ ├── rlpf.help.hs │ ├── rlpfd.help.hs │ ├── rmShelf.help.hs │ ├── rmeq.help.hs │ ├── rongs.help.hs │ ├── rossler.help.lhs │ ├── rotate2.help.hs │ ├── roundUp.help.hs │ ├── rpvDecayTbl.help.hs │ ├── runningMax.help.hs │ ├── runningMin.help.hs │ ├── runningSum.help.hs │ ├── sampleDur.help.hs │ ├── sampleRate.help.hs │ ├── sanitize.help.hs │ ├── saw.help.hs │ ├── sawDPW.help.hs │ ├── scaleNeg.help.hs │ ├── schmidt.help.hs │ ├── select.help.hs │ ├── selectX.help.hs │ ├── sendReply.help.hs │ ├── sendTrig.help.lhs │ ├── sensoryDissonance.help.hs │ ├── setResetFF.help.hs │ ├── shaper.help.hs │ ├── shufflerB.help.hs │ ├── silent.help.hs │ ├── sin.help.hs │ ├── sinGrain.help.hs │ ├── sinOsc.help.hs │ ├── sinOscFB.help.hs │ ├── sineShaper.help.hs │ ├── sinh.help.hs │ ├── slew.help.hs │ ├── slope.help.hs │ ├── sms.help.hs │ ├── sndfileIn.help.hs │ ├── sndfileRead.help.hs │ ├── softClip.help.hs │ ├── softClipAmp.help.hs │ ├── sonLPC.help.hs │ ├── sortBuf.help.hs │ ├── sos.help.hs │ ├── soundIn.help.hs │ ├── specCentroid.help.hs │ ├── specFlatness.help.hs │ ├── spectralEntropy.help.hs │ ├── splay.help.hs │ ├── spreader.help.hs │ ├── spring.help.hs │ ├── sqrDif.help.hs │ ├── sqrSum.help.hs │ ├── squiz.help.hs │ ├── standard2DL.help.hs │ ├── standardL.help.hs │ ├── stepper.help.hs │ ├── stkBandedWG.help.hs │ ├── stkBowed.help.lhs │ ├── stkFlute.help.lhs │ ├── stkInst.help.hs │ ├── stkMandolin.help.hs │ ├── stkModalBar.help.hs │ ├── stkMoog.help.hs │ ├── stkPluck.help.hs │ ├── stkShakers.help.hs │ ├── streson.help.hs │ ├── stringVoice.help.hs │ ├── sub.help.hs │ ├── subsampleOffset.help.hs │ ├── sum3.help.hs │ ├── sum4.help.hs │ ├── sumSqr.help.hs │ ├── summer.help.hs │ ├── svf.help.hs │ ├── svfBp.help.hs │ ├── svfHp.help.hs │ ├── svfLp.help.hs │ ├── sweep.help.hs │ ├── switchDelay.help.hs │ ├── syncSaw.help.hs │ ├── t2a.help.hs │ ├── t2k.help.hs │ ├── tBall.help.hs │ ├── tBetaRand.help.hs │ ├── tBrownRand.help.hs │ ├── tChoose.help.hs │ ├── tDelay.help.hs │ ├── tDuty.help.hs │ ├── tExpRand.help.hs │ ├── tExpRandN.help.hs │ ├── tGaussRand.help.hs │ ├── tGrains.help.hs │ ├── tLine.help.hs │ ├── tRand.help.hs │ ├── tRandN.help.hs │ ├── tScramble.help.hs │ ├── tWindex.help.hs │ ├── tXLine.help.hs │ ├── tan.help.hs │ ├── tanh.help.hs │ ├── tap.help.hs │ ├── tartini.help.hs │ ├── thresh.help.hs │ ├── tiRand.help.hs │ ├── timer.help.hs │ ├── toggleFF.help.hs │ ├── tpv.help.lhs │ ├── trig.help.hs │ ├── trig1.help.hs │ ├── trigAvg.help.hs │ ├── trigControl.help.hs │ ├── twChoose.help.hs │ ├── twoPole.help.hs │ ├── twoTube.help.hs │ ├── twoZero.help.hs │ ├── vDiskIn.help.hs │ ├── vOsc.help.hs │ ├── vOsc3.help.hs │ ├── varLag.help.hs │ ├── varSaw.help.hs │ ├── varShapeOsc.help.hs │ ├── vbFourses.help.hs │ ├── vbJonVerb.help.hs │ ├── vbSlide.help.hs │ ├── vibrato.help.hs │ ├── vosim.help.hs │ ├── vosimOsc.help.hs │ ├── warp1.help.hs │ ├── waveTerrain.help.lhs │ ├── weaklyNonlinear2.help.hs │ ├── whiteNoise.help.hs │ ├── wrap.help.hs │ ├── wrap2.help.hs │ ├── wrapIndex.help.hs │ ├── wt_FilterScale.help.lhs │ ├── wt_TimeWipe.help.lhs │ ├── xFade2.help.hs │ ├── xLine.help.hs │ ├── xOut.help.hs │ ├── zOsc.help.hs │ ├── zeroCrossing.help.hs │ └── zitaRev.help.hs ├── Makefile ├── README.md ├── Setup.hs ├── Sound ├── Sc3.hs └── Sc3 │ ├── Common.hs │ ├── Common │ ├── Base.hs │ ├── Base │ │ └── System.hs │ ├── Buffer.hs │ ├── Buffer │ │ ├── Array.hs │ │ ├── Gen.hs │ │ └── Vector.hs │ ├── Context.hs │ ├── Enum.hs │ ├── Envelope.hs │ ├── Help.hs │ ├── Help │ │ └── Sc2.hs │ ├── Math.hs │ ├── Math │ │ ├── Filter.hs │ │ ├── Filter │ │ │ └── Beq.hs │ │ ├── Interpolate.hs │ │ ├── Noise.hs │ │ ├── Operator.hs │ │ ├── Warp.hs │ │ └── Window.hs │ ├── Mce.hs │ ├── Monad.hs │ ├── Monad │ │ └── Operators.hs │ ├── Random.hs │ ├── Rate.hs │ ├── SoundFile.hs │ ├── Uid.hs │ └── Unsafe.hs │ ├── Fd.hs │ ├── Hugs.hs │ ├── Server.hs │ ├── Server │ ├── Command.hs │ ├── Command │ │ ├── Completion.hs │ │ ├── Enum.hs │ │ ├── Generic.hs │ │ ├── Plain.hs │ │ └── Plain │ │ │ └── Completion.hs │ ├── Enum.hs │ ├── Fd.hs │ ├── Graphdef.hs │ ├── Graphdef │ │ ├── Binary.hs │ │ ├── Graph.hs │ │ ├── Io.hs │ │ ├── Read.hs │ │ └── Text.hs │ ├── Monad.hs │ ├── Nrt.hs │ ├── Nrt │ │ ├── Edit.hs │ │ ├── Render.hs │ │ ├── Stat.hs │ │ └── Ugen.hs │ ├── Options.hs │ ├── Param.hs │ ├── Recorder.hs │ ├── Scsynth.hs │ ├── Status.hs │ ├── Synthdef.hs │ └── Transport │ │ ├── Fd.hs │ │ └── Monad.hs │ ├── Ugen.hs │ └── Ugen │ ├── Analysis.hs │ ├── Bindings.hs │ ├── Bindings │ ├── Composite.hs │ ├── Composite │ │ └── External.hs │ ├── Db.hs │ ├── Db │ │ └── External.hs │ ├── Hw.hs │ ├── Hw │ │ ├── Construct.hs │ │ ├── External.hs │ │ └── External │ │ │ ├── F0.hs │ │ │ ├── Sc3_Plugins.hs │ │ │ ├── Wavelets.hs │ │ │ └── Zita.hs │ └── Monad.hs │ ├── Bracketed.hs │ ├── Brackets.hs │ ├── Constant.hs │ ├── Control.hs │ ├── Enum.hs │ ├── Envelope.hs │ ├── Event.hs │ ├── Graph.hs │ ├── Graph │ ├── Reconstruct.hs │ └── Transform.hs │ ├── Help │ └── Graph.hs │ ├── Hs.hs │ ├── Label.hs │ ├── Math.hs │ ├── Math │ └── Composite.hs │ ├── Mce.hs │ ├── Mrg.hs │ ├── Name.hs │ ├── Optimise.hs │ ├── Plain.hs │ ├── Pp.hs │ ├── Primitive.hs │ ├── Proxy.hs │ ├── README │ ├── Types.hs │ ├── Ugen.hs │ └── Util.hs ├── cabal.project ├── contrib └── stack.yaml ├── emacs ├── Makefile ├── hsc3-ext.el └── hsc3.el ├── ext └── faust │ ├── Makefile │ └── zitaRev.dsp ├── gen ├── lib-context.hs ├── server-command.hs ├── server-command.text └── ugen-help-index.hs ├── hsc3.cabal ├── lib ├── hsc3-min-imports.hs ├── hsc3-std-extensions.hs └── hsc3-std-imports.hs └── md ├── announce.text ├── drawings.md ├── notes.md └── video.md /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 0 1 * *' 7 | 8 | jobs: 9 | cabal: 10 | runs-on: ubuntu-latest 11 | name: hsc3 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: haskell/actions/setup@v2 15 | - run: cabal update 16 | - run: cabal build 17 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - build 3 | 4 | build:9: 5 | image: haskell:9 6 | stage: build 7 | script: 8 | - cabal update 9 | - cabal build 10 | rules: 11 | - when: manual 12 | 13 | build:8: 14 | image: haskell:8 15 | stage: build 16 | script: 17 | - cabal update 18 | - cabal build 19 | rules: 20 | - when: manual 21 | -------------------------------------------------------------------------------- /.hlint.yaml: -------------------------------------------------------------------------------- 1 | - ignore: {name: Use camelCase} 2 | - ignore: {name: Use guards} 3 | - ignore: {name: Use tuple-section} 4 | - ignore: {name: Use head} 5 | - ignore: {name: Use record patterns} 6 | - ignore: {name: Use list comprehension} 7 | -------------------------------------------------------------------------------- /Help/Graph/adc-down-sample.hs: -------------------------------------------------------------------------------- 1 | -- down sample (adc) 2 | let f = lfNoise2 kr 8 3 | nh = lfNoise2 kr 3 4 | src = blip ar (f * 200 + 300) (nh * 10 + 20) 5 | sr = mouseX kr 1000 (sampleRate * 0.1) Exponential 0.2 6 | in latch src (impulse ar sr 0) * 0.1 7 | 8 | -- down sample (adc) ; id 9 | let f = lfNoise2Id 'α' kr 8 10 | nh = lfNoise2Id 'β' kr 3 11 | src = blip ar (f * 200 + 300) (nh * 10 + 20) 12 | sr = mouseX kr 1000 (sampleRate * 0.1) Exponential 0.2 13 | in latch src (impulse ar sr 0) * 0.1 14 | -------------------------------------------------------------------------------- /Help/Graph/f0-2012-04-19.hs: -------------------------------------------------------------------------------- 1 | -- https://www.listarc.bham.ac.uk/lists/sc-users/msg17536.html (f0) 2 | let s0 = lfSaw ar 10 0 * 0.01 3 | t0 = lfTri ar (mce2 5 6 * 0.1) 0 4 | t1 = lfTri kr 0.1 0 * 0.05 + 0.05 5 | s1 = limiter (brf s0 t0 1) 1 0.01 6 | o = combN s1 0.1 (roundTo t1 0.01) 1 7 | in o * 0.1 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-pkt-00.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/490 (f0) 2 | let sosc fr = sinOsc ar fr 0 3 | f0 = mce3 100 200 300 + sosc (mce3 0.11 0.22 0.33) 4 | ph0 = sosc (mce3 0.1 0.2 0.3) * 2 * pi 5 | a0 = 0.1 + sosc (mce3 0.01 0.02 0.03) * 0.05 6 | i = sinOsc ar f0 ph0 * a0 7 | w = sosc (sosc (sosc 0.13 * 5 + 6) * 8 + 50) 8 | s = splay i w 0.7 (sosc 1.2 * 0.6) True 9 | in mix (mceTranspose (gVerb s 20 5 1 0.5 25 0 1 1 30)) 10 | -------------------------------------------------------------------------------- /Help/Graph/f0-pkt-07.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/490 (f0) 2 | let param n = 3 | let f g z = take n (iterate g z) 4 | in zip4 (f (* 4) 2) (f (/ 2) (1/2)) (f (* 4) 1) (f (* 4) 2) 5 | gen f0 (m,f1,l,r) = sinOsc ar f0 0 * m + linExp (sinOsc ar f1 0) (-1) 1 l r 6 | pkt n = 7 | let c = foldl gen 1 (param n) 8 | o = sinOsc ar c 0 * 0.1 9 | in gVerb (leakDC o 0.995) 16 8 0.75 0.5 15 1 0.7 0.5 16 * 0.1 10 | in pkt 12 11 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-0454598285861617665.hs: -------------------------------------------------------------------------------- 1 | -- https://twitter.com/redFrik/status/454598285861617665 (f0) 2 | let b = mce [9,8 .. 1] 3 | c = lfTri ar (3 ** lfTri ar (1 / b) (b / 9)) 0 4 | d = lfTri ar (1 / b) 0 `modE` 1 / 9 + 0.01 5 | f = 2 ** roundE (lfTri ar (b / 99) 0) * 99 * b 6 | o = grainSin 2 c d f 0 (-1) 512 7 | in splay (tanh o) 1 1 0 True / 2 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-0456384156159574016.hs: -------------------------------------------------------------------------------- 1 | -- https://twitter.com/redFrik/status/456384156159574016 (f0) 2 | let a = 1 / mce [3,12,4,1,6,2] 3 | s = lag3 (sinOsc ar a 0) (abs (sinOsc ar (2.67 ** a) 0)) * 99 4 | f = ((sinOsc ar ((1 / a) / 9) a `greater_than` 0) * 20 + 99) / a 5 | in splay (sinOsc ar (hpf (ringz s f 1) 440) 0) 1 1 0 True * 0.25 6 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-0839296011982024704.hs: -------------------------------------------------------------------------------- 1 | -- https://twitter.com/redFrik/status/839296011982024704 2 | let a x = lfSaw ar x 0 3 | t = a (mce [0.5,0.6]) 4 | f = (a 5 * a 0.015 + 1) * 98 5 | m = (2 ** a 4 `roundTo` 0.5) * 99 6 | g = grainFM 1 t 16 f m (2 ** a (1 / mce [8,9]) * 8) 0 (-1) 512 7 | in tanh (g / 2) * 0.25 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-1136928201886904320.hs: -------------------------------------------------------------------------------- 1 | -- https://twitter.com/redFrik/status/1136928201886904320 (f0) 2 | let gt = greater_than 3 | f a i = 4 | let b = mce [4,2,1,3,5] 5 | c = roundTo (a ar (1/b) 0 * b) (a ar (b/9) 0 `gt` 0) 6 | o = sinOscFB ar (c ** 2 * ((a ar 0.02 i `gt` 0) + 1 * 50)) (a ar (c/9) 0 `modE` 1) 7 | s = o * max (a ar (1/b * a ar (b/99) i) 0) 0 * a ar 0.01 i 8 | x = allpassC s 1 (wrap c 0.5 1) 2 9 | y = bpf x (i * 99 + 400) 0.001 * (a ar 0.04 i + 1 * 9) 10 | in splay (x + y) 1 1 0 True / 3 11 | in sum (zipWith f [lfTri,lfSaw,lfPar] [0,1,2]) / 3 12 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-1338987643057688579.hs: -------------------------------------------------------------------------------- 1 | -- f0 2 | let b = mce [8..18] 3 | x = varSaw ar (mce [18.1,81.8,1.81] + b) 1 (varSaw ar (b/81) 0 0.5) 4 | t = varSaw ar (8/1.818) (mce [1,8/18]) 0.5 5 | d = (varSaw ar (b/181.8) 0 0.5 `in_exprange` (1.81/818,1.8/181.8)) `roundTo` (1.81/818) 6 | c = varSaw ar (1/8) (1/b) 0.5 + 8.18 * 1.8 7 | z = varSaw ar (1/81.8) 0 0.5 `in_range` (1.8 ** (-1),8.1/8.18) 8 | p = (pluck x t (1.8/181.8) d c z * (varSaw ar (1.8/b) 0 0.5) / 1.8) 9 | in hpf (splay p 1 1 0 True) (18/1.81) 10 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw-15eN.hs: -------------------------------------------------------------------------------- 1 | -- f0 ; https://sccode.org/1-5eN 2 | let s = gbmanN ar (mce2 2300 1150) 1.2 2.1 3 | f0 = pulse ar 4 (mce2 1 2 / 8) + (lfPulse ar (1/8) 0 0.5 / 5 + 1) 4 | f1 = lfSaw ar f0 0 + 2 5 | in X.glitchRHPF s f1 1 * 0.05 6 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0011.hs: -------------------------------------------------------------------------------- 1 | -- tw 0011 (f0) ; https://twitter.com/redFrik/status/23182604046 2 | let s o i = sinOsc ar ((mce2 (constant i) (constant i + 0.0001)) ** 2 * f o (i - 1)) (f o (i - 1) * 0.0001) * f o (i - 1) 3 | f o i = if i > 0 then s o i else o 4 | in f 60 6 / 60 5 | 6 | ---- note ; this graph has 48 UGens ; c.f. scd graph which has 1950 7 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0014.hs: -------------------------------------------------------------------------------- 1 | -- http://fredrikolofsson.com/f0blog/?q=node/478 (f0) 2 | let a = sinOscFB ar 3 | k = 1/9 4 | f i = let a0 = a (i+1) k * 999 5 | a1 = a k 1 * k 6 | a2 = a a0 k * a1 7 | a3 = a 0.1 3 8 | a4 = a a2 a3 * ((i+2) * 999) 9 | a5 = a k k 10 | in a a4 a5 * k 11 | s = sum (map f [0..9]) 12 | in mce2 s s * 0.1 13 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0020.hs: -------------------------------------------------------------------------------- 1 | -- http://fredrikolofsson.com/f0blog/?q=node/478 (f0) 2 | let a n = lfPulse ar n 0 0.5 3 | b = mce [1..4] 4 | a1 = (a (b/32) + 1) / 8 5 | a2 = (a a1 + 1) * b 6 | a3 = a (b/64) 7 | a4 = a (a (b/8)) * 2 + b 8 | a5 = a (4/b) 9 | a6 = a a2 10 | a7 = a ((a6 + ((mix a3 + a5) * a4)) * 100) 11 | s = mix a7 / 8 12 | in mce2 s s * 0.1 13 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0030.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) 2 | let a i j k l = lfPar ar i j * k + l 3 | f = a 1 0 5 (a (mce2 0.05 0.04) 0 50 160 `roundTo` 50) 4 | w = a 0.2 0 0.5 (a 3 0 0.2 0.5) 5 | o = varSaw ar f 0 w / 8 6 | in gVerb o 80 3 0.5 0.5 15 1 0.7 0.5 300 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0041.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) 2 | let s = sweep ar (localIn' 6 ar) 1 3 | i = impulse ar (mce [1,0.749,6,12,3,4]) 0 4 | o = sinOsc ar (1 / runningMax s i) 0 5 | in mrg [tanh (splay o 1 1 0 True) * 0.05,localOut o] 6 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0045.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) 2 | let a i j k l = sinOsc ar i j * k + l 3 | f = a (a 0.11 0 1 0) 0 1 0 4 | p_f = a (95 * a 0.01 0 1 1) 0 (a 0.005 0 50 0) 100 5 | p = a p_f (a (mce2 98 97) 0 1 0) (pi + a 0.0005 0 1 0) 0 6 | in tanh (a f p 1 0) * 0.1 7 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0049.hs: -------------------------------------------------------------------------------- 1 | -- https://www.listarc.bham.ac.uk/lists/sc-users/msg18379.html (f0) 2 | let t = 0 3 | o0 = lfSaw ar 3 0 * 9 + 99 4 | s0 = sweep ar t (mce [3..9]) `modE` o0 5 | s1 = sweep ar t (mce [33,32..3]) `modE` 128 .&. s0 6 | o1 = sinOsc ar (midiCps (s1 + 33)) 0 * pi 7 | in splay (sinOsc ar 9 o1) 1 1 0 True / 12 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0051.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let ascii_u = mce . map (constant . fromEnum) 3 | i = a (ascii_u "sunday") 4 | f = a (9 / ascii_u "slow") * 400 + 500 5 | w = a (7 / ascii_u "coding") + 1.1 6 | a = saw ar 7 | l = splay (bBandPass i f w / 5) 1 1 0 True 8 | in gVerb l 10 3 0.5 0.5 15 1 0.7 0.5 300 * 0.2 9 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0077.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let a = sinOsc ar 3 | f = a (1 / mce2 5 6) 0 + mce2 798 912 4 | p = (a (1 / 16) 0 * 19 + 99) * a (mce2 9 8) 0 5 | m = a (a 6 0 * a 0.009 0) 0 6 | b = a f p * m 7 | in tanh (a (mce2 201 301) b) * 0.1 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0084.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let a = saw ar 3 | f = a (mce [5,7..15] * 19) * 99 + 199 4 | g = a (mce [1,3..13] * 29) * 199 + 299 5 | w = a (mce [3,5..11] * (a 3 * 2 + 3)) * 299 + 399 6 | in splay (formant ar f g w) 1 1 0 True / 9 7 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0120.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let a = lfTri 3 | z = a kr (1 / mce2 7 8) 0 * a kr (1 / 9) 0 * 99 4 | l = midiCps (mce [60 .. 79]) 5 | f = select z l 6 | w = a kr (1 / mce2 3 4) 0 `modE` 1 7 | o = varSaw ar f 0 w 8 | in combN o 1 (1 / mce2 5 6) 8 / 8 9 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0121.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let a = sinOsc 3 | z = a kr (1 / mce2 8 7) 0 * a kr (1 / 30) 0 * 9 4 | l = midiCps (mce [56,62 .. 98]) 5 | m = a ar (1 / mce2 4 3) 0 6 | o = a ar (select z l) 0 * m 7 | in tanh (combN o 1 (1 / mce2 6 5) 9) * 0.1 8 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0125.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) 2 | let g = control kr "amp" 0.15 3 | a = sinOsc ar 4 | f = a (1 / mce [8,9]) 0 * 4 + mce [400,202] 5 | u = (a (1/9) 0 + 1) / 88 6 | d = (a (1/8) 0 + 1) / 99 7 | i = inFeedback 1 (mce [1,0]) 8 | p = combC (lagUD i u d) 1 0.08 9 9 | in a f p * g 10 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0134.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qy (f0) (requires -w 512) 2 | let mean l = sum l / fromIntegral (length l) 3 | a = lfSaw ar 4 | n' = 50 5 | n = constant n' 6 | z i = let o1 = a ((i + 1) / mce [3,4]) 0 7 | o2 = a ((i + 1) / 8) 0 + 1 8 | f0 = o1 `greater_than` o2 * (n / 2) + n 9 | m = a ((i + 1) / n) (i / (n / 2)) 10 | o3 = blip ar f0 (i + mce [2,3]) * m 11 | in ringz o3 ((i + 1) * (n * 2 - 1)) 0.1 12 | in mean (map z [0 .. n']) / 10 13 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0220.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0) 2 | let c = inFeedback 1 0 3 | b = clearBuf (localBuf 1 90000) 4 | g = tGrains 2 (sinOsc ar 3 0) b (c + 3) 2 12 0 0.1 4 5 | r = recordBuf ar b 0 1 0 1 Loop 1 DoNothing c 6 | in mrg2 (hpf (sinOsc ar 99 (c * 6) / 9 + g) 9 * 0.75) r 7 | 8 | -- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0) ; id 9 | let c = inFeedback 1 0 10 | b = clearBuf (localBufId 'α' 1 90000) 11 | g = tGrains 2 (sinOsc ar 3 0) b (c + 3) 2 12 0 0.1 4 12 | r = recordBuf ar b 0 1 0 1 Loop 1 DoNothing c 13 | in mrg2 (hpf (sinOsc ar 99 (c * 6) / 9 + g) 9 * 0.75) r 14 | -------------------------------------------------------------------------------- /Help/Graph/f0-tw0225.hs: -------------------------------------------------------------------------------- 1 | -- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0) 2 | let b = mce [1..8] * 99 3 | o = blip ar (b / 2 + lfSaw kr ((-8) / b) 1 * 99) (b / 4 + (lfSaw kr (1 / b) 1 * 99)) 4 | c = combN (o * sinOsc ar (8 / b) (lfSaw ar (99 / b) 0)) 0.2 0.2 1 5 | in sin (splay c 1 1 0 True) * 0.1 6 | -------------------------------------------------------------------------------- /Help/Graph/jar-1-4Qx.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Qx (jar) 2 | let f = lfCub kr 9.1 0 * 100 + mce [200,300,400,500] 3 | g = lfCub kr (1 / mce [2,3,5,7]) 0 * 0.5 + lfCub kr 9 0 4 | h = lfCub kr (1/2) 0 * 0.4 + 0.5 5 | s = lfCub ar f 0 * lag (g `greater_than` h) 0.1 6 | in splay s 1 0.075 0 True 7 | -------------------------------------------------------------------------------- /Help/Graph/jl-bitwise.hs: -------------------------------------------------------------------------------- 1 | -- bitwise ; a0f253ff89f6b244ea29a1e431dd9e5df5571a8b (jl) 2 | let t = pulseCount (impulse ar 8e3 0) 0 3 | s = ((((t * 15) .&. (t .>>. 5)) .|. 4 | ((t * 5) .&. (mce2 (t .>>. 3) (t .>>. 4))) .|. 5 | ((t * 2) .&. (t .>>. 9)) .|. 6 | ((t * 8) .&. (t .>>. 11))) - 3) `modE` 256 7 | in tanh (hpf (((s / 127) - 1) * 3) 20) * 0.02 8 | -------------------------------------------------------------------------------- /Help/Graph/jl-dark-sea-horns.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-j#c51 (jl) 2 | let n = lfNoise1 3 | x = localIn' 2 ar 4 | a = tanh (sinOsc ar 65 (x * lfNoise1 ar 0.1 * 3) * lfNoise1 ar 3 * 6) 5 | f i = allpassN i 0.3 (X.randN 2 0.1 0.3) 5 6 | o = tanh (iter 9 f a) 7 | in mrg2 (o * 0.2) (localOut o) 8 | 9 | -- http://sccode.org/1-j#c51 (jl) ; id 10 | let n = lfNoise1Id 11 | x = localIn' 2 ar 12 | a = tanh (sinOsc ar 65 (x * n 'α' ar 0.1 * 3) * n 'β' ar 3 * 6) 13 | f z i = allpassN i 0.3 (X.randNId 2 (z,'γ') 0.1 0.3) 5 14 | o = tanh (useqId 'δ' 9 f a) 15 | in mrg2 (o * 0.2) (localOut o) 16 | -------------------------------------------------------------------------------- /Help/Graph/jl-jl-1-Z.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-Z (jl) 2 | let a = lag (impulse kr 8 0) 0.1 3 | b = crackle ar (lag (abs (lfSaw kr 3 0)) 0.1 * 1.8) 4 | c = a * b 5 | d = lag (impulse kr 2 0 + impulse kr 4 0.5) 0.1 6 | e = blip ar 4.9 7 * 0.4 7 | f = d * e 8 | in tanh (c + gVerb f 1 1 0.5 0.5 15 1 0.7 0.5 300 * 5) * 0.5 9 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-alien-meadow.hs: -------------------------------------------------------------------------------- 1 | -- alien meadow (jmcc) #6 ; texture=overlap,2,6,6,inf 2 | let b = rand 0 5000 3 | f = sinOsc ar (rand 0 20) 0 * b * 0.1 + b 4 | in pan2 (sinOsc ar f 0) (rand2 1) (sinOsc ar (rand 0 20) 0 * 0.05 + 0.05) 5 | 6 | -- alien meadow (jmcc) #6 ; texture=overlap,2,6,6,inf ; id 7 | let b = randId 'α' 0 5000 8 | f = sinOsc ar (randId 'β' 0 20) 0 * b * 0.1 + b 9 | in pan2 (sinOsc ar f 0) (randId 'γ' (-1) 1) (sinOsc ar (randId 'δ' 0 20) 0 * 0.05 + 0.05) 10 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-analog-bubbles.hs: -------------------------------------------------------------------------------- 1 | -- analog bubbles (jmcc) #1 2 | let o = lfSaw kr (mce2 8 7.23) 0 * 3 + 80 3 | m = lfSaw kr 0.4 0 * 24 + o 4 | s = sinOsc ar (midiCps m) 0 * 0.04 5 | in combN s 0.2 0.2 4 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-coolant.hs: -------------------------------------------------------------------------------- 1 | -- coolant (jmcc) #2 ; texture=overlap,4,4,2,inf 2 | let p = 10 3 | spec freq = let n = mceFill p (const 1) in klankSpec_mce freq n n 4 | gen _ = klank (onePole (brownNoise ar * 0.0015) 0.95) 1 0 1 (spec (X.randN p 40 2400)) 5 | in mceFill 2 gen 6 | 7 | -- coolant (jmcc) #2 ; texture=overlap,4,4,2,inf ; id 8 | let p = 10 9 | s = onePole (mceFillId 'α' 2 (\z _ -> brownNoiseId z ar * 0.0015)) 0.95 10 | n = mceFill p (const 1) 11 | s1 = klankSpec_mce (X.randNId p 'β' 40 2400) n n 12 | s2 = klankSpec_mce (X.randNId p 'γ' 40 2400) n n 13 | in klank s 1 0 1 (mceTranspose (mce2 s1 s2)) 14 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-filter-input.hs: -------------------------------------------------------------------------------- 1 | -- filter input (jmcc) #5 ; warning=feedback 2 | let rQ = mouseY kr 0.01 1 Exponential 0.2 {- bandwidth ratio = 1/Q -} 3 | cf = mouseX kr 100 12000 Exponential 0.2 {- cutoff freq -} 4 | sg = soundIn (mce2 0 1) * 0.4 * sqrt rQ {- attenuate to offset resonance -} 5 | in rlpf sg cf rQ 6 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-lfo-modulation.hs: -------------------------------------------------------------------------------- 1 | -- lfo modulation (jmcc) #1 2 | let o = fSinOsc kr 0.05 0 * 80 + 160 3 | p = fSinOsc kr (mce2 0.6 0.7) 0 * 3600 + 4000 4 | s = rlpf (lfPulse ar o 0 0.4 * 0.05) p 0.2 5 | in combL s 0.3 (mce2 0.2 0.25) 2 6 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-moto-rev.hs: -------------------------------------------------------------------------------- 1 | -- moto rev (jmcc) #1 2 | let f = sinOsc kr 0.2 0 * 10 + 21 3 | s = lfPulse ar f (mce2 0 0.1) 0.1 4 | in clip2 (rlpf s 100 0.1) 0.4 5 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-random-sine-waves.hs: -------------------------------------------------------------------------------- 1 | -- random sine waves (jmcc) #1 ; texture=overlap,2,5,12,inf 2 | let o = fSinOsc ar (rand 0 2000) 0 * 0.02 3 | in pan2 o (rand2 1) 1 4 | 5 | -- random sine waves (jmcc) #1 ; texture=overlap,2,5,12,inf ; id 6 | let f = randId 'α' 0 2000 7 | o = fSinOsc ar f 0 * 0.02 8 | in pan2 o (randId 'β' (-1) 1) 1 9 | 10 | -- random sine waves (jmcc) #1 ; event control 11 | let f (_,g,x,_,z,o,_,_,_,_,_) = 12 | let s = fSinOsc ar (x * 2000) 0 13 | in pan2 s (o * 2 - 1) (z * g) 14 | in mix (voicer 16 f) * control kr "gain" 0.25 15 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-resonant-dust.hs: -------------------------------------------------------------------------------- 1 | -- resonant dust (jmcc) #2 ; texture=overlap,5,2,9,inf 2 | let rf = let st = rand 80 2080 3 | en = st + (rand2 0.5 * st) 4 | in xLine kr st en 9 DoNothing 5 | d = dust ar (rand 50 850) * 0.3 6 | in pan2 (resonz d rf 0.1) (rand (-1) 1) 1 7 | 8 | -- resonant dust (jmcc) #2 ; texture=overlap,5,2,9,inf ; id 9 | let rf = let st = randId 'α' 80 2080 10 | en = st + (randId 'β' (-0.5) 0.5 * st) 11 | in xLine kr st en 9 DoNothing 12 | d = dustId 'γ' ar (randId 'δ' 50 850) * 0.3 13 | in pan2 (resonz d rf 0.1) (randId 'ε' (-1) 1) 1 14 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-saucer-base.hs: -------------------------------------------------------------------------------- 1 | -- saucer base (jmcc) #6 ; texture=overlap,2,6,4,inf 2 | let b = rand 0 1000 3 | c = rand 0 5000 4 | o = sinOsc ar (sinOsc ar (rand 0 20) 0 * b + (1.1 * b)) 0 * c + (1.1 * c) 5 | in pan2 (sinOsc ar o 0 * 0.1) (rand2 1) 1 6 | 7 | -- saucer base (jmcc) #6 ; texture=overlap,2,6,4,inf ; id 8 | let a = randId 'α' 0 20 9 | b = randId 'β' 0 1000 10 | c = randId 'γ' 0 5000 11 | p = randId 'δ' (-1) 1 12 | o = sinOsc ar a 0 * b + (1.1 * b) 13 | o' = sinOsc ar o 0 * c + (1.1 * c) 14 | in pan2 (sinOsc ar o' 0 * 0.1) p 1 15 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-scratchy.hs: -------------------------------------------------------------------------------- 1 | -- scratchy (jmcc) #1 2 | let n = mceFill 2 (\_ -> brownNoise ar * 0.5 - 0.49) 3 | in rhpf (max n 0 * 20) 5000 1 4 | 5 | -- scratchy (jmcc) #1 ; id 6 | let n = mce (map (\z -> brownNoiseId z ar * 0.5 - 0.49) (id_seq 2 'α')) 7 | in rhpf (max n 0 * 20) 5000 1 8 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-sprinkler-mouse.hs: -------------------------------------------------------------------------------- 1 | -- sprinkler mouse (jmcc) #1 2 | let n = whiteNoise ar 3 | f = mouseX kr 0.2 50 Linear 0.2 4 | t = lfPulse kr f 0 0.25 * 0.1 5 | in bpz2 (n * t) 6 | 7 | -- sprinkler mouse (jmcc) #1 ; id 8 | let n = whiteNoiseId 'α' ar 9 | f = mouseX kr 0.2 50 Linear 0.2 10 | t = lfPulse kr f 0 0.25 * 0.1 11 | in bpz2 (n * t) 12 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-sprinkler.hs: -------------------------------------------------------------------------------- 1 | -- sprinkler (jmcc) #1 2 | let f = lfPulse kr 0.09 0 0.16 * 10 + 7 3 | t = lfPulse kr f 0 0.25 * 0.1 4 | n = whiteNoise ar 5 | in bpz2 (n * t) 6 | 7 | -- sprinkler (jmcc) #1 ; id 8 | let f = lfPulse kr 0.09 0 0.16 * 10 + 7 9 | t = lfPulse kr f 0 0.25 * 0.1 10 | n = whiteNoiseId 'α' ar 11 | in bpz2 (n * t) 12 | 13 | -------------------------------------------------------------------------------- /Help/Graph/jmcc-theremin.hs: -------------------------------------------------------------------------------- 1 | -- theremin (jmcc) ; mouse control 2 | let m = 7 3 | detune = 0 4 | x = mouseX kr 0 0.6 Linear 0.2 5 | y = mouseY kr 4000 200 Exponential 0.8 6 | f = y + detune 7 | f' = f + f * sinOsc ar m 0 * 0.02 8 | a = sinOsc ar f' 0 * x 9 | in pan2 a 0 1 10 | 11 | -- theremin (jmcc) ; event control 12 | let f (_,w,x,y,z,o,rx,_,_,_,_) = 13 | let freq = lag (linExp y 0 1 4000 200) 0.8 14 | a = sinOsc ar (freq + freq * sinOsc ar (4 + 3 * rx) 0 * 0.02) 0 * x * 0.6 * lag w 0.2 15 | in pan2 a (o * 0.25) (0.5 + z) 16 | in mix (voicer 16 f) * control kr "gain" 0.5 17 | -------------------------------------------------------------------------------- /Help/Graph/jp-record-scratcher.hs: -------------------------------------------------------------------------------- 1 | -- record scratcher (jp) ; requires=buf 2 | let (buf, nc) = (control kr "buf" 0, 2) 3 | dup a = mce2 a a 4 | d = Envelope [0, 1, 0] [0.1, 0.1] [EnvSin] (Just 1) (Just 0) 0 5 | e = envGen kr 1 0.5 0 1 RemoveSynth d 6 | x = mouseX kr (-10) 10 Linear 0.2 7 | dx = x - delayN x 0.1 0.1 8 | bdx = mouseButton kr 1 0 0.3 + dx 9 | bdxr = bdx * bufRateScale kr buf 10 | scr = playBuf nc ar buf bdxr 0 0 Loop DoNothing 11 | in dup (scr * e) 12 | 13 | ---- ; buffer setup 14 | withSc3 (async (b_allocRead 0 (sfResolve "pf-c5.aif") 0 0)) 15 | -------------------------------------------------------------------------------- /Help/Graph/ljp-one-line.hs: -------------------------------------------------------------------------------- 1 | -- one-line (ljp) 2 | let lfs = lfSaw ar (mce2 1 0.99) (mce2 0 0.6) * 2000 + 2000 3 | lfs_t = trunc lfs (mce2 400 600) * mce2 1 (-1) 4 | f = onePole (mix lfs_t) 0.98 5 | in pan2 (sinOsc ar f 0) 0 0.1 6 | 7 | -------------------------------------------------------------------------------- /Help/Graph/lkp-chaos-engine.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-5aJ -- chaos engine hum 2 | let o1 = sinOsc kr 101 (saw kr 0.12345 * 678 + 9) * 0.2 + 0.8 3 | o2 = pulse kr (mce2 25 25.5) 0.25 * 0.125 - 0.25 4 | o3 = sinOsc kr (mce2 50 51) 0 * o1 + o2 5 | in sinOsc ar (10 + 50 * o3) 0 * 0.5 6 | -------------------------------------------------------------------------------- /Help/Graph/mp-rm-octaver.hs: -------------------------------------------------------------------------------- 1 | -- rm-octaver (miller puckette) ; http://crca.ucsd.edu/~msp/techniques/latest/book-html/node77.html 2 | let defaultPitch x = pitch x 440 60 4000 100 16 1 0.01 0.5 1 0 3 | rm_octaver i = 4 | let p = defaultPitch i 5 | [f,tr] = mceChannels p 6 | in lag3 tr 0.1 * sinOsc ar (f * 0.5) 0 * i + i 7 | in rm_octaver (soundIn (control kr "in" 0)) 8 | -------------------------------------------------------------------------------- /Help/Graph/my-mouse.hs: -------------------------------------------------------------------------------- 1 | -- https://mohayonao.github.io/CoffeeCollider/#mouse.coffee (mohayonao) http://the.mohayonao.com/ 2 | let freq = mouseY kr 100 1000 Exponential 0.1 3 | freq1 = freq * mouseX kr 2 0.5 Linear 2.5 4 | freq2 = freq * mouseX kr 0.5 2 Linear 2.5 5 | feedback = mouseButton kr 0 pi 5 6 | in sinOscFB ar (mce2 freq1 freq2) feedback * 0.1 7 | -------------------------------------------------------------------------------- /Help/Graph/nv-ml-2014-06-03.hs: -------------------------------------------------------------------------------- 1 | -- sc-users, 2014-06-03 (nv) ; https://twitter.com/headcube/status/474064500564324352 (nv) 2 | let y = mouseY kr 1 100 Linear 0.2 3 | x = mouseX kr 50 400 Exponential 0.2 4 | i = decay (impulse ar 0.5 0) 0.1 5 | i' = sin (bpf (i * y) 50 1) 6 | repl n = mce . replicate n 7 | in repl 2 (pluck i' (lfSaw ar 10000 0) 0.1 (1 / x) 4 0.5) 8 | -------------------------------------------------------------------------------- /Help/Graph/nv-tw-01.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-V (nv) L1 2 | let a = mceFill 2 (\_ -> pinkNoise ar) 3 | nd i = 4 | let n = lfNoise1 kr (rand 0 0.05) 5 | f = linExp n (-1) 1 40 15000 6 | in bBandStop i f (expRand 0.1 2) 7 | in lpf (iter 50 nd a) 100000 8 | 9 | -- http://sccode.org/1-V (nv) L1 ; id 10 | let a = mce2 (pinkNoiseId 'α' ar) (pinkNoiseId 'β' ar) 11 | nd z i = 12 | let n = lfNoise1Id (z,'γ') kr (randId (z,'δ') 0 0.05) 13 | f = linExp n (-1) 1 40 15000 14 | in bBandStop i f (expRandId (z,'ε') 0.1 2) 15 | in lpf (useqId 'ζ' 50 nd a) 100000 16 | -------------------------------------------------------------------------------- /Help/Graph/nv-tw-2013-12-04.hs: -------------------------------------------------------------------------------- 1 | -- https://twitter.com/headcube/status/408145586970324992 (nv) 2 | let mean l = sum l / fromIntegral (length l) 3 | f j = 4 | let i = j + 1 5 | a = saw ar ((1 / i + 1) / 6) 6 | p = pluck a a 1 (1 / i / (3 - lfPulse ar (1 / i) 0 0.5) / 30) 9 (0.9 / i) 7 | x = (0.5 ** i) * p 8 | o = sinOsc ar 2 0 + mce2 4 9 9 | in combC x 1 (o * 0.001) 0 - x 10 | in mean (map f [0 .. 8]) / 9 11 | -------------------------------------------------------------------------------- /Help/Graph/nv-tw-43.hs: -------------------------------------------------------------------------------- 1 | -- https://swiki.hfbk-hamburg.de/MusicTechnology/899 (nv) L43 2 | let k = 2 3 | o = lfSaw ar (mce2 102 101) 0 4 | f i = 5 | let x = impulse ar 1 (i / 10) + impulse ar 0 0 6 | d = latch (((1.015 ** sweep ar 0 1 * 64) `modE` 1 + 1) * 200) x 7 | in pluck o x 1 (1 / d) 4 0.2 8 | in mceMean (mceFill k f) * 0.25 9 | -------------------------------------------------------------------------------- /Help/Graph/pj-forest-sounds-m.hs: -------------------------------------------------------------------------------- 1 | -- sc-users, 2007-04-06 (pj) [paul jones] 2 | let insects _ = 3 | let o = sinOsc kr (lfNoise2 kr 50 * 50 + 50) 0 * 100 + 2000 4 | in bpf (brownNoise ar) o 0.001 * 10 5 | in mceFill 2 insects 6 | 7 | -- sc-users, 2007-04-06 (pj) [paul jones] ; monad 8 | uid_st_eval (do 9 | let insects_m = do 10 | n1 <- brownNoiseM ar 11 | n2 <- lfNoise2M kr 50 12 | let o = sinOsc kr (n2 * 50 + 50) 0 * 100 + 2000 13 | return (bpf n1 o 0.001 * 10) 14 | fmap mce (replicateM 2 insects_m)) 15 | -------------------------------------------------------------------------------- /Help/Graph/pmi.hs: -------------------------------------------------------------------------------- 1 | -- pmi ; texture=overlap,1,2,7,inf 2 | let pm = line kr 0 (rand 0 12) (rand 1 12) DoNothing 3 | in linPan2 (pmOsc ar (rand 0 2000) (rand 0 800) pm 0) (rand2 1) 0.05 4 | 5 | -- pmi ; texture=overlap,1,2,7,inf ; id 6 | let n = randId 'α' 1 12 7 | cf = randId 'β' 0 2000 8 | mf = randId 'γ' 0 800 9 | pme = randId 'δ' 0 12 10 | l = randId 'ε' (-1) 1 11 | pm = line kr 0 pme n DoNothing 12 | in linPan2 (pmOsc ar cf mf pm 0) l 0.05 13 | -------------------------------------------------------------------------------- /Help/Graph/tb-1-4Tw.hs: -------------------------------------------------------------------------------- 1 | -- http://sccode.org/1-4Tw (tb) 2 | let im = mix (impulse ar (mce3 1 (1/3) (1/5)) (mce3 0 0.133 0.5)) 3 | f i = tDuty ar (max 0.25 (timer i)) 0 DoNothing 1 0 4 | g n i = sinOsc ar ((4000 + (i * 500))) 0 * decay2 n 0.01 0.2 5 | nd = zipWith g (iterate f im) [0..9] 6 | in splay (mce nd) 1 1 0 True 7 | -------------------------------------------------------------------------------- /Help/Graph/tw-tw-01.hs: -------------------------------------------------------------------------------- 1 | -- tim walters ; 2 | let f k i = 3 | let x = impulse kr ((0.5 ** i) / k) 0 4 | in sinOsc ar i (sinOsc ar ((i + k) ** i) 0 / (decay x (mce2 i (i + 1)) * k)) 5 | s = mixFill 16 (\k -> mixFill 6 (f k)) 6 | in mix (mceTranspose (gVerb s 1 3 0.5 0.5 15 1 0.7 0.5 300 / 512)) 7 | -------------------------------------------------------------------------------- /Help/Graph/unk-sin-gliss.hs: -------------------------------------------------------------------------------- 1 | -- sin gliss (unk) 2 | let t = 60 3 | ln (x0,x1) = xLine kr x0 x1 t DoNothing 4 | m = [(0.5,0.5),(0.5,1),(1,1.19),(1.19,1.56),(1.56,2),(2.51,2),(3.01,2.66),(4.1,3.01),(4.1,4.1)] 5 | a = mce [0.25,0.25,1,0.8,0.5,0.9,0.4,0.3,0.6,0.1,0.1] 6 | f = mce (map ln m) 7 | in splay (sinOsc ar (500 * f) 0 * 0.1 * a) 1 1 0 True 8 | -------------------------------------------------------------------------------- /Help/Notes/overloaded-lists.text: -------------------------------------------------------------------------------- 1 | UGen can have an instance of IsList. 2 | 3 | This can allow literal multiple-channel inputs to be written without annotation. 4 | 5 | Ie. `sinOsc ar [440, 441] 0`. 6 | 7 | This requires the OverloadedLists language extension to be in place. 8 | 9 | It's not entirely clear if this is a good idea or not. 10 | -------------------------------------------------------------------------------- /Help/Notes/signal-effect-group.help.hs: -------------------------------------------------------------------------------- 1 | -- decay ; ordinary graph ; ordinary key bindings place at head of group one 2 | let d = dustId 'α' ar 1 3 | n = whiteNoiseId 'β' ar 4 | in decay (d * 0.5) 0.2 * n 5 | 6 | ---- ; signal/effect model using separate group, operating at the same bus 7 | withSc3 (playAt (-1, AddToTail, 2, []) (replaceOut 0 (combC (in' 1 ar 0) 0.2 0.2 3))) 8 | -------------------------------------------------------------------------------- /Help/Nrt/nrt.02.hs: -------------------------------------------------------------------------------- 1 | import Sound.Osc.Packet {- hosc3 -} 2 | import Sound.Sc3 {- hsc3 -} 3 | 4 | sy :: Synthdef 5 | sy = synthdef "sin" (out 0 (sinOsc ar (control kr "freq" 440) 0 * 0.2)) 6 | 7 | b0,b1,b2,b3 :: Bundle 8 | b0 = bundle 0.0 [g_new [(1, AddToTail, 0)], d_recv sy] 9 | b1 = bundle 0.5 [s_new "sin" 1001 AddToHead 1 []] 10 | b2 = bundle 3.0 [n_free [1001]] 11 | b3 = bundle 3.5 [nrt_end] 12 | 13 | main :: IO () 14 | main = do 15 | writeNrt "/tmp/nrt.02.osc" (Nrt [b0,b1,b2,b3]) 16 | nrt_exec_plain ("/tmp/nrt.02.osc",("_",0),("/tmp/nrt.02.wav",1),48000,PcmInt16,[]) 17 | -------------------------------------------------------------------------------- /Help/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/README -------------------------------------------------------------------------------- /Help/Server/b_close.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_close" 2 | -------------------------------------------------------------------------------- /Help/Server/b_fill.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_fill" 2 | -------------------------------------------------------------------------------- /Help/Server/b_free.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_free" 2 | 3 | > import Sound.Sc3 {- hsc3 -} 4 | 5 | It is safe to free un-allocated buffers. 6 | 7 | withSc3 (async (b_free (2 ^ 15))) 8 | 9 | There is no multiple buffer form. 10 | 11 | withSc3 (mapM_ (\k -> async (b_free k)) [0..256]) 12 | -------------------------------------------------------------------------------- /Help/Server/b_get.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_get" 2 | -------------------------------------------------------------------------------- /Help/Server/b_info.help.hs: -------------------------------------------------------------------------------- 1 | /b_info is the message returned by scsynth in response to /b_query. 2 | 3 | Fields are: buffer-id:int num-frames:int num-channels:int sample-rate:float 4 | -------------------------------------------------------------------------------- /Help/Server/b_read.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; help 2 | Sound.Sc3.sc3_scdoc_help_server_command_open False "/b_read" 3 | -------------------------------------------------------------------------------- /Help/Server/b_readChannel.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; help 2 | Sound.Sc3.sc3_scdoc_help_server_command_open False "/b_readChannel" 3 | -------------------------------------------------------------------------------- /Help/Server/b_set.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_set" 2 | -------------------------------------------------------------------------------- /Help/Server/b_setn.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_setn" 2 | -------------------------------------------------------------------------------- /Help/Server/b_write.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_write" 2 | -------------------------------------------------------------------------------- /Help/Server/b_zero.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/b_zero" 2 | -------------------------------------------------------------------------------- /Help/Server/c_fill.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/c_fill" 2 | -------------------------------------------------------------------------------- /Help/Server/c_get.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/c_get" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | > g_01 = out 0 (tRand 'α' 220 2200 (dust 'β' KR 1)) 7 | 8 | > x_01 :: Transport m => m () 9 | > x_01 = do 10 | > sendMessage (c_get [0]) 11 | > r <- waitReply "/c_set" 12 | > liftIO (print r) 13 | 14 | > withSc3 x_01 15 | -------------------------------------------------------------------------------- /Help/Server/c_getn.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/c_getn" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | Get control bus data. 7 | 8 | > get_c :: Transport m => m () 9 | > get_c = do 10 | > sendMessage (c_getn [(0,3)]) 11 | > r <- waitReply "/c_setn" 12 | > liftIO (print r) 13 | 14 | withSc3 (sendMessage (c_setn [(0,[1,880,0.5])])) 15 | withSc3 get_c 16 | 17 | Function to get and unpack control bus data. 18 | 19 | withSc3 (c_getn1_data (0,3)) 20 | -------------------------------------------------------------------------------- /Help/Server/c_set.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/c_set" 2 | -------------------------------------------------------------------------------- /Help/Server/c_setn.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/c_setn" 2 | -------------------------------------------------------------------------------- /Help/Server/clearSched.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/clearSched" 2 | -------------------------------------------------------------------------------- /Help/Server/d_free.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/d_free" 2 | -------------------------------------------------------------------------------- /Help/Server/d_load.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/d_load" 2 | -------------------------------------------------------------------------------- /Help/Server/d_loadDir.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/d_loadDir" 2 | -------------------------------------------------------------------------------- /Help/Server/d_recv.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/d_recv" 2 | -------------------------------------------------------------------------------- /Help/Server/dumpOSC.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/dumpOSC" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | > ex_01 :: Transport m => m () 7 | > ex_01 = do 8 | > sendMessage (dumpOSC TextPrinter) 9 | > play (out 0 (sinOsc AR (rand 'α' 440 880) 0 * 0.1)) 10 | > pauseThread 1.0 11 | > reset 12 | > sendMessage (dumpOSC NoPrinter) 13 | 14 | withSc3 ex_01 15 | withSc3 (sendMessage (dumpOSC TextPrinter)) 16 | -------------------------------------------------------------------------------- /Help/Server/g_deepFree.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/g_deepFree" 2 | -------------------------------------------------------------------------------- /Help/Server/g_freeAll.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/g_freeAll" 2 | 3 | > import Sound.OSC 4 | > import Sound.Sc3 5 | 6 | > m1 = g_freeAll [0] 7 | 8 | > withSc3 (sendMessage m1) 9 | -------------------------------------------------------------------------------- /Help/Server/g_head.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/g_head" 2 | -------------------------------------------------------------------------------- /Help/Server/g_new.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/g_new" 2 | 3 | The root node of the synthesiser tree is a group with ID zero. 4 | 5 | By convention there is a group with ID one at the root group, but 6 | this is only a convention. We need to make the group. 7 | 8 | > import Sound.Sc3 {- hsc3 -} 9 | 10 | > m_01 = g_new [(1,AddToTail,0)] 11 | 12 | > withSc3 (send m_00) 13 | -------------------------------------------------------------------------------- /Help/Server/g_tail.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/g_tail" 2 | -------------------------------------------------------------------------------- /Help/Server/n_after.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_after" 2 | -------------------------------------------------------------------------------- /Help/Server/n_before.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_before" 2 | -------------------------------------------------------------------------------- /Help/Server/n_fill.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_fill" 2 | -------------------------------------------------------------------------------- /Help/Server/n_free.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_free" 2 | -------------------------------------------------------------------------------- /Help/Server/n_map.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_map" 2 | -------------------------------------------------------------------------------- /Help/Server/n_query.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_query" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | > d_00 = 7 | > let f = control KR "freq" 440 8 | > o = saw AR f * 0.1 9 | > in synthdef "saw" (out 0 o) 10 | 11 | > m_00 = s_new0 "saw" 1000 AddToTail 1 12 | 13 | > withSc3 (async_ (d_recv d_00) >> sendMessage m_00) 14 | 15 | > x_01 :: Transport m => m Message 16 | > x_01 = withNotifications $ do 17 | > sendMessage (n_query [1000]) 18 | > waitReply "/n_info" 19 | 20 | > r <- withSc3 x_01 21 | > print r 22 | -------------------------------------------------------------------------------- /Help/Server/n_run.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_run" 2 | -------------------------------------------------------------------------------- /Help/Server/n_set.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; help 2 | Sound.Sc3.sc3_scdoc_help_server_command_open False "/n_set" 3 | -------------------------------------------------------------------------------- /Help/Server/n_setn.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_setn" 2 | 3 | At some point /n_setn was broken at scsynth, it no longer behaves as specified. 4 | 5 | /n_setn only works correctly with indices, and not when the index is given as a . 6 | -------------------------------------------------------------------------------- /Help/Server/n_trace.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/n_trace" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | > m_01 = 7 | > [d_recv defaultSynthdef 8 | > ,s_new "default" 100 AddToHead 1 []] 9 | 10 | > m_02 = n_trace [1,100] 11 | 12 | > withSc3 (mapM_ maybe_async m_01) 13 | > withSc3 (sendMessage m_02) 14 | -------------------------------------------------------------------------------- /Help/Server/notify.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/notify" 2 | 3 | > import Sound.OSC {- hosc -} 4 | > import Sound.Sc3 {- hsc3 -} 5 | 6 | > g_01 = sinOsc AR (rand 'α' 440 880) 0 * 0.1 7 | 8 | > s_01 = synthdef "g" (out 0 g_01) 9 | 10 | > m_01 = s_new "g" (-1) AddToHead 1 [] 11 | 12 | > f_01 :: DuplexOSC m => m Message 13 | > f_01 = do 14 | > async_ (d_recv s_01) 15 | > withNotifications (sendMessage m_01 >> waitReply "/n_go") 16 | 17 | withSc3 (f_01 >>= \r -> liftIO (print r)) 18 | -------------------------------------------------------------------------------- /Help/Server/quit.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/quit" 2 | -------------------------------------------------------------------------------- /Help/Server/s_get.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/s_get" 2 | -------------------------------------------------------------------------------- /Help/Server/s_getn.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/s_getn" 2 | -------------------------------------------------------------------------------- /Help/Server/s_new.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; help 2 | Sound.Sc3.sc3_scdoc_help_server_command_open False "/s_new" 3 | -------------------------------------------------------------------------------- /Help/Server/s_noid.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/s_noid" 2 | -------------------------------------------------------------------------------- /Help/Server/status.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/status" 2 | 3 | > import Sound.Sc3 {- hsc3 -} 4 | 5 | withSc3 serverStatus >>= mapM putStrLn 6 | -------------------------------------------------------------------------------- /Help/Server/sync.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/sync" 2 | -------------------------------------------------------------------------------- /Help/Server/tr.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/tr" 2 | -------------------------------------------------------------------------------- /Help/Server/u_cmd.help.hs: -------------------------------------------------------------------------------- 1 | Sound.Sc3.Lang.Help.viewServerHelp "/u_cmd" 2 | -------------------------------------------------------------------------------- /Help/Ugen/abs.help.hs: -------------------------------------------------------------------------------- 1 | -- abs 2 | abs (syncSaw ar 100 440 * 0.1) 3 | -------------------------------------------------------------------------------- /Help/Ugen/absDif.help.hs: -------------------------------------------------------------------------------- 1 | -- absdif 2 | fSinOsc ar 440 0 * (0.1 `absDif` (fSinOsc ar 2 0 * 0.2)) 3 | -------------------------------------------------------------------------------- /Help/Ugen/acos.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "ArcCos" 3 | Sound.Sc3.Plot.plot_fn_r1_ln acos (-1,1) 4 | -------------------------------------------------------------------------------- /Help/Ugen/add.help.hs: -------------------------------------------------------------------------------- 1 | -- add (+) 2 | let o = fSinOsc ar 800 0 3 | n = pinkNoiseId 'α' ar 4 | in (o + n) * 0.1 5 | 6 | -- add ; dc offset 7 | fSinOsc ar 440 0 * 0.1 + 0.5 8 | 9 | -- add ; optimise identity (rhs) 10 | (sinOsc ar 440 0 + 0) * 0.1 11 | 12 | -- add ; optimise identity (lhs) 13 | (0 + sinOsc ar 440 0) * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/allpassC.help.hs: -------------------------------------------------------------------------------- 1 | -- allpassC ; allpass delay has no audible effect as a resonator on steady state sound 2 | let dly = xLine kr 0.0001 0.01 20 RemoveSynth 3 | n = whiteNoiseId 'α' ar * 0.05 4 | in allpassC n 0.01 dly 0.2 5 | 6 | -- allpassC ; cubic variant 7 | let dly = xLine kr 0.0001 0.01 20 RemoveSynth 8 | n = whiteNoiseId 'δ' ar * 0.05 9 | in n + allpassC n 0.01 dly 0.2 10 | 11 | -------------------------------------------------------------------------------- /Help/Ugen/allpassL.help.hs: -------------------------------------------------------------------------------- 1 | -- allpassL ; linear variant 2 | let n = whiteNoiseId 'γ' ar * 0.05 3 | dly = xLine kr 0.0001 0.01 20 RemoveSynth 4 | in n + allpassL n 0.01 dly 0.2 5 | -------------------------------------------------------------------------------- /Help/Ugen/amClip.help.hs: -------------------------------------------------------------------------------- 1 | -- amClip 2 | amClip (whiteNoiseId 'α' ar) (fSinOsc kr 1 0 * 0.05) 3 | -------------------------------------------------------------------------------- /Help/Ugen/ampComp.help.hs: -------------------------------------------------------------------------------- 1 | -- ampComp ; mouse frequency control 2 | let freq = mouseX kr 300 15000 Exponential 0.2 3 | in sinOsc ar freq 0 * 0.1 * ampComp kr freq 300 0.3333 4 | 5 | -- ampComp ; modified exponent 6 | let freq = mouseX kr 300 15000 Exponential 0.2 7 | in pulse ar freq 0.5 * 0.1 * ampComp kr freq 300 1.3 8 | 9 | -- ampComp ; in frequency modulation 10 | let freq1 = mouseX kr 300 15000 Exponential 0.2 11 | freq2 = freq1 * (sinOsc ar (mouseY kr 3 200 Exponential 0.2) 0 * 0.5 + 1) 12 | in sinOsc ar freq2 0 * 0.1 * ampComp ar freq2 300 0.3333 13 | -------------------------------------------------------------------------------- /Help/Ugen/ampDb.help.hs: -------------------------------------------------------------------------------- 1 | -- ambDb 2 | sinOsc ar (ampDb (line kr 0 1 5 DoNothing) * 2 + 180) 0 * dbAmp (-45) 3 | -------------------------------------------------------------------------------- /Help/Ugen/amplitude.help.hs: -------------------------------------------------------------------------------- 1 | -- amplitude ; control gain 2 | let s = soundIn 0 3 | a = amplitude kr s 0.01 0.01 4 | in pulse ar 90 0.3 * a 5 | 6 | -- amplitude ; control frequency 7 | let s = soundIn 0 8 | f = amplitude kr s 0.5 0.5 * 1200 + 400 9 | in sinOsc ar f 0 * 0.1 10 | 11 | -- amplitude 12 | let s = soundIn 0 13 | a = amplitude ar s 0.5 0.05 14 | in s * a 15 | -------------------------------------------------------------------------------- /Help/Ugen/analogPhaserMod.help.hs: -------------------------------------------------------------------------------- 1 | -- analogPhaserMod 2 | let amp = 0.25 3 | osc = sinOsc ar (lfNoise2Id 'α' ar 10 * 1000) 0 4 | flt = X.analogPhaserMod osc 0 1.0 50 5 | drywet = lfSaw ar 0.1 0 6 | sig = xFade2 (sinOsc ar (osc * 401.0) 0) (sinOsc ar (flt * 401.0) 0) drywet amp 7 | in pan2 sig 0 1 8 | -------------------------------------------------------------------------------- /Help/Ugen/arrayMax.help.hs: -------------------------------------------------------------------------------- 1 | -- arrayMax 2 | let son = sinOsc ar (mce [100, 100.3 .. 110]) 0 3 | (val,_ix) = unmce2 (X.arrayMax son) 4 | in mce2 (son * 0.02) (leakDC val 0.995 * 0.02) -- the operation tends to induce DC offset 5 | -------------------------------------------------------------------------------- /Help/Ugen/arrayMin.help.hs: -------------------------------------------------------------------------------- 1 | -- arrayMin 2 | let son = sinOsc ar (mce [100, 100.3 .. 110]) 0 3 | (val,_ix) = unmce2 (X.arrayMin son) 4 | in mce2 (son * 0.02) (leakDC val 0.995 * 0.02) -- the operation tends to induce DC offset 5 | -------------------------------------------------------------------------------- /Help/Ugen/asin.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "ArcSin" 3 | Sound.Sc3.Plot.plot_fn_r1_ln asin (-1,1) 4 | -------------------------------------------------------------------------------- /Help/Ugen/atan.help.hs: -------------------------------------------------------------------------------- 1 | -- atan ; Sound.Sc3.Plot.plot_fn_r1_ln atan (-5,5) 2 | sinOsc ar (atan (sinOsc kr 0.5 0) * 200 + 300) 0 * 0.05 3 | -------------------------------------------------------------------------------- /Help/Ugen/atan2.help.hs: -------------------------------------------------------------------------------- 1 | -- atan2 ; pan hypot doppler example, atan2 finds direction of source, speakers at +/- 45 degrees 2 | let x = 10 3 | y = lfSaw kr (1 / 6) 0 * 100 4 | d = hypot x y 5 | a = 40 / (squared d) 6 | s = rlpf (fSinOsc ar 200 0 * lfPulse ar 31.3 0 0.4) 400 0.3 7 | z = atan2E y x 8 | l = clip2 (z / (pi / 2)) 1 9 | in pan2 (delayL s (110 / 344) (d / 344)) l a 10 | -------------------------------------------------------------------------------- /Help/Ugen/audioMSG.help.hs: -------------------------------------------------------------------------------- 1 | -- audioMSG 2 | X.audioMSG (sinOsc ar 220 0 * 0.05) (mouseX kr 0 (2 * pi) Linear 0.2) 3 | 4 | -- audioMSG ; warning=feedback 5 | X.audioMSG (soundIn 0) (mouseX kr 0 (2 * pi) Linear 0.2) 6 | -------------------------------------------------------------------------------- /Help/Ugen/bBandPass.help.hs: -------------------------------------------------------------------------------- 1 | -- bBandPass ; warning=feedback 2 | let i = soundIn 0 3 | f = mouseX kr 20 20000 Exponential 0.2 4 | bw = mouseY kr 0 10 Linear 0.2 5 | in bBandPass i f bw 6 | 7 | -- bBandPass ; calculate coefficients and use sos ; warning=feedback 8 | let i = soundIn 0 9 | f = mouseX kr 20 20000 Exponential 0.2 10 | bw = mouseY kr 0 10 Linear 0.2 11 | (a0, a1, a2, b1, b2) = Sound.Sc3.Common.Math.Filter.Beq.bBandPassCoef sampleRate f bw 12 | in sos i a0 a1 a2 b1 b2 13 | -------------------------------------------------------------------------------- /Help/Ugen/bHiPass.help.hs: -------------------------------------------------------------------------------- 1 | -- bHiPass 2 | let i = pinkNoiseId 'α' ar 3 | f = mouseX kr 10 20000 Exponential 0.2 4 | rq = mouseY kr 0 1 Linear 0.2 5 | in bHiPass i f rq * 0.05 6 | 7 | -- bHiPass ; calculate coefficients and use sos (see also bHiPass4) 8 | let i = pinkNoiseId 'α' ar 9 | f = mouseX kr 10 20000 Exponential 0.2 10 | rq = mouseY kr 0 1 Linear 0.2 11 | (a0, a1, a2, b1, b2) = Sound.Sc3.Common.Math.Filter.Beq.bHiPassCoef sampleRate f rq 12 | in sos i a0 a1 a2 b1 b2 * 0.05 13 | -------------------------------------------------------------------------------- /Help/Ugen/bHiPass4.help.hs: -------------------------------------------------------------------------------- 1 | -- bHiPass4 2 | let i = mix (saw ar (mce [0.99, 1, 1.01] * 440) * 0.3) 3 | f = mouseX kr 20 20000 Exponential 0.2 4 | rq = mouseY kr 0.1 1 Linear 0.2 5 | in bHiPass4 i f rq 6 | -------------------------------------------------------------------------------- /Help/Ugen/bLowPass4.help.hs: -------------------------------------------------------------------------------- 1 | -- bLowPass4 2 | let i = mix (saw ar (mce [0.99, 1, 1.01] * 440) * 0.3) 3 | f = mouseX kr 100 20000 Exponential 0.2 4 | rq = mouseY kr 0.1 1 Linear 0.2 5 | in bLowPass4 i f rq 6 | -------------------------------------------------------------------------------- /Help/Ugen/beatTrack.help.hs: -------------------------------------------------------------------------------- 1 | -- beatTrack 2 | let c = localBufId 'α' 1 1024 3 | i = soundIn 0 4 | x = mouseX kr (-1) 1 Linear 0.2 5 | [b, h, q, t] = mceChannels (beatTrack kr (fft' c i) x) 6 | f = mce [440, 660, 880] 7 | a = mce [0.4, 0.2, 0.1] 8 | s = mix (sinOsc ar f 0 * a * decay (mce [b, h, q]) 0.05) 9 | in i + s 10 | 11 | 12 | -------------------------------------------------------------------------------- /Help/Ugen/blitB3.help.hs: -------------------------------------------------------------------------------- 1 | -- blitB3 2 | X.blitB3 ar (xLine kr 10000 20 10 DoNothing) * 0.2 3 | 4 | -- blitB3 ; spot the aliasing 5 | impulse ar (xLine kr 10000 20 10 DoNothing) 0 * 0.2 6 | 7 | -- blitB3 ; sawtooth 8 | let x = mouseX kr 20 1000 Exponential 0.2 9 | in leakDC (integrator (X.blitB3 ar x * 0.2) 0.99) 0.995 10 | 11 | -- blitB3 ; sawtooth, super-saw, can integrate, accumulates DC 12 | let x = mouseX kr 1 4 Linear 0.2 13 | in mix (leakDC (integrator (X.blitB3 ar (x * mce [220,221,223,224]) * 0.125) 0.99) 0.995) 14 | -------------------------------------------------------------------------------- /Help/Ugen/blitB3Saw.help.hs: -------------------------------------------------------------------------------- 1 | -- blitB3Saw 2 | let f = xLine kr 1000 20 10 DoNothing 3 | in X.blitB3Saw ar f 0.99 * 0.1 4 | 5 | -- blitB3Saw ; aliasing suddenly appears for very high frequencies 6 | let f = mouseX kr 10 10000 Exponential 0.2 7 | c = mouseY kr 0.01 0.99 Linear 0.2 8 | in X.blitB3Saw ar f c * 0.1 9 | 10 | -- blitB3Saw ; comparison 11 | mce2 (saw ar 20) (X.blitB3Saw ar 20 0.99) * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/blockSize.help.hs: -------------------------------------------------------------------------------- 1 | -- blockSize ; default block size is 64 samples 2 | sinOsc ar (mce2 (blockSize * 3) (64 * 3 + 1)) 0 * 0.1 3 | 4 | -- blockSize 5 | sinOsc ar (mce2 (blockSize * 3) ((controlDur * sampleRate * 3) + 1)) 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/bpz2.help.hs: -------------------------------------------------------------------------------- 1 | -- bpz2 2 | let n = whiteNoiseId 'α' ar in bpz2 (n * 0.1) 3 | -------------------------------------------------------------------------------- /Help/Ugen/brf.help.hs: -------------------------------------------------------------------------------- 1 | -- brf 2 | let i = saw ar 200 * 0.1 3 | freq = fSinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3800 + 4000 4 | rq = 0.3 5 | in brf i freq rq 6 | -------------------------------------------------------------------------------- /Help/Ugen/brownNoise.help.hs: -------------------------------------------------------------------------------- 1 | -- brownNoise 2 | brownNoiseId 'α' ar * 0.1 3 | 4 | -- brownNoise ; kr rate noise as frequency control 5 | let n = brownNoiseId 'α' kr 6 | in sinOsc ar (linExp n (-1) 1 64 9600) 0 * 0.1 7 | 8 | ---- ; drawings 9 | Sound.Sc3.Plot.plot_ugen1 0.1 (brownNoiseId 'γ' ar) 10 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.1 (brownNoiseId 'γ' ar) 11 | UI.ui_sc3_scope_freq (600,400) 0 12 | -------------------------------------------------------------------------------- /Help/Ugen/brz2.help.hs: -------------------------------------------------------------------------------- 1 | -- brz2 2 | let n = whiteNoiseId 'α' ar * 0.05 3 | x = mouseX kr (-1) 1 Linear 0.1 4 | in xFade2 n (brz2 n) x 1 5 | -------------------------------------------------------------------------------- /Help/Ugen/bufAllpassC.help.hs: -------------------------------------------------------------------------------- 1 | -- bufAllpassC ; filtered decaying noise bursts 2 | let b = localBufId 'α' 1 44100 3 | d = dustId 'β' ar 1 4 | n = whiteNoiseId 'γ' ar 5 | x = decay d 0.2 * n * 0.25 6 | in bufAllpassC b x 0.25 6 7 | -------------------------------------------------------------------------------- /Help/Ugen/bufAllpassL.help.hs: -------------------------------------------------------------------------------- 1 | -- bufAllpassL ; filtered decaying noise bursts 2 | let b = localBufId 'α' 1 44100 3 | d = dustId 'β' ar 1 4 | n = whiteNoiseId 'γ' ar 5 | x = decay d 0.2 * n * 0.25 6 | in bufAllpassL b x 0.25 6 7 | -------------------------------------------------------------------------------- /Help/Ugen/bufAllpassN.help.hs: -------------------------------------------------------------------------------- 1 | -- bufAllpassN ; filtered decaying noise bursts 2 | let b = localBufId 'α' 1 44100 3 | d = dustId 'β' ar 1 4 | n = whiteNoiseId 'γ' ar 5 | x = decay d 0.2 * n * 0.25 6 | in bufAllpassN b x 0.25 6 7 | -------------------------------------------------------------------------------- /Help/Ugen/bufChannels.help.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/bufChannels.help.hs -------------------------------------------------------------------------------- /Help/Ugen/bufCombL.help.hs: -------------------------------------------------------------------------------- 1 | -- bufCombL ; comb filter as resonator ; resonant fundamental is reciprocal of the delay time 2 | let b = localBufId 'α' 1 44100 3 | n = whiteNoiseId 'β' ar 4 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 5 | in bufCombL b (n * 0.1) dt 0.2 * 0.05 6 | 7 | -------------------------------------------------------------------------------- /Help/Ugen/bufCombN.help.hs: -------------------------------------------------------------------------------- 1 | -- bufCombN ; comb filter as resonator ; resonant fundamental is reciprocal of the delay time 2 | let b = localBufId 'α' 1 44100 3 | n = whiteNoiseId 'β' ar 4 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 5 | in bufCombN b (n * 0.1) dt 0.2 * 0.05 6 | 7 | -------------------------------------------------------------------------------- /Help/Ugen/bufDelayL.help.hs: -------------------------------------------------------------------------------- 1 | -- bufDelayL 2 | let b = localBufId 'α' 1 44100 3 | o = sinOsc ar (lfNoise2Id 'β' kr 0.5 * 100 + 110) 0 * 0.05 4 | d = abs (lfNoise2Id 'γ' kr 0.25) 5 | in mce2 o (bufDelayL b o d) 6 | -------------------------------------------------------------------------------- /Help/Ugen/bufDelayN.help.hs: -------------------------------------------------------------------------------- 1 | -- bufDelayN 2 | let b = localBufId 'α' 1 44100 3 | o = sinOsc ar (lfNoise2Id 'β' kr 0.5 * 100 + 110) 0 * 0.05 4 | d = abs (lfNoise2Id 'γ' kr 0.25) 5 | in mce2 o (bufDelayN b o d) 6 | -------------------------------------------------------------------------------- /Help/Ugen/bufFrames.help.hs: -------------------------------------------------------------------------------- 1 | -- bufFrames ; requires=buf ; read without loop, trigger reset based on buffer duration 2 | let (b, nc) = (control kr "buf" 100, 2) 3 | p = phasor ar 0 (bufRateScale kr b) 0 (bufFrames kr b) 0 4 | in bufRdL nc ar b p NoLoop * 0.1 5 | 6 | -- bufFrames ; requires=buf ; mouse location drags play head 7 | let (b, nc) = (control kr "buf" 100, 2) 8 | r = mce [0.05, 0.075 .. 0.15] 9 | p = k2a (mouseX kr 0 (bufFrames kr b) Linear r) 10 | in mix (bufRdL nc ar b p NoLoop) * 0.1 11 | 12 | ---- ; buffer setup 13 | withSc3 (async (b_allocRead 0 (sfResolve "pf-c5.aif") 0 0)) 14 | -------------------------------------------------------------------------------- /Help/Ugen/bufGrain.help.hs: -------------------------------------------------------------------------------- 1 | -- bufGrain ; requires=buf 2 | let b = control kr "buf" 100 3 | x = mouseX kr 0.5 8 Linear 0.2 4 | y = mouseY kr 0.05 0.2 Linear 0.2 5 | e = envGen kr 1 1 0 1 RemoveSynth (envelope [0, 1, 0] [3, 2] [EnvSin, EnvSin]) 6 | in X.bufGrain ar (impulse kr 10 0) y b x e 2 7 | 8 | ---- ; load buffer 9 | withSc3 (async (b_allocRead 0 (sfResolve "instr/celeste/long/13-C4-long.wav") 0 0)) 10 | -------------------------------------------------------------------------------- /Help/Ugen/bufSampleRate.help.hs: -------------------------------------------------------------------------------- 1 | -- bufSampleRate ; requires=buf ; frequency as fraction of buffer sample-rate (ie. 48000 / 100 == 480) 2 | let b = control kr "buf" 100 3 | f = mce [bufSampleRate kr b * 0.01, 440] 4 | in sinOsc ar f 0 * 0.1 5 | 6 | ---- ; buffer setup 7 | withSc3 (async (b_allocRead 0 (sfResolve "pf-c5.aif") 0 0)) 8 | -------------------------------------------------------------------------------- /Help/Ugen/changed.help.hs: -------------------------------------------------------------------------------- 1 | -- changed ; simple composition of hpz1 and greater_than (pseudo ugen) 2 | let s = lfNoise0Id 'α' kr 2 3 | c = changed s 0 4 | c' = decay2 c 0.01 0.5 5 | in sinOsc ar (440 + mce2 s c' * 440) 0 * 0.1 6 | 7 | -- changed ; sinOsc is constantly changing 8 | let s = sinOsc ar 440 0 9 | c = changed s 0 10 | in s * c * 0.2 11 | 12 | -- changed ; fixed number of sample impulses ; https://fredrikolofsson.com/f0blog/impulse-train/ 13 | let dur = 1 14 | num = 8 15 | in changed (min (ceil (sweep ar 0 (num / dur))) num) 0 16 | -------------------------------------------------------------------------------- /Help/Ugen/checkBadValues.help.hs: -------------------------------------------------------------------------------- 1 | -- checkBadValues ; when frequency is nan set gain to zero 2 | let freq = tChoose (impulse kr 1 0) (mce2 440 (0 / 0)) 3 | isNormal = checkBadValues freq 0 0 `equal_to` 0 4 | in sinOsc ar freq 0 * 0.1 * isNormal 5 | -------------------------------------------------------------------------------- /Help/Ugen/choose.help.hs: -------------------------------------------------------------------------------- 1 | -- choose ; a composite of iRand and select 2 | let f = mceFillId 'α' 2 (\z _ -> chooseId z (mce [440,460 .. 880])) 3 | in sinOsc ar f 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/chromagram.help.hs: -------------------------------------------------------------------------------- 1 | -- chromagram 2 | let sig = soundIn 0 3 | chn = fft' (localBufId 'α' 1 2048) sig 4 | chroma = X.chromagram kr chn 2048 12 (midiCps 24) 8 0 0.9 2 0 5 | in splay (sinOsc ar (mce (map midiCps [60 .. 71])) 0 * lag chroma 0.1 * 0.2) 1 1 0 True 6 | -------------------------------------------------------------------------------- /Help/Ugen/circleRamp.help.hs: -------------------------------------------------------------------------------- 1 | -- circleRamp ; fast x-axis movements from edges will wrap outside (no discontinuity) 2 | let x = mouseX kr 0 2 Linear 0.2 3 | c = X.circleRamp kr x 0.1 (-1) 1 4 | in pan2 (sinOsc ar 440 0) c 0.1 5 | 6 | -- circleRamp ; editing lagTime to alter path taken 7 | let p = lfPulse kr (line kr 20 0.1 10 DoNothing) 0 0.75 + 0.25 8 | c = X.circleRamp kr p (mouseX kr 0.01 0.1 Linear 0.1) (-1) 1 9 | in pan2 (sinOsc ar 440 0) c 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/clearBuf.help.hs: -------------------------------------------------------------------------------- 1 | -- clearBuf 2 | let buf = clearBuf (localBuf 1 2048) 3 | x = mouseX kr 1 2 Linear 0.2 4 | r = playBuf 1 ar buf x 1 0 Loop DoNothing * 0.1 5 | wr p i = bufWr buf (p `in_range` (0,bufFrames kr buf)) Loop i 6 | in mrg2 r (wr (lfNoise0 ar 530) (whiteNoise ar)) 7 | 8 | -- clearBuf ; id 9 | let buf = clearBuf (localBufId 'α' 1 2048) 10 | x = mouseX kr 1 2 Linear 0.2 11 | r = playBuf 1 ar buf x 1 0 Loop DoNothing * 0.1 12 | wr p i = bufWr buf (p `in_range` (0,bufFrames kr buf)) Loop i 13 | in mrg2 r (wr (lfNoise0Id 'β' ar 530) (whiteNoiseId 'γ' ar)) 14 | 15 | -------------------------------------------------------------------------------- /Help/Ugen/clip.help.hs: -------------------------------------------------------------------------------- 1 | -- clip 2 | clip (sinOsc ar 440 0 * 0.4) (-0.25) 0.25 3 | -------------------------------------------------------------------------------- /Help/Ugen/clip2.help.hs: -------------------------------------------------------------------------------- 1 | -- clip2 ; clipping distortion 2 | clip2 (fSinOsc ar 400 0) 0.01 3 | 4 | -- clip2 5 | clip2 (fSinOsc ar 400 0) (line kr 0 1 8 RemoveSynth) * 0.1 6 | 7 | ---- ; drawings 8 | Sound.Sc3.Plot.plot_fn_r1_ln (\x -> clip2 x 1) (-2,2) 9 | -------------------------------------------------------------------------------- /Help/Ugen/clipNoise.help.hs: -------------------------------------------------------------------------------- 1 | -- clipNoise 2 | clipNoiseId 'α' ar * 0.1 3 | 4 | ---- ; drawings 5 | Sound.Sc3.Plot.plot_ugen1 0.01 (clipNoiseId 'α' ar) 6 | -------------------------------------------------------------------------------- /Help/Ugen/coinGate.help.hs: -------------------------------------------------------------------------------- 1 | -- coinGate 2 | let g = coinGateId 'α' 0.2 (impulse kr 10 0) 3 | f = tRandId 'β' 300.0 400.0 g 4 | in sinOsc ar f 0 * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/combC.help.hs: -------------------------------------------------------------------------------- 1 | -- combC ; c.f. combN 2 | let n = whiteNoiseId 'α' ar * 0.02 3 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 4 | in combC n 0.01 dt 0.2 5 | 6 | -- combC ; with negative feedback 7 | let n = whiteNoiseId 'α' ar * 0.02 8 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 9 | in combC n 0.01 dt (-0.2) 10 | 11 | -- combC ; as an echo 12 | let d = dustId 'α' ar 1 13 | n = whiteNoiseId 'β' ar * 0.1 14 | i = decay d 0.2 * n 15 | in combC i 0.2 0.2 3 16 | -------------------------------------------------------------------------------- /Help/Ugen/combL.help.hs: -------------------------------------------------------------------------------- 1 | -- combL ; c.f. combN 2 | let n = whiteNoiseId 'α' ar * 0.02 3 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 4 | in combL n 0.01 dt 0.2 5 | 6 | -------------------------------------------------------------------------------- /Help/Ugen/combN.help.hs: -------------------------------------------------------------------------------- 1 | -- combN ; comb filter as resonator, the resonant fundamental is equal to reciprocal of the delay time 2 | let n = whiteNoiseId 'α' ar * 0.02 3 | dt = xLine kr 0.0001 0.01 20 RemoveSynth 4 | in combN n 0.01 dt 0.2 5 | -------------------------------------------------------------------------------- /Help/Ugen/complexRes.help.hs: -------------------------------------------------------------------------------- 1 | -- complexRes 2 | let s = pulse ar 0.1 0.001 * 0.1 3 | fr = 50 + 5000 * sinOsc ar 50 0 4 | dt = 0.5 5 | in X.complexRes s fr dt 6 | -------------------------------------------------------------------------------- /Help/Ugen/concat.help.hs: -------------------------------------------------------------------------------- 1 | -- concat ; requires=buf ; granulator 2 | let (b, nc) = (control kr "buf" 100, 2) 3 | y0 = mouseY kr 0.01 1 Linear 0.2 4 | y1 = mouseY kr b 100 Linear 0.2 5 | n = lfNoise0Id 'α' kr y0 * 3 + 4.5 6 | k = saw ar (sinOsc kr n 0 * 10 + y1) 7 | i = playBuf nc ar b (bufRateScale kr b) 0 0 Loop DoNothing 8 | x0 = mouseX kr 0.01 0.1 Linear 0.2 9 | y2 = mouseY kr 0 0.1 Linear 0.2 10 | c = X.concat ar k i 2 2 2 x0 0 y2 1 0.5 0 0 11 | in pan2 c 0 1 12 | 13 | ---- ; buffer setup 14 | withSc3 (async (b_allocRead 0 (sfResolve "pf-c5.aif") 0 0)) 15 | -------------------------------------------------------------------------------- /Help/Ugen/controlDur.help.hs: -------------------------------------------------------------------------------- 1 | -- controlDur ; default block size = 64, default sample rate = 48000 2 | sinOsc ar (mce2 (recip controlDur) (controlRate + 1)) 0 * 0.1 3 | 4 | -- controlDur 5 | sinOsc ar (mce2 (recip controlDur) (recip (blockSize / sampleRate) + 1)) 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/controlRate.help.hs: -------------------------------------------------------------------------------- 1 | -- controlRate ; play a sine tone at control rate, the reciprocal of controlDur 2 | let f = mce2 controlRate (recip controlDur) 3 | in sinOsc ar f 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/convolution.help.hs: -------------------------------------------------------------------------------- 1 | -- convolution ; warning=feedback 2 | let k = pinkNoise ar * 0.1 3 | i = soundIn 0 4 | in convolution i k 2048 5 | 6 | -- convolution ; warning=feedback 7 | let k = mix (lfSaw ar (mce [300,500,800,1000] * mouseX kr 1.0 2.0 Linear 0.2) 0 * 0.1) 8 | i = soundIn 0 9 | in convolution i k 1024 * 0.5 10 | 11 | -- convolution ; warning=feedback ; id 12 | let k = pinkNoiseId 'α' ar * 0.1 13 | i = soundIn 0 14 | in convolution i k 2048 15 | -------------------------------------------------------------------------------- /Help/Ugen/cos.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "Cos" 3 | Sound.Sc3.Plot.plot_fn_r1_ln cos (0,2 * pi) 4 | -------------------------------------------------------------------------------- /Help/Ugen/cosh.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "CosH" 3 | Sound.Sc3.Plot.plot_fn_r1_ln cosh (-4,4) 4 | -------------------------------------------------------------------------------- /Help/Ugen/coyote.help.hs: -------------------------------------------------------------------------------- 1 | -- coyote 2 | let i = soundIn 0 3 | c = X.coyote kr i 0.2 0.2 0.01 0.5 0.05 0.1 4 | o = pinkNoiseId 'α' ar * decay c 1 * 0.25 5 | in mce2 (i * 0.25) o 6 | -------------------------------------------------------------------------------- /Help/Ugen/crackle.help.hs: -------------------------------------------------------------------------------- 1 | -- crackle 2 | crackle ar 1.95 * 0.2 3 | 4 | -- crackle ; modulate chaos parameter 5 | crackle ar (line kr 1.0 2.0 3 RemoveSynth) * 0.2 6 | 7 | ---- ; drawings 8 | Sound.Sc3.Plot.plot_ugen1 0.01 (crackle ar 1.95) 9 | Sound.Sc3.Plot.plot_ugen1 0.025 (crackle ar (line kr 1.0 2.0 0.025 DoNothing)) 10 | -------------------------------------------------------------------------------- /Help/Ugen/crest.help.hs: -------------------------------------------------------------------------------- 1 | -- crest ; mouse varies from sinewave (left) to almost-square (right) 2 | let sig = (sinOsc ar (mouseY kr 100 1000 Exponential 0.1) 0 * mouseX kr 1 10 Linear 0.2) `clip2` 1 3 | val = X.crest kr sig 440 1 4 | in mce2 sig (sinOsc ar (lag val 0.2 * 400) 0) * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/crossoverDistortion.help.hs: -------------------------------------------------------------------------------- 1 | -- crossoverDistortion 2 | let x = mouseX kr 0 1 Linear 0.2 3 | y = mouseY kr 0 1 Linear 0.2 4 | in X.crossoverDistortion (sinOsc ar (mce2 400 404) 0 * 0.2) x y 5 | 6 | -- crossoverDistortion 7 | let x = mouseX kr 0 1 Linear 0.2 8 | y = mouseY kr 0 1 Linear 0.2 9 | in X.crossoverDistortion (soundIn 0) x y 10 | -------------------------------------------------------------------------------- /Help/Ugen/cuspN.help.hs: -------------------------------------------------------------------------------- 1 | -- cuspN ; vary frequency 2 | let x = mouseX kr 20 (sampleRate / 2) Linear 0.1 3 | in cuspN ar x 1.0 1.99 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/dNoiseRing.help.hs: -------------------------------------------------------------------------------- 1 | -- dNoiseRing 2 | let tr = impulse ar 10 0 3 | x = mouseX kr 0 1 Linear 0.2 4 | y = mouseY kr 0 1 Linear 0.2 5 | nr = demand tr 0 (X.dNoiseRingId 'α' x y 1.0 32.0 0.0) 6 | freq = midiCps (linLin nr 0 (2 ** 32) 40 (40 + 48)) 7 | in sinOsc ar freq 0 * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/dbAmp.help.hs: -------------------------------------------------------------------------------- 1 | -- dbAmp ; linear db motion is exponential amplitude decay 2 | fSinOsc ar 800 0 * dbAmp (line kr (-24) (-48) 10 RemoveSynth) 3 | 4 | ---- ; there is a non-UGen variant 5 | dbAmp (-26::Double) == 0.05011872336272722 6 | -------------------------------------------------------------------------------- /Help/Ugen/dbrown.help.hs: -------------------------------------------------------------------------------- 1 | -- dbrown 2 | let n = dbrownId 'α' dinf 0 15 1 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | 8 | -- dbrown 9 | let n = demand (impulse kr 10 0) 0 (dbrownId 'α' dinf (-1) 1 0.05) 10 | f = linExp n (-1) 1 64 9600 11 | in sinOsc ar f 0 * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/dc.help.hs: -------------------------------------------------------------------------------- 1 | -- dc ; zero 2 | dc ar 0 3 | 4 | -- dc ; offset, clicks on start and finish 5 | dc ar 0.5 6 | 7 | -- dc ; offset, clicks on start and finish 8 | dc ar 0.5 + sinOsc ar 440 0 * 0.1 9 | 10 | -- dc ; transient before LeakDC adapts and suppresses the offset 11 | leakDC (dc ar 1) 0.995 12 | -------------------------------------------------------------------------------- /Help/Ugen/dconst.help.hs: -------------------------------------------------------------------------------- 1 | -- dconst ; fast notes of random duration for 0.5 seconds, then a single note for 0.5 seconds 2 | let dexprandId z rp l r = lin_exp (dwhiteId z rp 0 1) 0 1 l r -- there is no Dexprand 3 | t = dconstId 'α' 0.5 (dwhiteId 'β' dinf 0.05 0.08) 0.001 4 | f = duty kr (dseqId 'γ' dinf (mce2 t 0.5)) 0 DoNothing (dexprandId 'δ' dinf 200 600) 5 | in varSaw ar (lag f 0.02) 0 0.3 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/decay.help.hs: -------------------------------------------------------------------------------- 1 | -- decay ; as envelope 2 | let n = pinkNoiseId 'α' ar + sinOsc ar 11000 0 3 | s = impulse ar (xLine kr 1 50 20 RemoveSynth) 0.25 4 | in decay s 0.05 * n 5 | 6 | ---- ; drawings 7 | Sound.Sc3.Plot.plot_ugen1 0.05 (decay (impulse ar 1 0) 0.01) 8 | -------------------------------------------------------------------------------- /Help/Ugen/decay2.help.hs: -------------------------------------------------------------------------------- 1 | -- decay2 ; used as an envelope 2 | let s = fSinOsc ar 600 0 * 0.25 -- sinOsc ar 11000 0 * 0.25 3 | f = xLine kr 1 50 20 RemoveSynth 4 | in decay2 (impulse ar f 0) 0.01 0.2 * s 5 | 6 | -- decay2 ; compare with decay used as the envelope 7 | let s = fSinOsc ar 600 0 * 0.25 8 | f = xLine kr 1 50 20 RemoveSynth 9 | in decay (impulse ar f 0) 0.2 * s 10 | 11 | ---- ; drawings ; attack and decay are a difference of two decays, hence inversion 12 | Sound.Sc3.Plot.plot_ugen1 0.05 (decay2 (impulse ar 1 0) 0.001 0.01) 13 | Sound.Sc3.Plot.plot_ugen1 0.05 (decay2 (impulse ar 1 0) 0.01 0.001) 14 | -------------------------------------------------------------------------------- /Help/Ugen/decodeB2.help.lhs: -------------------------------------------------------------------------------- 1 | > Sound.Sc3.UGen.Help.viewSc3Help "DecodeB2" 2 | > Sound.Sc3.UGen.DB.ugenSummary "DecodeB2" 3 | 4 | > import Sound.Sc3 5 | 6 | fails..., but so does sclang... 7 | 8 | > let {p = pinkNoiseId 'α' ar 9 | > ;mx = mouseX kr (-1) 1 Linear 0.2 10 | > ;my = mouseY kr 0 0.1 Linear 0.2 11 | > ;[w,x,y] = mceChannels (panB2 p mx my) 12 | > ;o = decodeB2 2 w x y 0.5} 13 | > in audition (out 0 o) 14 | -------------------------------------------------------------------------------- /Help/Ugen/degreeToKey.help.hs: -------------------------------------------------------------------------------- 1 | -- degreeToKey ; modal space, mouse x controls discrete pitch in dorian mode 2 | let buf = (asLocalBufId 'β' [0,2,3.2,5,7,9,10]) 3 | x = mouseX kr 0 15 Linear 0.1 4 | k = degreeToKey buf x 12 5 | f b = let n = lfNoise1Id 'α' kr (mce [3,3.05]) 6 | o = sinOsc ar (midiCps (b + k + n * 0.04)) 0 * 0.1 7 | t = lfPulse ar (midiCps (mce [48,55])) 0.15 0.5 8 | d = rlpf t (midiCps (sinOsc kr 0.1 0 * 10 + b)) 0.1 * 0.1 9 | m = o + d 10 | in combN m 0.31 0.31 2 + m 11 | in (f 48 + f 72) * 0.25 12 | -------------------------------------------------------------------------------- /Help/Ugen/delTapWr.help.hs: -------------------------------------------------------------------------------- 1 | -- delTapWr 2 | let b = localBufId 'α' 1 48000 3 | src = whiteNoiseId 'β' ar * 0.2 * decay (dustId 'γ' kr 3) 0.2 4 | tapPhase = delTapWr b src 5 | (tap1,tap2,tap3) = unmce3 (delTapRd b tapPhase (mce3 0.2 0.27 0.303) 1 * mce3 1 0.4 0.2) 6 | in mce2 (src + tap2) (tap1 + tap3) 7 | -------------------------------------------------------------------------------- /Help/Ugen/delay1.help.hs: -------------------------------------------------------------------------------- 1 | -- delay1 2 | let s = impulse ar 1 0 * 0.25 in s + (delay1 s) 3 | 4 | -- delay1 ; left=original, right=subtract delayed from original 5 | let z = dustId 'α' ar 1000 * 0.1 in mce2 z (z - delay1 z) 6 | -------------------------------------------------------------------------------- /Help/Ugen/delay2.help.hs: -------------------------------------------------------------------------------- 1 | -- delay2 2 | let s = impulse ar 1 0 * 0.25 in s + (delay2 s) 3 | -------------------------------------------------------------------------------- /Help/Ugen/delayC.help.hs: -------------------------------------------------------------------------------- 1 | -- delayC ; c.f. delayN ; no zipper noise 2 | let i = sinOsc ar 320 0 * 0.1 3 | maxdelaytime = 0.005 4 | delaytime = mouseX kr 0.0 maxdelaytime Linear 0.15 5 | in i + delayC i maxdelaytime delaytime 6 | -------------------------------------------------------------------------------- /Help/Ugen/delayL.help.hs: -------------------------------------------------------------------------------- 1 | -- delayL ; c.f. delayN & delayC 2 | let t = mouseX kr 0.001 0.2 Exponential 0.2 3 | s = impulse ar 1 0 4 | d = delayL s 0.6 t 5 | in mce2 d s 6 | -------------------------------------------------------------------------------- /Help/Ugen/detectIndex.help.hs: -------------------------------------------------------------------------------- 1 | -- detectIndex ; find indexes and map to an audible frequency range 2 | let n = 6 3 | x = floorE (mouseX kr 0 n Linear 0.1) 4 | i = detectIndex (asLocalBufId 'α' [2,3,4,0,1,5]) x 5 | in sinOsc ar (linExp i 0 n 200 700) 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/detectSilence.help.hs: -------------------------------------------------------------------------------- 1 | -- detectSilence 2 | let s = sinOsc ar 440 0 * mouseY kr 0 0.2 Linear 0.1 3 | d = detectSilence s 0.01 0.1 RemoveSynth 4 | in mrg [s,d] 5 | -------------------------------------------------------------------------------- /Help/Ugen/dfm1.help.hs: -------------------------------------------------------------------------------- 1 | -- dfm1 ; mouse control 2 | let n = pinkNoiseId 'α' ar * 0.5 3 | x = mouseX kr 80 5000 Exponential 0.1 4 | y = mouseY kr 0.1 1.2 Linear 0.1 5 | in X.dfm1 n x y 1 0 3e-4 6 | 7 | -- dfm1 ; bass 8 | let i = mix (pulse ar (mce2 100 100.1) 0.5) * 0.4 9 | f = range 80 2000 (sinOsc kr (range 0.2 5 (sinOsc kr 0.3 0)) 0) 10 | in X.dfm1 i f 1.1 2 0 0.0003 * 0.1 11 | -------------------------------------------------------------------------------- /Help/Ugen/dgeom.help.hs: -------------------------------------------------------------------------------- 1 | -- dgeom 2 | let n = dgeomId 'α' 15 1 1.2 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/dibrown.help.hs: -------------------------------------------------------------------------------- 1 | -- dibrown ; c.f. dbrown 2 | let n = dibrownId 'α' dinf 0 15 1 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/difSqr.help.hs: -------------------------------------------------------------------------------- 1 | -- difSqr 2 | let o1 = fSinOsc ar 800 0 3 | o2 = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in difSqr o1 o2 * 0.1 5 | 6 | -- difSqr ; written out 7 | let o1 = fSinOsc ar 800 0 8 | o2 = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in (o1 * o1 - o2 * o2) * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/disintegrator.help.hs: -------------------------------------------------------------------------------- 1 | -- disintegrator 2 | let x = mouseX kr 0 1 Linear 0.2 3 | y = mouseY kr 0 1 Linear 0.2 4 | s = sinOsc ar (mce2 400 404) 0 * 0.05 5 | in X.disintegratorId 'α' s x y 6 | -------------------------------------------------------------------------------- /Help/Ugen/diskIn.help.hs: -------------------------------------------------------------------------------- 1 | -- diskIn ; requires=dsk ; c.f. sndfileIn 2 | let (buf, nc) = (control kr "dsk" 0, 2) in diskIn nc buf Loop 3 | 4 | ---- ; setup & cleanup 5 | {fn = sfResolve "20.2-LW+RD.flac";nc = 2;dsk = 0} 6 | withSc3 (mapM_ async [b_alloc dsk 65536 2,b_read dsk fn 0 (-1) 0 True]) 7 | withSc3 (mapM_ async [b_close dsk,b_free dsk]) 8 | -------------------------------------------------------------------------------- /Help/Ugen/distort.help.hs: -------------------------------------------------------------------------------- 1 | -- distort 2 | distort (fSinOsc ar 500 0.0 * xLine kr 0.1 10 10 RemoveSynth) * 0.25 3 | -------------------------------------------------------------------------------- /Help/Ugen/div.help.hs: -------------------------------------------------------------------------------- 1 | -- / ; division (floating point) 2 | sinOsc ar 440 0 / 6 3 | 4 | -- / ; creates a beating effect (subaudio rate) 5 | (pinkNoiseId 'α' ar / fSinOsc kr 5 0) * 0.05 6 | 7 | -- / ; optimises identity 8 | sinOsc ar 440 0 / 1 * 0.1 9 | 10 | -- div ; integer division 11 | let d f = (sinOsc kr 0.25 0 * 200 + 500) `f` 17 12 | in sinOsc ar (midiCps (mce2 (d div) (d (/)) * 3)) 0 * mce2 0.1 0.05 13 | -------------------------------------------------------------------------------- /Help/Ugen/diwhite.help.hs: -------------------------------------------------------------------------------- 1 | -- dwhite ; c.f. dwhite 2 | let n = diwhiteId 'α' dinf (-7) 7 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = midiCps (demand t 0 n + 60) 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/dneuromodule.help.hs: -------------------------------------------------------------------------------- 1 | -- dneuromodule 2 | let dt = 0.001 3 | theta = mce2 (mouseX kr (-2) 2 Linear 0.2) (mouseY kr (-2) 2 Linear 0.2) 4 | md = X.dneuromoduleId 2 'α' 2 theta (mce2 0.1 0.3) (mce [-3,2,-2,0]) 5 | m = lag3 (duty ar dt 0 DoNothing md) dt 6 | in sinOsc ar (m * 400 + 600) 0 * 0.05 7 | -------------------------------------------------------------------------------- /Help/Ugen/done.help.hs: -------------------------------------------------------------------------------- 1 | -- done ; high tone left or low tone right 2 | let x = mouseX kr (-1) 1 Linear 0.1 3 | e = linen x 0.1 0.1 0.5 DoNothing 4 | o1 = sinOsc ar 880 0 * 0.1 5 | o2 = sinOsc ar 440 0 * e 6 | in mce [done e * o1,o2] 7 | -------------------------------------------------------------------------------- /Help/Ugen/doubleWell3.help.hs: -------------------------------------------------------------------------------- 1 | -- doubleWell3 ; bass synth 2 | let x = mouseX kr 0 200 Linear 0.2 3 | y = mouseY kr 0.5 4.0 Linear 0.2 4 | f = sinOsc ar x 0 * y 5 | in X.doubleWell3 ar 0 0.01 f 0.25 0 0 6 | 7 | -- doubleWell3 ; gradually changing 8 | let f = lfSaw ar (line kr 10 1000 10 DoNothing) 0 9 | delta = line kr 0.0 0.3 20 DoNothing 10 | in X.doubleWell3 ar 0 0.05 f delta 0 0 * 0.2 11 | -------------------------------------------------------------------------------- /Help/Ugen/dpw4Saw.help.hs: -------------------------------------------------------------------------------- 1 | -- dpw4Saw 2 | X.dpw4Saw ar (xLine kr 2000 20 10 DoNothing) * 0.1 3 | 4 | -- dpw4Saw ; c.f. saw 5 | let x = mouseX kr 200 12000 Exponential 0.2 6 | in mce2 (X.dpw4Saw ar x * 0.1) (saw ar x * 0.05) 7 | -------------------------------------------------------------------------------- /Help/Ugen/dser.help.hs: -------------------------------------------------------------------------------- 1 | -- dser 2 | let a = dserId 'α' 7 (mce [1, 3, 2, 7, 8]) 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 a * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/dseries.help.hs: -------------------------------------------------------------------------------- 1 | -- dseries 2 | let n = dseriesId 'α' 15 0 1 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/dshuf.help.hs: -------------------------------------------------------------------------------- 1 | -- dshuf 2 | let a = dseqId 'α' dinf (dshufId 'β' 3 (mce [1,3,2,7,8.5])) 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 a * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | 8 | -- dshuf 9 | let a = dseqId 'α' dinf (dshufId 'β' 5 (X.randNId 81 'γ' 0 10)) 10 | x = mouseX kr 1 10000 Exponential 0.1 11 | t = impulse ar x 0 12 | f = demand t 0 a * 30 + 340 13 | in sinOsc ar f 0 * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/dswitch.help.hs: -------------------------------------------------------------------------------- 1 | -- dswitch ; c.f. dswitch1 2 | uid_st_eval ( 3 | do a0 <- dwhiteM 2 3 4 4 | a1 <- dwhiteM 2 0 1 5 | a2 <- dseqM 2 (mce [1,1,1,0]) 6 | i <- dseqM 2 (mce [0,1,2,1,0]) 7 | d <- dswitchM i (mce [a0,a1,a2]) 8 | let t = impulse kr 4 0 9 | f = demand t 0 d * 300 + 400 10 | return (sinOsc ar f 0 * 0.1)) 11 | -------------------------------------------------------------------------------- /Help/Ugen/dswitch1.help.hs: -------------------------------------------------------------------------------- 1 | -- dswitch1 ; c.f. dswitch 2 | let x = mouseX kr 0 4 Linear 0.1 3 | y = mouseY kr 1 15 Linear 0.1 4 | t = impulse kr 3 0 5 | w = dwhiteId 'α' dinf 20 23 6 | n = dswitch1Id 'β' x (mce [1, 3, y, 2, w]) 7 | f = demand t 0 n * 30 + 340 8 | in sinOsc ar f 0 * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/dust.help.hs: -------------------------------------------------------------------------------- 1 | -- dust 2 | dustId 'α' ar 2 * 0.25 3 | 4 | -- dust 5 | let d = xLine kr 20000 2 10 RemoveSynth 6 | in dustId 'β' ar d * 0.15 7 | 8 | -- dust ; illustrate monadic constructor 9 | uid_st_eval (fmap (* 0.25) (dustM ar 200)) 10 | 11 | -- dust ; illustrate monadic constructor 12 | uid_st_eval (fmap (* 0.15) (dustM ar (xLine kr 20000 2 10 RemoveSynth))) 13 | 14 | ---- ; drawings 15 | Sound.Sc3.Plot.plot_ugen_nrt (48000,64) 0.1 (dustId 'γ' ar 300) 16 | Sound.Sc3.Plot.plot_ugen_nrt (48000,64) 0.1 (dustId 'δ' ar (xLine kr 5000 100 0.1 RemoveSynth)) 17 | 18 | -------------------------------------------------------------------------------- /Help/Ugen/dust2.help.hs: -------------------------------------------------------------------------------- 1 | -- dust2 2 | dust2Id 'α' ar 200 * 0.5 3 | 4 | -- dust2 5 | let d = xLine kr 20000 2 10 RemoveSynth 6 | in dust2Id 'β' ar d * 0.15 7 | 8 | -- dust2 ; velvet noise (approx.) 9 | let samplesPerPeriod = 20 10 | in signum (dust2Id 'α' ar (sampleRate / samplesPerPeriod)) * 0.1 11 | 12 | ---- ; drawings 13 | Sound.Sc3.Plot.plot_ugen1 0.1 (dust2Id 'γ' ar 400) 14 | Sound.Sc3.Plot.plot_ugen1 0.1 (dust2Id 'γ' ar (xLine kr 5000 100 0.1 RemoveSynth)) 15 | -------------------------------------------------------------------------------- /Help/Ugen/dwhite.help.hs: -------------------------------------------------------------------------------- 1 | -- dwhite 2 | let n = dwhiteId 'α' dinf 0 15 3 | x = mouseX kr 1 40 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | 8 | -- dwhite ; bias uniform noise to lower range 9 | let n = dwhiteId 'α' dinf 0 1 10 | l = control_m kr "l" 48 (0,127,"lin") 11 | r = control_m kr "r" 96 (0,127,"lin") 12 | t = impulse kr (control_m kr "trigFreq" 2 (0.01,12,"lin")) 0 13 | m = exp (demand t 0 n * (log r - log l) + log l) 14 | in sinOsc ar (midiCps m) 0 * 0.1 15 | 16 | ---- ; drawings 17 | UI.ui_sc3_scope 2 0 4096 1 "audio" 0 18 | -------------------------------------------------------------------------------- /Help/Ugen/dwrand.help.hs: -------------------------------------------------------------------------------- 1 | -- dwrand 2 | let n = dwrandId 'α' dinf (mce [0.3,0.2,0.1,0.2,0.2]) (mce [1,3,2,7,8]) 3 | x = mouseX kr 1 400 Exponential 0.1 4 | t = impulse kr x 0 5 | f = demand t 0 n * 30 + 340 6 | in sinOsc ar f 0 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/dwt.help.lhs: -------------------------------------------------------------------------------- 1 | > Sound.Sc3.UGen.Help.viewSc3Help "DWT" 2 | > Sound.Sc3.UGen.DB.ugenSummary "DWT" 3 | 4 | -------------------------------------------------------------------------------- /Help/Ugen/envDetect.help.hs: -------------------------------------------------------------------------------- 1 | -- envDetect 2 | let i = soundIn 0 3 | c = X.envDetect ar i 0.01 0.1 4 | p = pitch i 440 60 4000 100 16 1 0.01 0.5 1 0 5 | f = mceChannel 0 p * 3 6 | e = lagUD (mceChannel 1 p) 0 0.1 7 | o = pinkNoiseId 'α' ar * c + sinOsc ar f 0 * c * e 8 | in mce2 i o 9 | -------------------------------------------------------------------------------- /Help/Ugen/envFollow.help.hs: -------------------------------------------------------------------------------- 1 | -- envFollow 2 | let z = soundIn 0 3 | d = mouseX kr 0.990 0.999 Linear 0.2 4 | c = X.envFollow kr z d 5 | o = pinkNoiseId 'α' ar * c 6 | in mce2 z o 7 | -------------------------------------------------------------------------------- /Help/Ugen/envPairs.help.hs: -------------------------------------------------------------------------------- 1 | -- envPairs 2 | let c = EnvLin 3 | p = envPairs [(0,0),(5,0.01),(5.5,0.1),(10,0)] c 4 | e = envGen kr 1 1 0 1 RemoveSynth p 5 | in sinOsc ar 440 0 * e 6 | 7 | ---- ; plot 8 | import Sound.Sc3.Plot {- hsc3-plot -} 9 | plotEnvelope [envPairs [(0,0),(5,0.01),(5.5,0.1),(10,0)] EnvLin] 10 | plotEnvelope [envPairs [(0,1),(2.1,0.5),(3,1.4),(5,0.001)] EnvExp] 11 | plotEnvelope [envPairs [(0,110),(4,220),(9,440),(11,220),(13,880),(19,110),(23,55),(27,55)] EnvExp] 12 | 13 | ---- ; help 14 | Sound.Sc3.Common.Help.sc3_scdoc_help_open False (sc3_scdoc_help_path "Env.*pairs") 15 | -------------------------------------------------------------------------------- /Help/Ugen/envSine.help.hs: -------------------------------------------------------------------------------- 1 | -- envSine 2 | let s = envSine 9 0.1 3 | e = envGen kr 1 1 0 1 RemoveSynth s 4 | in sinOsc ar 440 0 * e 5 | 6 | ---- ; drawings 7 | Sound.Sc3.Plot.plotEnvelope [envSine 9 1,envSine 3 0.25] 8 | 9 | ---- ; help 10 | Sound.Sc3.Lang.Help.viewSc3Help "Env.*sine" 11 | -------------------------------------------------------------------------------- /Help/Ugen/envTrapezoid.help.hs: -------------------------------------------------------------------------------- 1 | -- envTrapezoid 2 | let t = envTrapezoid 0.05 0.95 3 0.1 3 | e = envGen kr 1 1 0 1 RemoveSynth t 4 | in sinOsc ar 440 0 * e 5 | 6 | ---- ; drawings 7 | Sound.Sc3.Plot.plotEnvelope [envTrapezoid 0.75 0.25 2 1,envTrapezoid 0.25 0.75 3 0.5] 8 | 9 | ---- ; coord 10 | envelope_sc3_array (envTrapezoid 0 0.25 2 0.1) == Just [0,3,-99,-99,0.1,0.5,1,0,0.1,0,1,0,0,1.5,1,0] 11 | -------------------------------------------------------------------------------- /Help/Ugen/envTriangle.help.hs: -------------------------------------------------------------------------------- 1 | -- envTriangle 2 | let t = envTriangle 1 0.1 3 | e = envGen kr 1 1 0 1 RemoveSynth t 4 | in sinOsc ar 440 0 * e 5 | 6 | ---- ; drawings 7 | Sound.Sc3.Plot.plotEnvelope [envTriangle 1 1,envTriangle 0.25 0.5] 8 | 9 | ---- ; help 10 | Sound.Sc3.Lang.Help.viewSc3Help "Env.*triangle" 11 | -------------------------------------------------------------------------------- /Help/Ugen/envXyc.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawing 2 | Sound.Sc3.Plot.plotEnvelope [envXyc [(0, 330, EnvExp), (0.5, 440, EnvExp), (1.0, 1760, EnvLin)]] 3 | 4 | ---- ; help 5 | Sound.Sc3.Common.Help.sc3_scdoc_help_open False (sc3_scdoc_help_path "Env.*xyc") 6 | -------------------------------------------------------------------------------- /Help/Ugen/excess.help.hs: -------------------------------------------------------------------------------- 1 | -- excess 2 | (fSinOsc ar 1000 0 `excess` line kr 0 1 8 DoNothing) * 0.1 3 | 4 | -- excess ; written out in terms of clip2 5 | let o = fSinOsc ar 1000 0 6 | l = line kr 0 1 8 DoNothing 7 | in (o - clip2 o l) * 0.1 8 | 9 | ---- ; drawings 10 | Sound.Sc3.Plot.plot_fn_r1_ln (\x -> excess x 1) (-2,2) 11 | -------------------------------------------------------------------------------- /Help/Ugen/expRand.help.hs: -------------------------------------------------------------------------------- 1 | -- expRand 2 | let a = line kr 0.5 0 0.01 RemoveSynth 3 | f = expRandId 'α' 100.0 8000.0 4 | in fSinOsc ar f 0 * a 5 | -------------------------------------------------------------------------------- /Help/Ugen/expRandN.help.hs: -------------------------------------------------------------------------------- 1 | -- expRandN ; two channel sin tones 2 | sinOsc ar (X.expRandNId 2 'α' 440 880) 0 * 0.1 3 | 4 | -- expRandN ; n node klang synthesis 5 | let n = 240 6 | f = X.expRandNId n 'α' 40 18000 7 | a = X.expRandNId n 'β' 0.1 0.3 8 | p = X.randNId n 'γ' (-1) 1 9 | s = klangSpec_mce f a p 10 | in klang ar 1 0 s * 0.01 11 | 12 | -- expRandN ; mce... 13 | let f = X.expRandNId 2 'α' (mce2 440 441) 442 in sinOsc ar f 0 * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/fSinOsc.help.hs: -------------------------------------------------------------------------------- 1 | -- fSinOsc ; note SC2 did not have the initial phase argument 2 | fSinOsc ar (mce2 440 550) 0 * 0.05 3 | 4 | -- fSinOsc ; modulate frequency 5 | fSinOsc ar (xLine kr 200 4000 1 RemoveSynth) 0 * 0.1 6 | 7 | -- fSinOsc ; loses amplitude towards the end 8 | let f = fSinOsc ar (xLine kr 4 401 8 RemoveSynth) 9 | in fSinOsc ar (f 0 * 200 + 800) 0 * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/fbSineL.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f fbSineC 2 | -------------------------------------------------------------------------------- /Help/Ugen/fbSineN.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. fbSineC 2 | -------------------------------------------------------------------------------- /Help/Ugen/fdiv.help.hs: -------------------------------------------------------------------------------- 1 | -- fdiv 2 | let o = fSinOsc kr 10 0.5 3 | n = pinkNoiseId 'α' ar 4 | in (n * 0.1) / (o * 0.75) 5 | -------------------------------------------------------------------------------- /Help/Ugen/fft.help.hs: -------------------------------------------------------------------------------- 1 | -- fft ; variant with default values 2 | let n = whiteNoiseId 'α' ar 3 | in ifft' (fft' (localBufId 'β' 1 2048) (n * 0.05)) 4 | 5 | -- fft ; local buffer allocating variant 6 | let s0 = sinOsc kr 0.08 0 * 6 + 6.2 7 | s1 = sinOsc kr (squared s0) 0 * 100 + 800 8 | s2 = sinOsc ar s1 0 9 | in ifft (fftAllocId 'α' 2048 s2 0.5 0 1 0) 0 0 * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/fftTrigger.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. packFFT 2 | -------------------------------------------------------------------------------- /Help/Ugen/fmGrain.help.hs: -------------------------------------------------------------------------------- 1 | -- fmGrain 2 | let t = impulse ar 20 0 3 | n = linLin (lfNoise1Id 'α' kr 1) (-1) 1 1 10 4 | s = envSine 9 0.1 5 | e = envGen kr 1 1 0 1 RemoveSynth s 6 | in X.fmGrain t 0.2 440 220 n * e 7 | -------------------------------------------------------------------------------- /Help/Ugen/fmGrainB.help.hs: -------------------------------------------------------------------------------- 1 | -- fmGrainB 2 | let b = control kr "tbl" 10 3 | t = impulse ar 20 0 4 | n = linLin (lfNoise1Id 'α' kr 1) (-1) 1 1 10 5 | s = envSine 9 0.1 6 | e = envGen kr 1 1 0 1 RemoveSynth s 7 | in X.fmGrainB t 0.2 440 220 n b * e 8 | 9 | ---- ; alloc table 10 | withSc3 (mapM_ maybe_async [b_alloc 10 512 1,b_gen_sine2 10 [Normalise,Wavetable,Clear] [(0.5,0.1)]]) 11 | -------------------------------------------------------------------------------- /Help/Ugen/fold2.help.hs: -------------------------------------------------------------------------------- 1 | -- fold2 2 | (fSinOsc ar 1000 0 `fold2` line kr 0 1 8 DoNothing) * 0.1 3 | 4 | ---- ; drawings 5 | Sound.Sc3.Plot.plot_fn_r1_ln (\x -> fold2 x 1) (-2,2) 6 | -------------------------------------------------------------------------------- /Help/Ugen/fos.help.hs: -------------------------------------------------------------------------------- 1 | -- fos ; same as OnePole 2 | let x = lfTri ar 0.4 0 * 0.99 3 | in fos (lfSaw ar 200 0 * 0.1) (1 - (abs x)) 0 x 4 | 5 | -- fos ;same as OneZero 6 | let x = lfTri ar 0.4 0 * 0.99 7 | in fos (lfSaw ar 200 0 * 0.1) (1 - (abs x)) x 0 8 | -------------------------------------------------------------------------------- /Help/Ugen/frac.help.hs: -------------------------------------------------------------------------------- 1 | -- frac ; fractional part ; jrhb ; https://www.listarc.bham.ac.uk/lists/sc-users/msg68991.html 2 | let x = mouseX kr (-10) 10 Linear 0.1 3 | y = mouseY kr 0 5 Linear 0.1 4 | i = (lfSaw kr 0.062 0 `in_range` (-10,10)) + (y * mce [0 .. 8]) 5 | d = frac i 6 | a = 0.8 - modDif d 0.5 1 7 | z1 = gcdE i x + d 8 | z2 = lcmE i x + d 9 | freq = (abs (mceTranspose (mce [z1,z2])) + 1) * 120 10 | in mix (sinOsc ar freq 0 * ampComp kr freq 261.625 (1/3)) * a * 0.01 11 | -------------------------------------------------------------------------------- /Help/Ugen/free.help.hs: -------------------------------------------------------------------------------- 1 | -- free 2 | let n0 = pinkNoiseId 'α' ar * 0.05 3 | n1 = dustId 'β' kr 1 4 | in mrg [n0,free n1 (-1)] 5 | 6 | -------------------------------------------------------------------------------- /Help/Ugen/freeSelf.help.hs: -------------------------------------------------------------------------------- 1 | -- freeSelf 2 | let n = dustId 'α' kr 0.5 3 | in mrg [sinOsc ar 440 0 * 0.1,freeSelf n] 4 | -------------------------------------------------------------------------------- /Help/Ugen/freeSelfWhenDone.help.hs: -------------------------------------------------------------------------------- 1 | -- freeSelfWhenDone ; mouseX is trigger 2 | let x = mouseX kr (-1) 1 Linear 0.1 3 | e = linen x 1 0.1 1 DoNothing 4 | in mrg [sinOsc ar 440 0 * e,freeSelfWhenDone e] 5 | 6 | -- freeSelfWhenDone ; mouseX is trigger ; using RemoveSynth doneAction 7 | let x = mouseX kr (-1) 1 Linear 0.1 8 | e = linen x 1 0.1 1 RemoveSynth 9 | in sinOsc ar 440 0 * e 10 | -------------------------------------------------------------------------------- /Help/Ugen/freeVerb.help.hs: -------------------------------------------------------------------------------- 1 | -- freeVerb2 ; mouse control 2 | let i = impulse ar 1 0 3 | c = lfCub ar 1200 0 4 | s = decay i 0.25 * c * 0.1 5 | x = mouseX kr 0 1 Linear 0.1 6 | y = mouseY kr 0 1 Linear 0.1 7 | in freeVerb s y x 0.5 8 | 9 | -- freeVerb2 ; process input channels ; warning=feedback 10 | let i = soundIn (mce2 0 1) 11 | c = mceChannel 12 | x = mouseX kr 0 1 Linear 0.1 13 | y = mouseY kr 0 1 Linear 0.1 14 | in freeVerb2 (c 0 i) (c 1 i) y x 0.5 15 | -------------------------------------------------------------------------------- /Help/Ugen/gate.help.hs: -------------------------------------------------------------------------------- 1 | -- gate 2 | let t = lfPulse ar 1 0 0.1 in gate (fSinOsc ar 500 0 * 0.25) t 3 | -------------------------------------------------------------------------------- /Help/Ugen/gateReset.help.hs: -------------------------------------------------------------------------------- 1 | -- gateReset 2 | let gt = 1 3 | tr = trig1 (dustId 'α' kr 1) 0 4 | e = envGen kr (gateReset gt tr) 1 0 1 DoNothing (envPerc 0.01 1) 5 | in sinOsc ar 440 0 * e * 0.1 6 | 7 | -------------------------------------------------------------------------------- /Help/Ugen/gaussTrig.help.hs: -------------------------------------------------------------------------------- 1 | -- gaussTrig 2 | let x = mouseX kr 0 0.9 Linear 0.2 3 | t1 = X.gaussTrig kr 10 x * abs (whiteNoiseId 'α' kr) * 0.5 4 | t2 = dustId 'β' kr 10 * 0.5 5 | n = pinkNoiseId 'γ' ar * decay (mce2 t1 t2) 0.02 * 0.5 6 | in fold2 (ringz n 2000 0.02) 0.5 7 | -------------------------------------------------------------------------------- /Help/Ugen/gbmanL.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. GbmanN 2 | -------------------------------------------------------------------------------- /Help/Ugen/gbmanN.help.hs: -------------------------------------------------------------------------------- 1 | -- gbmanN ; default initial params 2 | let x = mouseX kr 20 sampleRate Linear 0.2 3 | in gbmanN ar x 1.2 2.1 * 0.05 4 | 5 | -- gbmanN ; change initial params 6 | let x = mouseX kr 20 sampleRate Linear 0.2 7 | in gbmanN ar x (-0.7) (-2.7) * 0.05 8 | 9 | -- gbmanN ; wait 10 | let x = mouseX kr 20 sampleRate Linear 0.2 11 | in gbmanN ar x 1.2 2.0002 * 0.05 12 | 13 | -- gbmanN ; as a frequency control 14 | let f = gbmanN ar 40 1.2 2.1 * 400 + 500 15 | in sinOsc ar f 0 * 0.1 16 | -------------------------------------------------------------------------------- /Help/Ugen/grainIn.help.hs: -------------------------------------------------------------------------------- 1 | -- grainIn ; warning=feedback 2 | let x = mouseX kr (-0.5) 0.5 Linear 0.1 3 | y = mouseY kr 5 25 Linear 0.1 4 | t = impulse kr y 0 5 | in grainIn 2 t 0.1 (soundIn 0 + pinkNoiseId 'α' ar * 0.05) x (-1) 512 * 0.5 6 | -------------------------------------------------------------------------------- /Help/Ugen/grayNoise.help.hs: -------------------------------------------------------------------------------- 1 | -- grayNoise 2 | grayNoiseId 'α' ar * 0.1 3 | 4 | ---- ; drawings 5 | Sound.Sc3.Plot.plot_ugen1 0.025 (grayNoiseId 'γ' ar) 6 | Sound.Sc3.Plot.Fft.plot_ugen_fft1 0.1 (grayNoiseId 'γ' ar) 7 | -------------------------------------------------------------------------------- /Help/Ugen/greater_than.help.hs: -------------------------------------------------------------------------------- 1 | -- greater_than ; c.f. equal_to ; trigger an envelope 2 | let e = envGen kr (sinOsc ar 1 0 `greater_than` 0) 1 0 1 DoNothing (envPerc 0.01 1) 3 | in sinOsc ar 440 0 * e * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/greyholeRaw.help.hs: -------------------------------------------------------------------------------- 1 | -- greyholeRaw 2 | let (i1,i2) = (soundIn 0,soundIn 1) 3 | in X.greyholeRaw i1 i2 0.0 2.0 0.5 0.9 0.1 2.0 1.0 4 | -------------------------------------------------------------------------------- /Help/Ugen/hairCell.help.hs: -------------------------------------------------------------------------------- 1 | -- hairCell ; constantly self oscillates at 5 Hz 2 | pan2 (X.hairCell (soundIn 0) 5.0 100 1000 0.99) 0 0.1 3 | 4 | -- hairCell 5 | pan2 (X.hairCell (saw ar (mouseX kr 1 10 Linear 0.2)) 0 (mouseY kr 0 10000 Linear 0.2) 1000 0.99) 0 0.5 6 | -------------------------------------------------------------------------------- /Help/Ugen/harmonicOsc.help.hs: -------------------------------------------------------------------------------- 1 | -- harmonicOsc 2 | let modulator = sinOsc kr 0.1 0 3 | freq = modulator `in_exprange` (10,1000) 4 | firstharmonic = 3 5 | amplitudes = X.randNId 16 'β' 0.01 0.1 6 | sig = X.harmonicOsc ar freq firstharmonic amplitudes 7 | in pan2 sig modulator 0.2 8 | 9 | -- harmonicOsc ; event control 10 | let f (_,g,x,_,z,o,_,_,_,_,_) = 11 | let amplitudes = X.tRandNId 16 'α' 0.01 0.1 g 12 | in pan2 (X.harmonicOsc ar (midiCps (x * 25 + 36)) 1 amplitudes) (o * 2 - 1) (g * z) 13 | in mix (voicer 16 f) * control kr "gain" 0.5 14 | -------------------------------------------------------------------------------- /Help/Ugen/hasher.help.hs: -------------------------------------------------------------------------------- 1 | -- hasher ; noise 2 | hasher (line ar 0 1 1 RemoveSynth) * 0.2 3 | 4 | -- hasher ; remap x 5 | let x = mouseX kr 0 10 Linear 0.2 6 | f = hasher (roundTo x 1) * 300 + 500 7 | in sinOsc ar f 0 * 0.1 8 | 9 | ---- ; drawings 10 | Sound.Sc3.Plot.plot_ugen_nrt (400,1) 1.0 (hasher (line ar 0 1 1 RemoveSynth)) 11 | 12 | -------------------------------------------------------------------------------- /Help/Ugen/henonC.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. henonN 2 | -------------------------------------------------------------------------------- /Help/Ugen/henonL.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. henonN 2 | -------------------------------------------------------------------------------- /Help/Ugen/hilbert.help.hs: -------------------------------------------------------------------------------- 1 | -- hilbert 2 | hilbert (sinOsc ar 100 0) * 0.1 3 | 4 | -------------------------------------------------------------------------------- /Help/Ugen/hilbertFIR.help.hs: -------------------------------------------------------------------------------- 1 | -- hilbertFir 2 | hilbertFIR (sinOsc ar 100 0 * dbAmp (-20)) (localBufId 'α' 2048 1) 3 | -------------------------------------------------------------------------------- /Help/Ugen/hpf.help.hs: -------------------------------------------------------------------------------- 1 | -- hpf 2 | let f = fSinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 3 | in hpf (saw ar 200 * 0.1) f 4 | 5 | -- hpf ; cutoff at one hertz 6 | hpf (whiteNoiseId 'α' ar) 1 * 0.1 7 | 8 | ---- ; drawings 9 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.05 (hpf (whiteNoiseId 'α' ar) 12000) 10 | -------------------------------------------------------------------------------- /Help/Ugen/hpz1.help.hs: -------------------------------------------------------------------------------- 1 | -- hpz1 ; violet noise (one point difference of white noise) 2 | hpz1 (whiteNoiseId 'α' ar) * 0.1 3 | 4 | -- hpz1 ; blue noise (one point difference of pink noise) 5 | hpz1 (pinkNoiseId 'α' ar) * 0.2 6 | 7 | -- hpz1 ; detect changes in a signal (see also hpz2) 8 | let n = lfNoise0Id 'α' ar 1000 9 | h = hpz1 n 10 | in mce [h,h `greater_than` 0,abs h `greater_than` 0] 11 | 12 | ---- ; drawings 13 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.05 (hpz1 (whiteNoiseId 'α' ar)) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Help/Ugen/hpz2.help.hs: -------------------------------------------------------------------------------- 1 | -- hpz2 2 | hpz2 (whiteNoiseId 'α' ar) * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/iRand.help.hs: -------------------------------------------------------------------------------- 1 | -- iRand 2 | let f = iRandId 'α' 200 1200 3 | e = line kr 0.2 0 0.1 RemoveSynth 4 | in fSinOsc ar f 0 * e 5 | -------------------------------------------------------------------------------- /Help/Ugen/ifft.help.hs: -------------------------------------------------------------------------------- 1 | -- ifft ; no modification 2 | let z = whiteNoiseId 'α' ar 3 | c = fft (localBufId 'β' 1 2048) z 0.5 0 1 0 4 | in ifft c 0 0 * 0.05 5 | 6 | -- ifft ; variants with the default parameters 7 | let z = whiteNoiseId 'α' ar 8 | c = fft' (localBufId 'β' 1 2048) z 9 | in ifft' c * 0.05 10 | -------------------------------------------------------------------------------- /Help/Ugen/iirFilter.help.hs: -------------------------------------------------------------------------------- 1 | -- iirFilter 2 | let x = mouseX kr 20 12000 Exponential 0.2 3 | y = mouseY kr 0.01 1 Linear 0.2 4 | o = lfSaw ar (mce [x * 0.99,x * 1.01]) 0 * 0.1 5 | freq = sinOsc kr (sinOsc kr 0.1 0) (1.5 * pi) * 1550 + 1800 6 | s = X.iirFilter o freq y 7 | in combN s 0.5 (mce2 0.4 0.35) 2 * 0.4 + s * 0.5 8 | -------------------------------------------------------------------------------- /Help/Ugen/inRange.help.hs: -------------------------------------------------------------------------------- 1 | -- inRange ; trigger noise burst 2 | let n = brownNoiseId 'α' ar * 0.1 3 | x = mouseX kr 1 2 Linear 0.1 4 | o = sinOsc kr x 0 * 0.2 5 | in inRange o (-0.15) 0.15 * n 6 | 7 | -- inRange ; i-rate 8 | sinOsc ar 440 0 * inRange (randId 'α' 0 1) 0.5 1.0 * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/inTrig.help.hs: -------------------------------------------------------------------------------- 1 | -- inTrig ; oscillator with the trigger at bus ; dust & mouse button both set bus 2 | let b = control kr "bus" 10 3 | t = inTrig 1 b 4 | e = envGen kr t t 0 1 DoNothing (envPerc 0.01 1) 5 | in mrg2 (sinOsc ar 440 0 * e) (out b (mouseButton kr 0 1 0 + dustId 'α' kr 0.5)) 6 | -------------------------------------------------------------------------------- /Help/Ugen/index.help.hs: -------------------------------------------------------------------------------- 1 | -- index ; index buffer for frequency values 2 | let b = asLocalBufId 'α' [50,100,200,400,800,1600] 3 | f = index b (range 0 6 (lfSaw kr 2 0)) 4 | in sinOsc ar (mce [f,f * 9]) 0 * 0.1 5 | 6 | -- index ; mouse control 7 | let b = asLocalBufId 'α' [200, 300, 400, 500, 600, 800] 8 | f = index b (mouseX kr 0 7 Linear 0.2) 9 | in sinOsc ar f 0 * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/indexInBetween.help.hs: -------------------------------------------------------------------------------- 1 | -- indexInBetween ; index into buffer for frequency values 2 | let f0 = mouseX kr 200 900 Linear 0.1 3 | b = asLocalBufId 'α' [200,210,400,430,600,800] 4 | i = indexInBetween b f0 5 | l0 = index b i 6 | l1 = index b (i + 1) 7 | f1 = linLin (frac i) 0 1 l0 l1 8 | in sinOsc ar (mce [f0,f1]) 0 * 0.1 9 | 10 | -- indexInBetween 11 | let from = asLocalBufId 'α' [1, 2, 4, 8, 16] 12 | to = asLocalBufId 'β' [0, 1, 0, -1, 0] 13 | x = mouseX kr 1 16 Linear 0.1 14 | i = indexL to (indexInBetween from x) 15 | in sinOsc ar (linLin i (-1) 1 440 880) 0 * 0.1 16 | -------------------------------------------------------------------------------- /Help/Ugen/indexL.help.hs: -------------------------------------------------------------------------------- 1 | -- indexL ; index buffer for frequency values 2 | let b = asLocalBufId 'α' [50,100,200,400,800,1600] 3 | ph = 1 -- 0 4 | i = range 0 7 (lfSaw kr 0.1 ph) 5 | in sinOsc ar (mce2 (indexL b i) (index b i)) 0 * 0.1 6 | 7 | -- indexL ; mouse control 8 | let b = asLocalBufId 'α' [200,300,400,500,600,800] 9 | x = mouseX kr 0 7 Linear 0.2 10 | in sinOsc ar (mce2 (indexL b x) (index b x)) 0 * 0.1 11 | -------------------------------------------------------------------------------- /Help/Ugen/k2a.help.hs: -------------------------------------------------------------------------------- 1 | -- k2a 2 | k2a (whiteNoiseId 'α' kr * 0.3) 3 | 4 | -- k2a ; compare 5 | mce2 (k2a (whiteNoiseId 'α' kr * 0.3)) (whiteNoiseId 'β' ar * 0.1) 6 | 7 | -- k2a 8 | let freq = (mouseX kr 0.1 40 Exponential 0.2) / blockSize * sampleRate; 9 | o1 = k2a (lfNoise0Id 'α' kr freq) 10 | o2 = lfNoise0Id 'β' ar freq 11 | in mce2 o1 o2 * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/keyState.help.hs: -------------------------------------------------------------------------------- 1 | -- keyState ; keycode 38 is the A key on some keyboards ; under X11 see xev(1) to determine layout 2 | sinOsc ar 800 0 * keyState kr 38 0 0.1 0.5 3 | -------------------------------------------------------------------------------- /Help/Ugen/keyTrack.help.hs: -------------------------------------------------------------------------------- 1 | -- keyTrack 2 | let s = soundIn (mce2 0 1) 3 | t = fft' (localBufId 'α' 1 4096) (mix s) 4 | k = keyTrack kr t 2.0 0.5 5 | p = poll (impulse kr 1 0) k 0 (label "key") 6 | in mrg2 s p 7 | -------------------------------------------------------------------------------- /Help/Ugen/lag.help.hs: -------------------------------------------------------------------------------- 1 | -- lag ; mouse 2 | let x = mouseX kr 220 440 Linear 0.2 3 | in sinOsc ar (mce [x, lag x 1]) 0 * 0.1 4 | 5 | -- lag ; noise 6 | let n = lfNoise0Id 'α' kr 0.5 7 | in sinOsc ar (220 + (lag n 1 * 220)) 0 * (lag n 2 * 0.1) 8 | 9 | -- lag 10 | lag (impulse ar 100 0) (mouseX kr 0.0 0.01 Linear 0.2) 11 | 12 | -- lag 13 | lag (lfPulse ar 50 0 0.5) (mouseX kr 0.0 (1/50) Linear 0.2) * 0.2 14 | 15 | -- lag ; frequency plain at left and smoothed at right 16 | let f = sinOsc kr 0.05 0.0 `in_range` (220,440) 17 | in sinOsc ar (mce2 f (lag f 1)) 0 * 0.1 18 | -------------------------------------------------------------------------------- /Help/Ugen/lag2.help.hs: -------------------------------------------------------------------------------- 1 | -- lag2 ; control 2 | let x = mouseX kr 220 440 Exponential 0.1 3 | in sinOsc ar (mce [x, lag2 x 1]) 0 * 0.1 4 | 5 | -- lag2 ; audio 6 | lag2 (impulse ar 100 0) (mouseX kr 0.0 0.01 Linear 0.2) 7 | -------------------------------------------------------------------------------- /Help/Ugen/lag3.help.hs: -------------------------------------------------------------------------------- 1 | -- lag3 ; mouse control 2 | let x = mouseX kr 220 440 Exponential 0.1 3 | in sinOsc ar (mce [x, lag3 x 1]) 0 * 0.1 4 | 5 | -- lag3 ; audio 6 | lag3 (impulse ar 100 0) (mouseX kr 0.0 0.01 Linear 0.2) 7 | 8 | -- lag3 9 | lag3 (lfPulse ar 100 0 0.5 * 0.2) (mouseX kr 0.0 0.01 Linear 0.2) 10 | 11 | -- lag3 ; written out 12 | let x = mouseX kr 0.0 0.01 Linear 0.2 13 | in lag (lag (lag (lfPulse ar 100 0 0.5 * 0.2) x) x) x 14 | -------------------------------------------------------------------------------- /Help/Ugen/lagIn.help.hs: -------------------------------------------------------------------------------- 1 | -- lagIn ; oscillator reading frequency at control bus 2 | sinOsc ar (lagIn 1 (control kr "bus" 10) 1) 0 * 0.1 3 | 4 | ---- ; set/reset frequency at control bus 5 | import Sound.OSC {- hosc -} 6 | withSc3 (sendMessage (c_set1 10 200)) 7 | withSc3 (sendMessage (c_set1 10 2000)) 8 | -------------------------------------------------------------------------------- /Help/Ugen/lastValue.help.hs: -------------------------------------------------------------------------------- 1 | -- lastValue 2 | let x = mouseX kr 100 400 Linear 0.1 3 | in sinOsc ar (lastValue x 40) 0 * 0.1 4 | 5 | -- lastValue ; difference between currrent and the last changed 6 | let x = mouseX kr 0.1 4 Linear 0.1 7 | f = abs (lastValue x 0.5 - x) * 400 + 200 8 | in sinOsc ar f 0 * 0.2 9 | -------------------------------------------------------------------------------- /Help/Ugen/lcm.help.hs: -------------------------------------------------------------------------------- 1 | -- lcm 2 | let x = mouseX kr (-20) 20 Linear 0.2 3 | y = mouseY kr (-20) 20 Linear 0.2 4 | in sinOsc ar ((sinOsc kr 0.3 0 * 20) `lcmE` mce2 x y * 30 + 500) 0 * 0.1 5 | 6 | -- https://www.listarc.bham.ac.uk/lists/sc-users/msg68916.html (jrhb) 7 | let a = lfSaw ar 2 0 * 100 8 | b = lfSaw ar 1.2 0 * 100 9 | in sinOsc ar (lcmE a b + 300) 0 * 0.1 10 | 11 | -------------------------------------------------------------------------------- /Help/Ugen/leakDC.help.hs: -------------------------------------------------------------------------------- 1 | -- leakDC 2 | let a = lfPulse ar 800 0 0.5 * 0.1 + 0.5 3 | in mce [a,leakDC a 0.995] 4 | 5 | ---- ; frequency response functions and tables 6 | ---- ; 7 | leak_dc_coef sample_rate cfreq = exp (-two_pi * (cfreq / sample_rate)) 8 | leak_dc_cfreq sample_rate coef = -log(coef) * (sample_rate / two_pi) 9 | import Sound.Sc3.Plot {- hsc3-plot -} 10 | plot_p2_ln [let x = [0,0.5 .. 200] in zip x (map (leak_dc_coef 48000) x)] 11 | plot_p2_ln [let x = [0.9700,0.9725 .. 1.0000] in zip x (map (leak_dc_cfreq 48000) x)] 12 | -------------------------------------------------------------------------------- /Help/Ugen/lfBrownNoise0.help.hs: -------------------------------------------------------------------------------- 1 | -- lfBrownNoise0 2 | let n = X.lfBrownNoise0Id 'α' ar 10 0.05 0 3 | f = linExp n (-1) 1 64 9600 4 | in sinOsc ar f 0 * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/lfNoise1.help.hs: -------------------------------------------------------------------------------- 1 | -- lfNoise1 2 | lfNoise1Id 'α' ar 1000 * 0.05 3 | 4 | -- lfNoise1 ; modulate frequency 5 | let f = xLine kr 1000 10000 10 RemoveSynth 6 | in lfNoise1Id 'α' ar f * 0.05 7 | 8 | -- lfNoise1 ; as frequency control 9 | let n = lfNoise1Id 'α' kr 4 10 | f = n * 400 + 450 11 | in sinOsc ar f 0 * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/lfNoise2.help.hs: -------------------------------------------------------------------------------- 1 | -- lfNoise2 2 | lfNoise2Id 'α' ar 1000 * 0.05 3 | 4 | -- lfNoise2 ; modulate frequency 5 | let f = xLine kr 1000 10000 10 RemoveSynth 6 | in lfNoise2Id 'α' ar f * 0.05 7 | 8 | -- lfNoise2 ; as frequency control 9 | let f = lfNoise2Id 'α' kr 4 10 | in sinOsc ar (f * 400 + 450) 0 * 0.1 11 | 12 | ---- ; drawings ; lfNoise2 is bi-polar 13 | Sound.Sc3.Plot.plot_ugen1 0.1 (lfNoise2Id 'α' ar 1000) 14 | -------------------------------------------------------------------------------- /Help/Ugen/lfPar.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.Plot.plot_ugen 0.1 (mce2 (sinOsc ar 20 0) (lfPar ar 20 pi)) 3 | -------------------------------------------------------------------------------- /Help/Ugen/lfdNoise1.help.hs: -------------------------------------------------------------------------------- 1 | -- lfdNoise1 ; c.f. lfdNoise0 & lfdNoise3 2 | lfdNoise1Id 'α' ar (xLine ar 1000 100 0.1 DoNothing) 3 | 4 | ---- ; drawings ; c.f. lfdNoise0 & lfdNoise3 5 | Sound.Sc3.Plot.plot_ugen1 0.1 (lfdNoise1Id 'α' ar (xLine ar 1000 100 0.1 DoNothing)) 6 | -------------------------------------------------------------------------------- /Help/Ugen/lfdNoise3.help.hs: -------------------------------------------------------------------------------- 1 | -- lfdNoise3 ; c.f. lfdNoise0 2 | lfdNoise3Id 'α' ar (xLine ar 1000 100 0.1 DoNothing) 3 | 4 | ---- ; drawings 5 | Sound.Sc3.Plot.plot_ugen1 0.1 (lfdNoise3Id 'α' ar (xLine ar 1000 100 0.1 DoNothing)) 6 | -------------------------------------------------------------------------------- /Help/Ugen/limiter.help.hs: -------------------------------------------------------------------------------- 1 | -- limiter 2 | let z = let i = impulse ar 8 0 * lfSaw kr 0.25 0 * (-0.6) + 0.7 3 | in decay2 i 0.001 0.3 * fSinOsc ar 500 0 4 | in mce2 (z * 0.0001) (limiter z 0.4 0.01 * 0.1) 5 | -------------------------------------------------------------------------------- /Help/Ugen/linCongL.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. linCongC 2 | -------------------------------------------------------------------------------- /Help/Ugen/linCongN.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. linCongC 2 | -------------------------------------------------------------------------------- /Help/Ugen/linExp.help.hs: -------------------------------------------------------------------------------- 1 | -- linExp 2 | let mod = sinOsc kr (line kr 1 10 10 DoNothing) 0 3 | in sinOsc ar (mce2 (mod * 400 + 500) (linExp mod (-1) 1 100 900)) 0 * 0.05 4 | 5 | -- linExp 6 | let f = linExp (mouseX kr 0 1 Linear 0.2) 0 1 440 660 7 | in sinOsc ar f 0 * 0.1 8 | 9 | -- linExp ; the destination range may be k-rate 10 | let x = mouseX kr 0 1 Linear 0.2 11 | y = mouseY kr 220 440 Linear 0.2 12 | f = linExp x 0 1 y 660 13 | in sinOsc ar f 0 * 0.1 14 | 15 | -- linExp ; i-rate 16 | sinOsc ar (linExp (randId 'α' 0 1) 0 1 220 440) 0 * 0.1 17 | -------------------------------------------------------------------------------- /Help/Ugen/linLin.help.hs: -------------------------------------------------------------------------------- 1 | -- linLin ; linLin is a function for writing a MulAdd UGen. 2 | let f = linLin (mouseX kr 0 1 Linear 0.2) 0 1 440 660 3 | in sinOsc ar f 0 * 0.1 4 | 5 | -- linLin ; the destination range may be k-rate 6 | let x = mouseX kr 0 1 Linear 0.2 7 | y = mouseY kr 220 440 Linear 0.2 8 | f = linLin x 0 1 y 660 9 | in sinOsc ar f 0 * 0.1 10 | 11 | -- linLin ; modulating source and destination values 12 | let n = lfNoise2Id 'α' ar 80 13 | x = mouseX kr 200 8000 Linear 0.2 14 | y = mouseY kr 200 8000 Linear 0.2 15 | f = linLin n (sinOsc kr 0.2 0) (sinOsc kr 0.2543 0) x y 16 | in sinOsc ar f 0 * 0.1 17 | -------------------------------------------------------------------------------- /Help/Ugen/linPan2.help.hs: -------------------------------------------------------------------------------- 1 | -- linPan2 2 | let n = pinkNoiseId 'α' ar in linPan2 n (fSinOsc kr 2 0) 0.05 3 | 4 | -- linPan2 5 | linPan2 (fSinOsc ar 800 0) (fSinOsc kr 3 0) 0.05 6 | -------------------------------------------------------------------------------- /Help/Ugen/linRand.help.hs: -------------------------------------------------------------------------------- 1 | -- linRand ; c.f. hsc3-lang/Sound/Sc3/Lang/Random/Gen.hs:linrand 2 | let f = linRandId 'α' 200.0 10000.0 (mce [-1, 1]) 3 | e = line kr 0.4 0 0.01 RemoveSynth 4 | in fSinOsc ar f 0 * e 5 | 6 | 7 | -------------------------------------------------------------------------------- /Help/Ugen/linXFade2.help.hs: -------------------------------------------------------------------------------- 1 | -- linXFade2 ; Sc3 has multiplier pseudo input 2 | linXFade2 (fSinOsc ar 800 0 * 0.1) (pinkNoiseId 'α' ar * 0.1) (fSinOsc kr 1 0) * 1 3 | 4 | -- linXFade2 5 | linXFade2 (saw ar 440) (sinOsc ar 440 0) (lfTri kr 0.1 0) * 0.05 6 | -------------------------------------------------------------------------------- /Help/Ugen/line.help.hs: -------------------------------------------------------------------------------- 1 | -- line ; NOTE - Sc3 reorders the mul and add inputs to precede the doneAction input 2 | let f = line kr 200 17000 5 RemoveSynth 3 | in sinOsc ar f 0 * 0.05 4 | 5 | -- line ; demonstrate RemoveGroup done-action 6 | let f = line kr 200 (mce2 209 211) 5 RemoveGroup 7 | in sinOsc ar f 0 * 0.05 8 | -------------------------------------------------------------------------------- /Help/Ugen/linen.help.hs: -------------------------------------------------------------------------------- 1 | -- linen 2 | let e = linen (impulse kr 2 0) 0.01 0.6 0.4 DoNothing 3 | in e * sinOsc ar 440 0 * 0.1 4 | 5 | -- linen ; mouseX is envelope trigger 6 | let x = mouseX kr (-1) 1 Linear 0.1 7 | y = mouseY kr 0.01 0.25 Linear 0.1 8 | e = linen x 1 y 1.0 DoNothing 9 | in sinOsc ar 440 0 * e 10 | 11 | -- linen ; PauseSynth done action 12 | let x = mouseX kr (-1) 1 Linear 0.1 13 | e = linen x 1 0.1 1 PauseSynth 14 | in sinOsc ar 440 0 * e 15 | 16 | ---- ; run paused node (assuming no intermediate node is created) 17 | withSc3 (Sound.OSC.sendMessage (n_run [(-1, True)])) 18 | -------------------------------------------------------------------------------- /Help/Ugen/localOut.help.hs: -------------------------------------------------------------------------------- 1 | -- localOut ; resonator, must subtract blockSize for correct tuning 2 | let p = localIn 1 ar 0 3 | i = impulse ar 1 0 4 | d = delayC (i + (p * 0.995)) 1 (recip 440 - recip controlRate) 5 | in mrg [offsetOut 0 p,localOut d] 6 | 7 | -- localOut ; compare with oscillator 8 | sinOsc ar 440 0 * 0.2 9 | 10 | -- localOut ; ping pong 11 | let n = decay (impulse ar 0.3 0) 0.1 * whiteNoiseId 'α' ar * 0.2 12 | l = localIn 2 ar 0 + mce2 n 0 13 | d = delayN l 0.2 0.2 14 | o = localOut (mceReverse d * 0.8) 15 | in mrg2 d o 16 | -------------------------------------------------------------------------------- /Help/Ugen/log.help.hs: -------------------------------------------------------------------------------- 1 | -- log 2 | sinOsc ar (log (sinOsc kr 0.1 0) * 200 + 300) 0 * 0.05 3 | -------------------------------------------------------------------------------- /Help/Ugen/logistic.help.hs: -------------------------------------------------------------------------------- 1 | -- logistic ; Sc3 default parameters 2 | logistic ar 3 1000 0.5 3 | 4 | -- logistic ; sample-rate 5 | logistic ar 3.95 sampleRate 0.5 6 | 7 | -- logistic ; onset of chaos 8 | logistic ar (line kr 3.55 3.6 5 DoNothing) 1000 0.01 * 0.2 9 | 10 | -- logistic ; mouse control 11 | let x = mouseX kr 3 3.99 Linear 0.1 12 | y = mouseY kr 10 10000 Exponential 0.1 13 | in logistic ar x y 0.25 * 0.2 14 | -------------------------------------------------------------------------------- /Help/Ugen/lorenzTrig.help.hs: -------------------------------------------------------------------------------- 1 | -- lorenzTrig ; randomly modulate params 2 | let minfreq = 11025 3 | maxfreq = 44100 4 | s = lfNoise0Id 'α' kr 1 * 2 + 10 5 | b = lfNoise0Id 'β' kr 1 * 1.5 + 2 6 | r = 28 7 | h = 0.02 8 | x0 = 0.090879182417163 9 | y0 = 2.97077458055 10 | z0 = 24.282041054363 11 | in X.lorenzTrig ar minfreq maxfreq s r b h x0 y0 z0 * 0.2 12 | 13 | -- lorenzTrig ; as a frequency control 14 | let x0 = 0.090879182417163 15 | y0 = 2.97077458055 16 | z0 = 24.282041054363 17 | n = X.lorenzTrig ar 1 8 10 28 28 0.02 x0 y0 z0 18 | in sinOsc ar (decay n 1.0 * 800 + 900) 0 * 0.2 19 | -------------------------------------------------------------------------------- /Help/Ugen/lores.help.hs: -------------------------------------------------------------------------------- 1 | -- lores 2 | X.lores (whiteNoiseId 'α' ar * 0.5) 880 0.5 3 | 4 | -- lores ; modulate param 5 | let src = whiteNoiseId 'α' ar * 0.3 6 | freq = lfNoise0Id 'β' ar 4 * 500 + 600 7 | res = 0.9 8 | in X.lores src freq res 9 | -------------------------------------------------------------------------------- /Help/Ugen/loudness.help.hs: -------------------------------------------------------------------------------- 1 | -- loudness ; assume hop-size of half fft-size 2 | let b = localBufId 'α' 1 1024 3 | x = mouseX kr 0.001 0.1 Exponential 0.2 4 | i = sinOsc ar 1000 0 * x 5 | f = fft' b i 6 | l = loudness f 0.25 6 7 | in sinOsc ar (mce2 900 (l * 300 + 600)) 0 * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/lpcAnalyzer.help.hs: -------------------------------------------------------------------------------- 1 | -- lpcAnalyzer 2 | X.lpcAnalyzer (soundIn 0) (impulse ar 440 0 * 0.2) 256 50 0 0.999 0 3 | 4 | -- lpcAnalyzer 5 | X.lpcAnalyzer (soundIn 0) (impulse ar 440 0 * 0.2) 256 50 0 0.999 1 6 | 7 | -- lpcAnalyzer 8 | let x = mouseX kr 1 128 Linear 0.2 9 | in X.lpcAnalyzer (soundIn 0) (impulse ar 440 0 * 0.2) 128 x 0 0.999 0 10 | 11 | -- lpcAnalyzer 12 | let x = mouseX kr 1 128 Linear 0.2 13 | in X.lpcAnalyzer (soundIn 0) (impulse ar 440 0 * 0.2) 1024 x 0 0.999 1 14 | 15 | -- lpcAnalyzer 16 | let x = mouseX kr 1 256 Linear 0.2 17 | in X.lpcAnalyzer (soundIn 0) (whiteNoiseId 'α' ar * 0.1) 256 x 0 0.999 0 18 | -------------------------------------------------------------------------------- /Help/Ugen/lpcVals.help.lhs: -------------------------------------------------------------------------------- 1 | See lpcSynth 2 | -------------------------------------------------------------------------------- /Help/Ugen/lpz1.help.hs: -------------------------------------------------------------------------------- 1 | -- lpz1 2 | let n = whiteNoiseId 'α' ar * 0.05 in mce2 (n * 0.25) (lpz1 n) 3 | -------------------------------------------------------------------------------- /Help/Ugen/lpz2.help.hs: -------------------------------------------------------------------------------- 1 | -- lpz2 2 | let n = whiteNoiseId 'α' ar in lpz2 (n * 0.05) 3 | -------------------------------------------------------------------------------- /Help/Ugen/lti.help.hs: -------------------------------------------------------------------------------- 1 | -- lti 2 | let a = [0.02,-0.01] 3 | b = [1,0.7,0,0,0,0,-0.8,0,0,0,0,0.9,0,0,0,-0.5,0,0,0,0,0,0,0.25,0.1,0.25] 4 | z = pinkNoiseId 'α' ar * 0.1 5 | in X.lti ar z (asLocalBufId 'β' a) (asLocalBufId 'γ' b) 6 | -------------------------------------------------------------------------------- /Help/Ugen/mantissaMask.help.hs: -------------------------------------------------------------------------------- 1 | -- mantissaMask 2 | mantissaMask (sinOsc ar (sinOsc kr 0.2 0 * 400 + 500) 0 * 0.2) 3 3 | -------------------------------------------------------------------------------- /Help/Ugen/max.help.hs: -------------------------------------------------------------------------------- 1 | -- max 2 | (sinOsc ar 500 0 `max` sinOsc ar 0.1 0) * 0.1 3 | 4 | -- max ; rate selection ; derive from left 5 | let f = (sinOsc ar 0.2 0 `max` sinOsc kr 0.9 0) * 200 + 300 6 | in sinOsc ar f 0 * 0.1 7 | 8 | -- max ; rate selection ; derive from right 9 | let f = (sinOsc kr 0.2 0 `max` sinOsc ar 0.9 0) * 200 + 300 10 | in sinOsc ar f 0 * 0.1 11 | -------------------------------------------------------------------------------- /Help/Ugen/mdaPiano.help.hs: -------------------------------------------------------------------------------- 1 | -- mdaPiano ; trigger notes, three voices 2 | let trigFreq = mce3 2 3 5 3 | freq = midiCps (lfNoise0Id 'α' kr trigFreq * 25 + 48) -- random note (internal rounding) 4 | gate = lfPulse kr trigFreq 0 0.5 5 | vel = lfPar kr (mce3 0.1 0.2 0.3) 0 * 35 + 55 -- varying velocity (0-127) 6 | hard = tRand 0.2 0.8 gate 7 | stereo = 0.5 8 | random = tRand 0 0.35 gate -- randomness of tuning 9 | in mix (X.mdaPiano ar freq gate vel 0.8 hard 0.8 0.8 0.8 0.8 0.8 stereo 0.5 random 0.1 0) * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/meddis.help.hs: -------------------------------------------------------------------------------- 1 | -- meddis ; passing a signal through the hair cell 2 | X.meddis (sinOsc ar 440 0) 3 | 4 | -- meddis ; recursive hair cell compression 5 | X.meddis (X.meddis (soundIn 0)) 6 | -------------------------------------------------------------------------------- /Help/Ugen/median.help.hs: -------------------------------------------------------------------------------- 1 | -- median ; signal with impulse noise 2 | let n = dust2Id 'α' ar 100 3 | in median 3 (saw ar 500 * 0.1 + n * 0.9) 4 | 5 | -- median ; length can be increased for longer duration noise 6 | let n = dust2Id 'α' ar 100 7 | in median 5 (saw ar 500 * 0.1 + lpz1 (n * 0.9)) 8 | 9 | -- median ; long filters begin chopping off the peaks of the waveform 10 | let x = sinOsc ar 1000 0 * 0.2 11 | in mce [x, median 31 x] 12 | 13 | -- median ; median = high frequency noise ; leakDC = low frequency noise 14 | let n = whiteNoiseId 'α' ar 15 | s = median 31 (n * 0.1 + sinOsc ar 800 0 * 0.1) 16 | in leakDC s 0.9 17 | -------------------------------------------------------------------------------- /Help/Ugen/metro.help.hs: -------------------------------------------------------------------------------- 1 | -- metro 2 | X.metro ar 60 1 3 | 4 | -- metro 5 | let b = xLine kr 60 120 5 DoNothing 6 | m = X.metro kr b 1 7 | o = sinOsc ar 440 0 * 0.1 8 | in decay m 0.2 * o 9 | 10 | -- metro 11 | let b = range 30 240 (lfNoise2Id 'α' kr 0.2) 12 | n = dseqId 'β' dinf (mce [1,0.25,0.5,0.25]) 13 | in decay (X.metro kr b n) 0.2 * sinOsc ar 440 0 * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/miRipples.help.hs: -------------------------------------------------------------------------------- 1 | -- MiRipples ; basic 2 | X.miRipples (saw ar 60) 0.4 0.3 1 3 | 4 | -- MiRipples 5 | let cf = range 0 1 (lfNoise0Id 'α' kr 4) 6 | in X.miRipples (saw ar 60) cf 0.6 1 * 0.5 7 | 8 | -- MiRipples ; filter sweep + distortion 9 | let cf = range 0.1 0.9 (lfTri kr 0.03 0) 10 | in X.miRipples (saw ar 40) cf 0.8 4 * 0.2 11 | 12 | -- MiRipples 13 | let tr = impulse ar 4 0 14 | input = decay tr 0.1 15 | cf = tRandId 'α' 0.1 0.6 tr 16 | filt = rlpf cf 80 0.3 17 | in X.miRipples input filt 0.8 3 * 0.5 18 | -------------------------------------------------------------------------------- /Help/Ugen/midEQ.help.hs: -------------------------------------------------------------------------------- 1 | -- midEQ 2 | let f = midiCps (fSinOsc kr 1 0 * 24 + 84) 3 | in midEQ (saw ar 200 * 0.05) f 0.3 12 4 | 5 | -- midEQ 6 | let i = pinkNoiseId 'α' ar * 0.1 + sinOsc ar 600 0 * 0.05 7 | f = sinOsc kr 0.2 (0.5 * pi) * 2 + 600 8 | in midEQ i f 0.01 (-24) 9 | -------------------------------------------------------------------------------- /Help/Ugen/midiCPS.help.hs: -------------------------------------------------------------------------------- 1 | -- midiCps 2 | saw ar (midiCps (line kr 24 108 10 DoNothing)) * 0.05 3 | 4 | -- midiCps ; step 5 | saw ar (midiCps (roundE (line kr 24 108 10 DoNothing))) * 0.05 6 | -------------------------------------------------------------------------------- /Help/Ugen/min.help.hs: -------------------------------------------------------------------------------- 1 | -- min 2 | (fSinOsc ar 500 0 `min` fSinOsc ar 0.1 0) * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/mod.help.hs: -------------------------------------------------------------------------------- 1 | -- mod 2 | sinOsc ar 100 4 `modE` 1 * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/monoGrain.help.hs: -------------------------------------------------------------------------------- 1 | -- monoGrain 2 | let x = mouseX kr 0.1 0.01 Linear 0.2 3 | y = mouseX kr 10 4 Linear 0.2 4 | in X.monoGrain ar (soundIn 0) x y 0 5 | -------------------------------------------------------------------------------- /Help/Ugen/moogVCF.help.hs: -------------------------------------------------------------------------------- 1 | -- moogVCF 2 | let o = mix (lfSaw ar (mce2 120 180) 0 * 0.33) 3 | cf = linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 180 8500 4 | in X.moogVCF o cf 0.75 5 | 6 | -- moogVCF 7 | let o = pulse ar (mce2 40 121) (mce2 0.3 0.7) 8 | cf = range 30 4200 (sinOsc kr (range 0.001 2.2 (lfNoise0Id 'α' kr 0.42)) 0) 9 | in X.moogVCF o cf 0.8 * 0.25 10 | -------------------------------------------------------------------------------- /Help/Ugen/mostChange.help.hs: -------------------------------------------------------------------------------- 1 | -- mostChange 2 | let n = lfNoise0Id 'α' kr 1 3 | x = mouseX kr 200 300 Linear 0.1 4 | f = mostChange (n * 400 + 900) x 5 | in sinOsc ar f 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/mouseButton.help.hs: -------------------------------------------------------------------------------- 1 | -- mouseButton ; amplitude envelope 2 | sinOsc ar 800 0 * mouseButton kr 0 0.1 0.1 3 | 4 | -- mouseButtonRand ; variant that randomly presses the button 5 | sinOsc ar 800 0 * mouseButtonRand kr 0 0.1 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/mouseX.help.hs: -------------------------------------------------------------------------------- 1 | -- mouseX ; frequency control 2 | let x = mouseX kr 40 10000 Exponential 0.2 3 | in sinOsc ar x 0 * 0.1 4 | 5 | -- mouseX ; variant with equal arguments but random traversal 6 | let x = mouseXRand kr 40 10000 Exponential 0.2 7 | in sinOsc ar x 0 * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/mouseY.help.hs: -------------------------------------------------------------------------------- 1 | -- mouseY ; frequency at X axis, amplitude at Y axis 2 | let freq = mouseX kr 20 2000 Exponential 0.1 3 | ampl = mouseY kr 0.01 0.1 Linear 0.1 4 | in sinOsc ar freq 0 * ampl 5 | 6 | -- mouseY ; variant with equal arguments but a random traversal 7 | let freq = mouseXRand kr 20 2000 Exponential 0.1 8 | ampl = mouseYRand kr 0.01 0.1 Linear 0.1 9 | in sinOsc ar freq 0 * ampl 10 | -------------------------------------------------------------------------------- /Help/Ugen/nRand.help.hs: -------------------------------------------------------------------------------- 1 | -- nRand 2 | let n = nRandId 'α' 1200.0 4000.0 (mce [2,5]) 3 | e = line kr 0.2 0 0.1 RemoveSynth 4 | in fSinOsc ar n 0 * e 5 | -------------------------------------------------------------------------------- /Help/Ugen/neg.help.hs: -------------------------------------------------------------------------------- 1 | -- neg ; silence, draw graph to see operator 2 | let o = sinOsc ar 440 0 in o + negate o 3 | -------------------------------------------------------------------------------- /Help/Ugen/nhHall.help.hs: -------------------------------------------------------------------------------- 1 | -- nhHall 2 | let in1 = soundIn 0 3 | in2 = soundIn 1 4 | rt60 = mouseX kr 0.1 10.0 Linear 0.1 5 | in X.nhHall in1 in2 rt60 0.5 200 0.5 4000 0.5 0.5 0.5 0.2 0.3 6 | -------------------------------------------------------------------------------- /Help/Ugen/nodeId.help.hs: -------------------------------------------------------------------------------- 1 | -- nodeId ; except that negative nodeId are not reported 2 | sinOsc ar (mce2 (-100) (nodeID ir * 100)) 0 * 0.1 3 | 4 | ---- ; specify node id 5 | audition_at (-1,AddToHead,1,[]) (sinOsc ar (mce2 (-100) (nodeID ir * 100)) 0 * 0.1) 6 | audition_at (8,AddToHead,1,[]) (sinOsc ar (mce2 (-100) (nodeID ir * 100)) 0 * 0.1) 7 | -------------------------------------------------------------------------------- /Help/Ugen/normalizer.help.hs: -------------------------------------------------------------------------------- 1 | -- normalizer 2 | let s = fSinOsc ar 500 0 3 | t = impulse ar 8 (lfSaw kr 0.25 (-0.6) * 0.7) 4 | z = decay2 t 0.001 0.3 * s 5 | in mce [z, normalizer z 0.4 0.01] 6 | -------------------------------------------------------------------------------- /Help/Ugen/numAudioBuses.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/numAudioBuses.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/numBuffers.help.hs: -------------------------------------------------------------------------------- 1 | -- numBuffers ; the number of audio buffers available at the server (by default 1024, printing only) 2 | poll (impulse kr 1 0) numBuffers 0 (label "numBuffers") 3 | 4 | -- numBuffers 5 | let f = 110 + numBuffers in sinOsc ar f 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/numControlBuses.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/numControlBuses.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/numInputBuses.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/numInputBuses.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/numOutputBuses.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/numOutputBuses.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/numRunningSynths.help.hs: -------------------------------------------------------------------------------- 1 | -- numRunningSynths ; each concurrent audition increases oscillator frequency 2 | sinOsc ar (numRunningSynths * 200 + 400) 0 * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/offsetOut.help.hs: -------------------------------------------------------------------------------- 1 | -- offsetOut 2 | let a = offsetOut 0 (impulse ar 5 0) 3 | b = out 0 (sinOsc ar 60 0 * 0.1) 4 | in mrg2 a b 5 | 6 | -- offsetOut ; c.f. out 7 | let a = out 0 (impulse ar 5 0) 8 | b = out 0 (sinOsc ar 60 0 * 0.1) 9 | in mrg [a,b] 10 | -------------------------------------------------------------------------------- /Help/Ugen/onePole.help.hs: -------------------------------------------------------------------------------- 1 | -- onePole 2 | let n = whiteNoiseId 'α' ar in onePole (n * 0.1) 0.95 3 | 4 | -- onePole 5 | let n = whiteNoiseId 'α' ar in onePole (n * 0.1) (-0.95) 6 | 7 | -- onePole 8 | let n = whiteNoiseId 'α' ar 9 | c = line kr (-0.99) 0.99 10 RemoveSynth 10 | in onePole (n * 0.1) c 11 | -------------------------------------------------------------------------------- /Help/Ugen/oneZero.help.hs: -------------------------------------------------------------------------------- 1 | -- oneZero 2 | let n = whiteNoiseId 'α' ar in oneZero (n * 0.1) 0.5 3 | 4 | -- oneZero 5 | let n = whiteNoiseId 'α' ar in oneZero (n * 0.1) (-0.5) 6 | 7 | -- oneZero 8 | let n = whiteNoiseId 'α' ar 9 | c = line kr (-0.5) 0.5 10 RemoveSynth 10 | in oneZero (n * 0.1) c 11 | -------------------------------------------------------------------------------- /Help/Ugen/oscN.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. osc 2 | -------------------------------------------------------------------------------- /Help/Ugen/oteyPianoStrings.help.hs: -------------------------------------------------------------------------------- 1 | -- oteyPianoStrings 2 | let k = control kr 3 | freq = k "freq" 440 4 | gate_ = k "gate" 1 5 | amp = k "amp" 0.5 6 | rho = k "rho" 1 7 | env = envGen ar gate_ 1 0 1 RemoveSynth (envAsr 0 1 0.1 EnvLin) 8 | loc = linLin freq (midiCps 36) (midiCps 90) (-0.75) 0.75 9 | s = X.oteyPianoStrings ar freq amp 0 0.35 2 4 8 1 0.07 1.4 (-4) 4 rho 1 1 0 1 0.2 1 1 0.142 1 0.0003 1 10 | in X.oteySoundBoard (pan2 (s * env) loc 0.1) 20 20 0.8 11 | -------------------------------------------------------------------------------- /Help/Ugen/oteySoundBoard.help.hs: -------------------------------------------------------------------------------- 1 | -- oteySoundBoard 2 | let loc = mouseX kr (-1) 1 Linear 0.2 3 | in X.oteySoundBoard (pan2 (soundIn 0) loc 0.1) 20 20 0.8 4 | 5 | -- oteySoundBoard 6 | let d = dustId 'α' ar 1 7 | n = whiteNoiseId 'β' ar 8 | i = decay (d * 0.5) 0.2 * n 9 | loc = mouseX kr (-1) 1 Linear 0.2 10 | c1 = 20 11 | c3 = 20 12 | mix = 0.8 13 | in X.oteySoundBoard (pan2 i loc 0.1) c1 c3 mix 14 | -------------------------------------------------------------------------------- /Help/Ugen/packFFT.help.hs: -------------------------------------------------------------------------------- 1 | -- packFFT 2 | let b = localBufId 'α' 512 1 3 | n = 100 4 | square a = a * a 5 | r1 z = range 0 1 (fSinOsc kr (expRandId (z,'β') 0.1 1) 0) 6 | m1 = map r1 (id_seq n 'γ') 7 | m2 = zipWith (*) m1 (map square [1.0, 0.99 ..]) 8 | r2 z = lfPulse kr (2 ** iRandId (z,'δ') (-3) 5) 0 0.3 9 | i = map r2 (id_seq n 'ε') 10 | m3 = zipWith (*) m2 i 11 | p = replicate n 0.0 12 | c1 = fft' b (fSinOsc ar 440 0) 13 | c2 = packFFT c1 512 0 (n - 1) 1 (packFFTSpec m3 p) 14 | s = ifft' c2 15 | in mce2 s s 16 | -------------------------------------------------------------------------------- /Help/Ugen/pan2.help.hs: -------------------------------------------------------------------------------- 1 | -- pan2 ; note level input is control rate only 2 | let n = pinkNoiseId 'α' ar in pan2 n (fSinOsc kr 2 0) 0.1 3 | 4 | -- pan2 5 | let n = pinkNoiseId 'α' ar * 0.1 6 | x = mouseX kr (-1) 1 Linear 0.2 7 | y = mouseY kr 0 1 Linear 0.2 8 | in pan2 n x y 9 | 10 | -- pan2 ; ctl=freq:220,220,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin 11 | pan2 (sinOsc ar (control kr "freq" 220) 0) (control kr "pan" 0) (control kr "amp" 0.1) 12 | 13 | -- pan2 ; ctl=pan[:-0.1,-1,1,lin;pan]:0.1,-1,1,lin 14 | let loc = sinOsc kr 0.5 0 `in_range` (control kr "pan[" 0,control kr "pan]" 0) 15 | in pan2 (pinkNoiseId 'α' ar) loc 0.05 16 | -------------------------------------------------------------------------------- /Help/Ugen/panAz.help.hs: -------------------------------------------------------------------------------- 1 | -- panAz 2 | let o = pinkNoiseId 'α' ar 3 | nc = 4 4 | fr = 0.15 5 | in panAz nc o (lfSaw kr fr 0) 0.1 2 0.5 6 | -------------------------------------------------------------------------------- /Help/Ugen/pause.help.hs: -------------------------------------------------------------------------------- 1 | -- pause 2 | let f = control kr "f" 440 3 | g = control kr "g" 1 4 | in mrg [sinOsc ar f 0 * 0.1,pause g 1001] 5 | 6 | ---- ; control 7 | g = mrg [sinOsc ar (control kr "f" 440) 0 * 0.1,pause (control kr "g" 1) 1001] 8 | audition_at (1001,AddToTail,1,[]) g 9 | audition_at (1002,AddToTail,1,[("f",880)]) g 10 | 11 | ---- ; request that node 1002 pause node 1001 12 | withSc3 (Sound.OSC.sendMessage (n_set 1002 [("g",0)])) 13 | 14 | ---- ; restart node 1001 15 | withSc3 (Sound.OSC.sendMessage (n_set 1002 [("g",1)])) 16 | -------------------------------------------------------------------------------- /Help/Ugen/pauseSelf.help.hs: -------------------------------------------------------------------------------- 1 | -- pauseSelf 2 | let x = mouseX kr (-1) 1 Linear 0.1 3 | o = sinOsc ar 440 0 * 0.1 4 | in mrg [o,pauseSelf x] 5 | 6 | ---- ; run paused node (assuming no intermediate node is created) 7 | withSc3 (Sound.OSC.sendMessage (n_run [(-1, True)])) 8 | -------------------------------------------------------------------------------- /Help/Ugen/pauseSelfWhenDone.help.hs: -------------------------------------------------------------------------------- 1 | -- pauseSelfWhenDone 2 | let x = mouseX kr (-1) 1 Linear 0.1 3 | e = linen x 1 0.1 1 DoNothing 4 | o = sinOsc ar 440 0 * e 5 | in mrg [o,pauseSelfWhenDone e] 6 | 7 | ---- ; run paused node (assuming no intermediate node is created) 8 | withSc3 (Sound.OSC.sendMessage (n_run [(-1, True)])) 9 | -------------------------------------------------------------------------------- /Help/Ugen/peak.help.hs: -------------------------------------------------------------------------------- 1 | -- peak 2 | let t = dustId 'α' ar 20 3 | r = impulse ar 0.4 0 4 | f = peak t r * 500 + 200 5 | in sinOsc ar f 0 * 0.2 6 | -------------------------------------------------------------------------------- /Help/Ugen/perlin3.help.hs: -------------------------------------------------------------------------------- 1 | -- perlin3 2 | let x = integrator (k2a (mouseX kr 0 0.1 Linear 0.2)) 1.0 3 | y = integrator (k2a (mouseY kr 0 0.1 Linear 0.2)) 1.0 4 | in X.perlin3 ar x y 0 * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/pitchShift.help.hs: -------------------------------------------------------------------------------- 1 | -- pitchShift 2 | let s = sinOsc ar 440 0 * 0.1 3 | r = mouseX kr 0.5 2.0 Linear 0.1 4 | d = mouseY kr 0.0 0.1 Linear 0.1 5 | in pitchShift s 0.2 r d 0 6 | 7 | -- pitchShift 8 | let s = soundIn 0 9 | pd = mouseX kr 0.0 0.1 Linear 0.1 10 | td = mouseY kr 0.0 0.1 Linear 0.1 11 | in pitchShift s 0.2 (mce2 1.0 1.5) pd td 12 | -------------------------------------------------------------------------------- /Help/Ugen/pow.help.hs: -------------------------------------------------------------------------------- 1 | -- pow 2 | let a = fSinOsc ar 100 0 * 0.1 in mce2 a (a ** 10) 3 | 4 | -- pow ; see also http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html 5 | let n0 = lfNoise2Id 'α' kr 8 6 | n1 = lfNoise2Id 'β' kr 3 7 | s = blip ar (n0 * 200 + 300) (n1 * 10 + 20) 8 | x = mouseX kr 1000 (sampleRate * 0.5) Exponential 0.1 9 | y = mouseY kr 1 24 Exponential 0.1 10 | d = latch s (impulse ar x 0) 11 | b = roundUp d (0.5 ** y) 12 | in mce2 d b * 0.2 13 | 14 | -- pow ; optimises identity 15 | (sinOsc ar 440 0 ** 1) * 0.1 16 | -------------------------------------------------------------------------------- /Help/Ugen/pulse.help.hs: -------------------------------------------------------------------------------- 1 | -- pulse ; modulate frequency 2 | let f = xLine kr 40 4000 6 RemoveSynth 3 | in pulse ar f 0.1 * 0.1 4 | 5 | -- pulse ; modulate width, 0.5 = square wave 6 | let w = line kr 0.01 0.99 8 RemoveSynth 7 | in pulse ar 200 w * 0.1 8 | 9 | -- pulse ; two band limited square waves through a resonant low pass filter 10 | let p = pulse ar (mce2 100 250) 0.5 * 0.1 11 | f = xLine kr 8000 400 5 DoNothing 12 | in rlpf p f 0.05 13 | 14 | -------------------------------------------------------------------------------- /Help/Ugen/pulseCount.help.hs: -------------------------------------------------------------------------------- 1 | -- pulseCount 2 | let c = pulseCount (impulse ar 10 0) (impulse ar 0.4 0) 3 | in sinOsc ar (c * 200) 0 * 0.05 4 | 5 | -- pulseCount ; printer (silent, see console) 6 | let b = localBuf 11 1 7 | t = impulse ar 10 0 8 | p = pulseCount t 0 9 | d = demand t 0 (dbufwr (-666) b p NoLoop) 10 | in mrg [dc ar 0,poll t p 0 (label "p")] 11 | 12 | -- pulseCount ; printer (silent, see console) ; id 13 | let b = localBufId 'α' 11 1 14 | t = impulse ar 10 0 15 | p = pulseCount t 0 16 | d = demand t 0 (dbufwrId 'α' (-666) b p NoLoop) 17 | in mrg [dc ar 0,poll t p 0 (label "p")] 18 | -------------------------------------------------------------------------------- /Help/Ugen/pulseDPW.help.hs: -------------------------------------------------------------------------------- 1 | -- pulseDPW 2 | X.pulseDPW ar (xLine kr 2000 20 10 DoNothing) 0.5 * 0.1 3 | 4 | -- pulseDPW 5 | X.pulseDPW ar (mouseX kr 200 12000 Exponential 0.2) 0.5 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/pulseDivider.help.hs: -------------------------------------------------------------------------------- 1 | -- pulseDivider 2 | let p = impulse ar 8 0 3 | d = pulseDivider p (mce [4,7]) 0 4 | a = sinOsc ar 1200 0 * decay2 p 0.005 0.1 5 | b = sinOsc ar 600 0 * decay2 d 0.005 0.5 6 | in (a + b) * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_BinBufRd.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_BinBufRd ; play analysis back ; c.f. pv_RecordBuf help file 2 | let snd_buf = control kr "buf" 100 3 | rec_buf = control kr "rec" 10 4 | fft_buf = localBufId 'α' 1 1024 5 | x = mouseX kr 0 1 Linear 0.2 6 | y = mouseY kr 5 100 Linear 0.2 7 | c0 = fft' fft_buf (playBuf 1 ar snd_buf (bufRateScale kr snd_buf) 1 0 Loop DoNothing) 8 | c1 = X.pv_BinBufRd c0 rec_buf x 10 3 y 1 9 | in ifft c1 1 0 10 | -------------------------------------------------------------------------------- /Help/Ugen/pv_BinShift.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_BinShift ; default values 2 | ifft' (pv_BinShift (fftAllocId 'α' 2048 (soundIn 0) 0.5 0 1 0) 1 0 0) * 0.25 3 | 4 | -- pv_BinShift ; mouse control 5 | let z = soundIn 0 6 | x = mouseX kr (-10) 100 Linear 0.1 -- shift 7 | y = mouseY kr 1 4 Linear 0.1 -- stretch 8 | b = mouseButton kr 0 1 0.2 9 | pv = pv_BinShift (fftAllocId 'β' 2048 z 0.5 0 1 0) y x b 10 | in ifft' pv * 0.25 11 | -------------------------------------------------------------------------------- /Help/Ugen/pv_BinWipe.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_BinWipe 2 | let z = soundIn 0 3 | n = whiteNoiseId 'α' ar * 0.1 4 | f = fft' (localBufId 'β' 2048 1) n 5 | g = fft' (localBufId 'γ' 2048 1) z 6 | x = mouseX kr 0.0 1.0 Linear 0.1 7 | h = pv_BinWipe f g x 8 | in pan2 (ifft' h) 0 0.5 9 | -------------------------------------------------------------------------------- /Help/Ugen/pv_BufRd.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_BufRd ; play analysis back ; c.f. pv_RecordBuf help file 2 | let rec_buf = control kr "rec" 10 3 | fft_buf = localBufId 'α' 1 1024 4 | x = mouseX kr 0 1 Linear 0.2 5 | c0 = X.pv_BufRd fft_buf rec_buf x 6 | in ifft c0 1 0 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_ConformalMap.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_ConformalMap 2 | let i = soundIn 0 3 | x = mouseX kr (-1) 1 Linear 0.1 4 | y = mouseY kr (-1) 1 Linear 0.1 5 | in pan2 (ifft' (pv_ConformalMap (fft' (localBufId 'α' 1024 1) i) x y)) 0 1 6 | 7 | -- pv_ConformalMap ; with filtering 8 | let z = soundIn 0 9 | x = mouseX kr 0.01 2.0 Linear 0.1 10 | y = mouseY kr 0.01 10.0 Linear 0.1 11 | c = fft' (localBufId 'β' 2048 1) z 12 | m = ifft' (pv_ConformalMap c x y) 13 | in pan2 (combN m 0.1 0.1 10 * 0.5 + m) 0 0.5 14 | -------------------------------------------------------------------------------- /Help/Ugen/pv_Diffuser.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_Diffuser ; trigger revised phase shifts with MouseX crossing center of screen 2 | let b = control kr "buf" 100 3 | z = playBuf 1 ar b (bufRateScale kr b) 0 0 Loop DoNothing 4 | f = fft' (localBufId 'α' 2048 1) z 5 | x = mouseX kr 0 1 Linear 0.1 6 | h = pv_Diffuser f (x `greater_than` 0.5) 7 | in mce2 z (ifft' h * 0.5) 8 | 9 | ---- ; load buf 10 | let fn = "/usr/share/SuperCollider/sounds/a11wlk01.wav" 11 | let fn = "/home/rohan/data/audio/instr/bosendorfer/064/C5.aif" 12 | withSc3 (async (b_allocRead 0 fn 0 0)) 13 | -------------------------------------------------------------------------------- /Help/Ugen/pv_Freeze.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_Freeze 2 | let f = fft' (localBufId 'α' 2048 1) (soundIn 0) 3 | x = mouseX kr 0 1 Linear 0.1 4 | h = X.pv_Freeze f (x `greater_than` 0.5) 5 | in ifft' h * 0.5 6 | -------------------------------------------------------------------------------- /Help/Ugen/pv_HainsworthFoote.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_HainsworthFoote 2 | let i = soundIn 0 3 | b = localBufId 'α' 2048 1 4 | f = fft' b i 5 | x = mouseX kr 0.5 1.25 Linear 0.2 6 | h = pv_HainsworthFoote f 1 0 x 0.04 7 | o = sinOsc ar (mrg2 440 445) 0 * decay (h * 0.1) 0.1 * 0.1 8 | in o + i 9 | 10 | -- pv_HainsworthFoote ; spot note transitions 11 | let s = lfSaw ar (lfNoise0Id 'β' kr 1 * 90 + 400) 0 * 0.5 12 | b = localBufId 'γ' 2048 1 13 | f = fft' b s 14 | d = pv_HainsworthFoote f 1.0 0.0 0.9 0.5 15 | t = sinOsc ar 440 0 * decay (d * 0.1) 0.1 * 0.1 16 | in mce2 (s * 0.05) t 17 | -------------------------------------------------------------------------------- /Help/Ugen/pv_Invert.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_Invert 2 | let z = sinOsc ar 440 0 * 0.4 + pinkNoiseId 'α' ar * 0.1 3 | c0 = fft' (localBufId 'β' 2048 1) z 4 | c1 = X.pv_Invert c0 5 | in mce2 z (ifft' c1) * 0.5 6 | 7 | -- pv_Invert 8 | let z = soundIn 0 9 | c0 = fft' (localBufId 'β' 2048 1) z 10 | c1 = X.pv_Invert c0 11 | in mce2 z (ifft' c1) * 0.5 12 | -------------------------------------------------------------------------------- /Help/Ugen/pv_JensenAndersen.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_JensenAndersen ; propsc=0.25 prophfe=0.25 prophfc=0.25 propsf=0.25 threshold=1.0 waittime=0.04 2 | let i = soundIn 0 3 | f = fft' (localBufId 'α' 2048 1) i 4 | x = mouseX kr 0.01 1.0 Linear 0.2 5 | h = pv_JensenAndersen f 0.25 0.25 0.25 0.25 x 0.04 6 | in sinOsc ar (mrg2 440 445) 0 * decay (h * 0.1) 0.1 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_LocalMax.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_LocalMax 2 | let z = soundIn 0 3 | f = fft' (localBufId 'α' 2048 1) z 4 | x = mouseX kr 0 100 Linear 0.1 5 | h = pv_LocalMax f x 6 | in ifft' h * 0.5 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagAbove.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagAbove 2 | let z = soundIn 0 3 | f = fft' (localBufId 'α' 2048 1) z 4 | x = mouseX kr 0 64 Linear 0.1 5 | h = pv_MagAbove f x 6 | in ifft' h * 0.5 7 | 8 | -- pv_MagAbove ; synthesised input 9 | let z = sinOsc ar (sinOsc kr (squared (sinOsc kr 0.08 0 * 6 + 6.2)) 0 * 100 + 800) 0 10 | f = fft' (localBufId 'α' 2048 1) z 11 | x = mouseX kr 0 512 Linear 0.1 12 | h = pv_MagAbove f x 13 | in ifft' h * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagBelow.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagBelow ; c.f. pv_MagAbove 2 | let z = soundIn 0 3 | f = fft' (localBufId 'α' 2048 1) z 4 | x = mouseX kr 0 64 Linear 0.1 5 | h = pv_MagBelow f x 6 | in ifft' h * 0.5 7 | 8 | -- pv_MagBelow ; synthesised input 9 | let z = sinOsc ar (sinOsc kr (squared (sinOsc kr 0.08 0 * 6 + 6.2)) 0 * 100 + 800) 0 10 | f = fft' (localBufId 'α' 2048 1) z 11 | x = mouseX kr 0 512 Linear 0.1 12 | h = pv_MagBelow f x 13 | in ifft' h * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagClip.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagClip 2 | let f = fft' (localBufId 'α' 2048 1) (soundIn 0) 3 | c = 128 4 | x = mouseX kr 0 c Linear 0.1 5 | h = pv_MagClip f x 6 | in ifft' h * 0.5 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagFreeze.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagFreeze ; mouseX is trigger to freeze 2 | let b = control kr "buf" 100 3 | z = playBuf 1 ar b (bufRateScale kr b) 0 0 Loop DoNothing 4 | f = fft' (localBufId 'α' 2048 1) z 5 | x = mouseX kr 0 1 Linear 0.1 6 | h = pv_MagFreeze f (x >** 0.5) 7 | in ifft' h * 0.5 8 | 9 | -- pv_MagFreeze ; mouseX is trigger to freeze 10 | let z = soundIn 0 11 | f = fft' (localBufId 'α' 2048 1) z 12 | x = mouseX kr 0 1 Linear 0.1 13 | h = pv_MagFreeze f (x >** 0.5) 14 | in ifft' h * 0.5 15 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagGate.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagGate 2 | let (lhs,rhs) = (-50,0) -- (0,100) 3 | i = soundIn 0 4 | c = fft' (localBufId 'α' 2048 1) i 5 | x = mouseX kr lhs rhs Linear 0.2 6 | y = mouseY kr 0 1 Linear 0.2 7 | h = X.pv_MagGate c x y 8 | in ifft' h * 0.5 9 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagMul.help.hs: -------------------------------------------------------------------------------- 1 | let z = soundIn 0 2 | y = lfSaw ar (midiCps 43) 0 * 0.2 3 | c0 = fft' (localBufId 'α' 2048 1) y 4 | c1 = fft' (localBufId 'β' 2048 1) z 5 | c2 = pv_MagMul c0 c1 6 | in ifft' c2 * 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_MagSmear.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_MagSmear 2 | let i = soundIn 0 3 | c = fft' (localBufId 'α' 2048 1) i 4 | x = mouseX kr 0 100 Linear 0.2 5 | h = pv_MagSmear c x 6 | in ifft' h * 0.5 7 | -------------------------------------------------------------------------------- /Help/Ugen/pv_Morph.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_Morph 2 | let o1 = pulse ar 180 (lfCub kr 1 0 * 0.1 + 0.3) * 0.2 3 | o2 = varSaw ar 190 0 (lfCub kr 0.8 0 * 0.4 + 0.5) * 0.5 4 | c1 = fft' (localBufId 'α' 2048 1) o1 5 | c2 = fft' (localBufId 'β' 2048 1) o2 6 | x = mouseX kr 0 1 Linear 0.2 7 | h = X.pv_Morph c1 c2 x 8 | in ifft' h * 0.5 9 | -------------------------------------------------------------------------------- /Help/Ugen/pv_Mul.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_Mul 2 | let o1 = sinOsc ar 500 0 3 | o2 = sinOsc ar (line kr 50 400 5 RemoveSynth) 0 4 | c1 = fft' (localBufId 'α' 2048 1) o1 5 | c2 = fft' (localBufId 'β' 2048 1) o2 6 | h = pv_Mul c1 c2 7 | in ifft' h * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/pv_PlayBuf.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_PlayBuf ; c.f. pv_RecordBuf 2 | let rec_buf = control kr "rec" 10 3 | fft_buf = localBufId 'α' 1024 1 4 | x = mouseX kr (-1) 1 Linear 0.2 5 | c = X.pv_PlayBuf fft_buf rec_buf x 50 1 6 | in ifft c 1 0 7 | 8 | -- pv_PlayBuf 9 | let rec_buf = control kr "rec" 10 10 | fft_buf = localBufId 'β' 1024 1 11 | n = range (-1) 2 (lfNoise2Id 'γ' kr 0.2) 12 | c = X.pv_PlayBuf fft_buf rec_buf n 0 1 13 | in ifft c 1 0 14 | -------------------------------------------------------------------------------- /Help/Ugen/pv_RectComb.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_RectCommb ; mouse control 2 | let z = soundIn 0 3 | b = localBufId 'β' 2048 1 4 | x = mouseX kr 0 0.5 Linear 0.1 5 | y = mouseY kr 0 0.5 Linear 0.1 6 | c = pv_RectComb (fft' b z) 8 x y 7 | in pan2 (ifft' c) 0 1 8 | 9 | -- pv_RectCommb ; lfo control 10 | let z = soundIn 0 11 | b = localBufId 'γ' 2048 1 12 | p = lfTri kr 0.097 0 * 0.4 + 0.5 13 | w = lfTri kr 0.240 0 * (-0.5) + 0.5 14 | c = pv_RectComb (fft' b z) 8 p w 15 | in pan2 (ifft' c) 0 1 16 | -------------------------------------------------------------------------------- /Help/Ugen/pv_xFade.help.hs: -------------------------------------------------------------------------------- 1 | -- pv_xFade 2 | let o1 = pulse ar 180 (lfCub kr 1 0 * 0.1 + 0.3) * 0.2 3 | o2 = varSaw ar 190 0 (lfCub kr 0.8 0 * 0.4 + 0.5) * 0.5 4 | c1 = fft' (localBufId 'α' 2048 1) o1 5 | c2 = fft' (localBufId 'β' 2048 1) o2 6 | x = mouseX kr 0 1 Linear 0.2 7 | h = X.pv_xFade c1 c2 x 8 | in ifft' h * 0.5 9 | -------------------------------------------------------------------------------- /Help/Ugen/quadC.help.hs: -------------------------------------------------------------------------------- 1 | -- quadC 2 | quadC ar (sampleRate / 2) 1 (-1) (-0.75) 0 * 0.1 3 | 4 | -- quadC 5 | let x = mouseX kr 3.5441 4 Linear 0.1 6 | in quadC ar 4000 (negate x) x 0 0.1 * 0.2 7 | 8 | -- quadC 9 | let x = mouseX kr 3.5441 4 Linear 0.1 10 | f = quadC ar 4 (negate x) x 0 0.1 * 800 + 900 11 | in sinOsc ar f 0 * 0.1 12 | 13 | -------------------------------------------------------------------------------- /Help/Ugen/quadL.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. quadC 2 | -------------------------------------------------------------------------------- /Help/Ugen/quadN.help.hs: -------------------------------------------------------------------------------- 1 | ---- c.f. quadC 2 | -------------------------------------------------------------------------------- /Help/Ugen/rDelaySet.help.hs: -------------------------------------------------------------------------------- 1 | -- rDelaySet; three one second delays 2 | let x = mouseX kr 110 660 Linear 0.2 3 | y = mouseY kr 0 0.1 Linear 0.2 4 | s = sinOsc ar x 0 * y 5 | d = X.rDelaySet s (mce [1,1,1/5,2,1/2,1/10,3,1/3,1/15]) 6 | in mce2 s d 7 | -------------------------------------------------------------------------------- /Help/Ugen/rDelaySetBuf.help.hs: -------------------------------------------------------------------------------- 1 | -- rDelaySetB ; three one second delays 2 | let x = mouseX kr 110 660 Linear 0.2 3 | y = mouseY kr 0 1 Linear 0.2 4 | s = sinOsc ar x 0 * y 5 | b = clearBuf (localBufId 'α' 1 (5 * 44100)) 6 | d = X.rDelaySetBuf ar b s (mce [1,1,1/5,2,1/2,1/10,3,1/3,1/15]) 7 | in mce2 s d * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/radiansPerSample.help.hs: -------------------------------------------------------------------------------- 1 | -- radiansPerSample ; two pi divided by the nominal sample rate (ie. a very small number) 2 | let f = mce2 radiansPerSample ((2 * pi) / sampleRate) * 5000000 3 | in sinOsc ar f 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/rand.help.hs: -------------------------------------------------------------------------------- 1 | -- rand 2 | let f = randId 'α' 200 1200 3 | l = randId 'β' (-1) 1 4 | e = line kr 0.2 0 0.1 RemoveSynth 5 | o = fSinOsc ar f 0 6 | in pan2 (o * e) l 1 7 | 8 | -- rand 9 | sinOsc ar (lfNoise1Id 'α' kr (6 + mce2 (randId 'β' (-4) 4) (randId 'γ' (-4) 4)) * 100 + 200) 0 * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/rand2.help.hs: -------------------------------------------------------------------------------- 1 | -- rand2 ; composite ugen 2 | sinOsc ar (220 + rand2 110) 0 * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/randID.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/randID.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/randN.help.hs: -------------------------------------------------------------------------------- 1 | -- randN ; two channel sin tones 2 | sinOsc ar (X.randN 2 440 442) 0 * 0.1 3 | 4 | -- randN ; two channel sin tones ; id 5 | sinOsc ar (X.randNId 2 'α' 440 442) 0 * 0.1 6 | 7 | -- randN ; n node klang synthesis ; id 8 | let n = 240 9 | f = X.randNId n 'α' 40 18000 10 | a = X.randNId n 'β' 0.1 0.3 11 | p = X.randNId n 'γ' (-1) 1 12 | s = klangSpec_mce f a p 13 | in klang ar 1 0 s * 0.05 14 | 15 | -- randN ; mce... 16 | let f = X.randNId 2 'α' (mce2 440 441) 442 in sinOsc ar f 0 * 0.1 17 | -------------------------------------------------------------------------------- /Help/Ugen/rcd.help.hs: -------------------------------------------------------------------------------- 1 | -- rcd ; rotating clock divider 2 | let freqs = mce (map (\i -> midiCps (i * 5 + 50)) [0 .. 8]) 3 | amps = mce [1, 0.5, 0.3, 0.3, 0.3, 0.2, 0.2, 0.2] 4 | tr = lfPulse ar 7 0 0.01 5 | rot = -2 6 | spread = tiRandId 'α' 0 1 (impulse kr 0.13 0) 7 | dv = tiRandId 'β' 0 3 (impulse kr 0.1 0) 8 | pulses = X.rcd tr rot 0 dv spread 0 0 0 1 9 | oscs = sinOsc ar freqs 0 * pulses * amps 10 | sig = splay (mceRotate 3 oscs) 1 0.25 0 True 11 | in sig + combN sig 2 (mce [2, 1]) 3 * 0.3 12 | -------------------------------------------------------------------------------- /Help/Ugen/redPhasor2.help.hs: -------------------------------------------------------------------------------- 1 | -- redPhasor2 ; no looping & it will play through once ; mouse x acts as trigger 2 | let tr = mouseX kr 0 1 Linear 0.2 `greater_than` 0.5 3 | in sinOsc ar (X.redPhasor2 kr tr 0.3 400 800 0 500 600) 0 * 0.2 4 | 5 | -- redPhasor2 ; start value greater than end value, negative rate, c.f. redPhasor 6 | let tr = mouseX kr 0 1 Linear 0.2 `greater_than` 0.5 7 | in sinOsc ar (X.redPhasor2 kr tr (-0.3) 800 400 0 500 600) 0 * 0.2 8 | -------------------------------------------------------------------------------- /Help/Ugen/rhpf.help.hs: -------------------------------------------------------------------------------- 1 | -- rhpf 2 | let f = fSinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 3 | in rhpf (saw ar 200 * 0.1) f 0.2 4 | 5 | -- rhpf 6 | let c = rhpf (lfSaw kr 2 0) (sinOsc kr (xLine kr 0.7 30 20 RemoveSynth) 0 * 35 + 40) 0.05 7 | in sinOsc ar (c * 200 + 500) 0 * 0.25 8 | -------------------------------------------------------------------------------- /Help/Ugen/ring1.help.hs: -------------------------------------------------------------------------------- 1 | -- ring1 2 | let a = fSinOsc ar 800 0 3 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in ring1 a b * 0.125 5 | 6 | -- ring1 ; written out 7 | let a = fSinOsc ar 800 0 8 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in ((a * b) + a) * 0.125 10 | -------------------------------------------------------------------------------- /Help/Ugen/ring2.help.hs: -------------------------------------------------------------------------------- 1 | -- ring2 2 | let a = fSinOsc ar 800 0 3 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in ring2 a b * 0.125 5 | 6 | -- ring2 ; written out 7 | let a = fSinOsc ar 800 0 8 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in ((a * b) + a + b) * 0.125 10 | -------------------------------------------------------------------------------- /Help/Ugen/ring3.help.hs: -------------------------------------------------------------------------------- 1 | -- ring3 2 | let a = fSinOsc ar 800 0 3 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in ring3 a b * 0.125 5 | 6 | -- ring3 ; written out 7 | let a = fSinOsc ar 800 0 8 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in (a * a * b) * 0.125 10 | -------------------------------------------------------------------------------- /Help/Ugen/ring4.help.hs: -------------------------------------------------------------------------------- 1 | -- ring4 2 | let a = fSinOsc ar 800 0 3 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in ring4 a b * 0.125 5 | 6 | -- ring4 ; written out 7 | let a = fSinOsc ar 800 0 8 | b = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in (((a * a * b) - (a * b * b))) * 0.125 10 | -------------------------------------------------------------------------------- /Help/Ugen/rlpfd.help.hs: -------------------------------------------------------------------------------- 1 | -- rlpfd 2 | let s = mix (lfSaw ar (mce2 120 180) 0 * 0.33) 3 | f = linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 280 1500 4 | in X.rlpfd s f 0.6 0.5 5 | -------------------------------------------------------------------------------- /Help/Ugen/rmShelf.help.hs: -------------------------------------------------------------------------------- 1 | -- rmShelf2 ; default parameters ; rm=regalia-mitra freq=cut-off frequency (hz) k=gain (db) 2 | X.rmShelf2 ar (whiteNoiseId 'α' ar * 0.1) 440 0 3 | 4 | -- rmShelf2 ; freq=mouse-x 5 | let freq = mouseX kr 55 3520 Exponential 0.2 6 | in X.rmShelf2 ar (whiteNoiseId 'α' ar * 0.1) freq 0 7 | 8 | -- rmShelf2 ; k=mouse-y 9 | let freq = mouseX kr 55 3520 Exponential 0.2 10 | k = mouseY kr (-12) 12 Linear 0.2 11 | in X.rmShelf2 ar (whiteNoiseId 'α' ar * 0.1) freq k * 0.1 12 | 13 | -------------------------------------------------------------------------------- /Help/Ugen/rmeq.help.hs: -------------------------------------------------------------------------------- 1 | -- rmeq ; default param ; rm=regalia-mitra freq=cut-off frequency (hz) rq=reciprocal-of-Q k=gain (db) 2 | X.rmeq (pinkNoiseId 'α' ar * 0.1) 440 1 0 3 | 4 | -- rmeq ; rapid param changes fail at low frequencies 5 | let freq = mouseX kr 55 3520 Exponential 0.2 6 | rq = mouseY kr 0.01 2.0 Linear 0.2 7 | k = 3 8 | in X.rmeq (pinkNoiseId 'α' ar * 0.1) freq rq k 9 | -------------------------------------------------------------------------------- /Help/Ugen/rossler.help.lhs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rd--/hsc3/08668373cbf494959288d5cfc9c678b9ea362a46/Help/Ugen/rossler.help.lhs -------------------------------------------------------------------------------- /Help/Ugen/rotate2.help.hs: -------------------------------------------------------------------------------- 1 | -- rotate2 ; rotation of stereo sound, via LFO 2 | let x = pinkNoiseId 'α' ar 3 | y = lfTri ar 800 0 * lfPulse kr 3 0 0.3 4 | in rotate2 x y (lfSaw kr 0.1 0) * 0.1 5 | 6 | -- rotate2 ; rotation of stereo sound, via mouse ; rotateStereo is MCE form 7 | let x = mix (lfSaw ar (mce [198..201]) 0) * 0.25 8 | y = sinOsc ar 900 0 * lfPulse kr 3 0 0.3 9 | p = mouseX kr 0 2 Linear 0.2 10 | in rotateStereo (mce2 x y) p * 0.1 11 | -------------------------------------------------------------------------------- /Help/Ugen/roundUp.help.hs: -------------------------------------------------------------------------------- 1 | -- roundUp 2 | let x = mouseX kr 60 4000 Linear 0.1 3 | f = roundUp x 100 4 | in sinOsc ar f 0 * 0.1 5 | 6 | -- roundUp 7 | let n = line kr 24 108 6 RemoveSynth 8 | in saw ar (midiCps (roundUp n 1)) * 0.2 9 | -------------------------------------------------------------------------------- /Help/Ugen/rpvDecayTbl.help.hs: -------------------------------------------------------------------------------- 1 | -- RPVDecayTbl ; random decay multipliers 2 | let b0 = clearBuf (localBuf 1 2048) 3 | b1 = asLocalBuf (mceChannels (X.randN 1024 0.5 0.975)) 4 | b2 = clearBuf (localBuf 1 1024) 5 | in ifft' (X.rpvDecayTbl (fft' b0 (soundIn 0)) b1 b2) 6 | 7 | -- RPVDecayTbl ; random decay multipliers ; id 8 | let b0 = clearBuf (localBufId 'α' 1 2048) 9 | b1 = asLocalBufId 'β' (mceChannels (X.randNId 1024 'γ' 0.5 0.975)) 10 | b2 = clearBuf (localBufId 'δ' 1 1024) 11 | in ifft' (X.rpvDecayTbl (fft' b0 (soundIn 0)) b1 b2) 12 | -------------------------------------------------------------------------------- /Help/Ugen/runningMax.help.hs: -------------------------------------------------------------------------------- 1 | -- runningMax 2 | let n = dust ar 20 3 | t = impulse ar 0.4 0 4 | f = runningMax n t * 500 + 200 5 | in t + sinOsc ar f 0 * 0.2 6 | 7 | -- runningMax ; follow a sine lfo, reset rate controlled by mouse x 8 | let t = impulse kr (mouseX kr 0.01 2 Linear 0.1) 0 9 | f = runningMax (sinOsc kr 0.2 0) t * 500 + 200 10 | in t + sinOsc ar f 0 * 0.2 11 | 12 | -- runningMax ; id 13 | let n = dustId 'α' ar 20 14 | t = impulse ar 0.4 0 15 | f = runningMax n t * 500 + 200 16 | in t + sinOsc ar f 0 * 0.2 17 | -------------------------------------------------------------------------------- /Help/Ugen/runningMin.help.hs: -------------------------------------------------------------------------------- 1 | -- runningMin ; follow a sine lfo, reset rate controlled by mouseX 2 | let o = sinOsc kr 2 pi 3 | x = mouseX kr 0.01 10 Exponential 0.1 4 | t = impulse ar x 0 5 | f = runningMin o t * 500 + 200 6 | in t + sinOsc ar f 0 * 0.1 7 | 8 | -- runningMin 9 | let n = dustId 'α' ar 20 10 | t = impulse ar 0.4 0 11 | f = runningMin n t * 500 + 200 12 | in sinOsc ar f 0 * 0.2 13 | -------------------------------------------------------------------------------- /Help/Ugen/runningSum.help.hs: -------------------------------------------------------------------------------- 1 | -- runningSum ; distorts of course, would need scaling 2 | runningSum (soundIn 0 * 0.1) 40 3 | 4 | -- runningSum ; running average over x samples 5 | let x = 100 in runningSum (lfSaw ar 440 0 * 0.1) x * recip x 6 | 7 | -- runningSum ; rms power 8 | let input = lfSaw ar 440 0 * 0.1 9 | numsamp = 30 10 | in runningSum (input * input) numsamp / (sqrt numsamp) 11 | 12 | -- runningSum ; composite UGen 13 | runningSumRMS (soundIn 0) 40 * 0.1 14 | 15 | -- runningSum 16 | let z = soundIn 0 17 | a = runningSum z 40 18 | in sinOsc ar 440 0 * a * 0.1 19 | -------------------------------------------------------------------------------- /Help/Ugen/sampleDur.help.hs: -------------------------------------------------------------------------------- 1 | -- sampleDur ; the reciprocal of the nominal sample rate of the server 2 | let f = mce2 sampleRate (recip sampleDur) * 0.01 3 | in sinOsc ar f 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/sampleRate.help.hs: -------------------------------------------------------------------------------- 1 | -- sampleRate ; the current nominal sample rate of the server 2 | let sr = 48000 {- 44100 -} 3 | f = mce2 sampleRate sr * 0.01 4 | in sinOsc ar f 0 * 0.1 5 | 6 | ---- ; server status ; extract nominal and actual sample rates from the synthesis server 7 | withSc3 (Control.Monad.liftM2 (,) serverSampleRateNominal serverSampleRateActual) 8 | -------------------------------------------------------------------------------- /Help/Ugen/sanitize.help.hs: -------------------------------------------------------------------------------- 1 | -- sanitize ; when frequency is nan set to 220 2 | let freq = tChoose (impulse kr 1 0) (mce2 440 (0 / 0)) 3 | in sinOsc ar (sanitize freq 220) 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/sawDPW.help.hs: -------------------------------------------------------------------------------- 1 | -- sawDPW 2 | X.sawDPW ar (xLine kr 2000 20 10 DoNothing) 0 * 0.1 3 | 4 | -- sawDPW 5 | X.sawDPW ar (mouseX kr 200 12000 Exponential 0.2) 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/scaleNeg.help.hs: -------------------------------------------------------------------------------- 1 | -- scaleNeg 2 | scaleNeg (fSinOsc ar 500 0) (line ar 1 (-1) 4 RemoveSynth) * 0.1 3 | 4 | -- scaleNeg ; written out 5 | let o = fSinOsc ar 500 0 6 | l = line ar 1 (-1) 4 RemoveSynth 7 | c = o `less_than` 0 8 | in (c * (o * l) + (1 - c) * o) * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/schmidt.help.hs: -------------------------------------------------------------------------------- 1 | -- schmidt ; threshold octave jumps 2 | let n = lfNoise1Id 'α' kr 3 3 | o = schmidt n (-0.15) 0.15 + 1 4 | in sinOsc ar (n * 200 + 500 * o) 0 * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/selectX.help.hs: -------------------------------------------------------------------------------- 1 | -- selectX ; composite ugen graph 2 | let n = 3/2 3 | f = mce2 440 441 4 | a = mce [sinOsc ar f 0, saw ar f, pulse ar f 0.1] 5 | in mix (selectX (lfSaw kr 1 0 * n + n) a * 0.1) 6 | 7 | -- selectX ; as sequencer 8 | let n = 10 9 | a = mce [517, 403, 89, 562, 816, 107, 241, 145, 90, 224] 10 | c = n / 2 11 | f = selectX (lfSaw kr 0.5 0 * c + c) a 12 | in saw ar f * 0.1 13 | -------------------------------------------------------------------------------- /Help/Ugen/sendReply.help.hs: -------------------------------------------------------------------------------- 1 | -- sendReply 2 | let s0 = lfNoise0Id 'α' kr 5 3 | s1 = lfNoise0Id 'β' kr 5 4 | o = sinOsc ar (s0 * 200 + 500) 0 * s1 * 0.1 5 | in mrg [o,sendReply s0 0 "/send-reply" [s0,s1]] 6 | 7 | ---- ; receive reply 8 | withSc3 (withNotifications (Sound.OSC.waitReply "/send-reply")) 9 | -------------------------------------------------------------------------------- /Help/Ugen/sensoryDissonance.help.hs: -------------------------------------------------------------------------------- 1 | -- sensoryDissonance ; noteId 'norm' input calculation 2 | let sig = soundIn 0 3 | chn = fft' (localBufId 'α' 1 2048) sig 4 | maxpeaks = 100 5 | dissonance = X.sensoryDissonance kr chn 100 0.1 (0.01 / maxpeaks) 1 6 | in pan2 (blip ar 100 (sqrt dissonance * 200)) 0 0.1 7 | -------------------------------------------------------------------------------- /Help/Ugen/setResetFF.help.hs: -------------------------------------------------------------------------------- 1 | -- setResetFF ; d0 is the set trigger, d1 the reset trigger 2 | let d0 = dustId 'β' ar 5 3 | d1 = dustId 'γ' ar 5 4 | in brownNoiseId 'α' ar * setResetFF d0 d1 * 0.1 5 | 6 | -- setResetFF ; silence 7 | let tr = setResetFF (impulse kr 5 0) (impulse kr 10 0) 8 | in brownNoiseId 'α' ar * decay2 tr 0.01 0.05 * 0.1 9 | 10 | -- setResetFF ; duty cycle 11 | let tr = 1 - setResetFF (impulse kr 10 0) (impulse kr 5 0) 12 | in brownNoiseId 'α' ar * decay2 tr 0.01 0.05 * 0.1 13 | -------------------------------------------------------------------------------- /Help/Ugen/silent.help.hs: -------------------------------------------------------------------------------- 1 | -- silent ; c.f. dc 2 | silent 2 3 | -------------------------------------------------------------------------------- /Help/Ugen/sin.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; Drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "Sin" 3 | Sound.Sc3.Plot.plot_fn_r1_ln sin (0,2 * pi) 4 | -------------------------------------------------------------------------------- /Help/Ugen/sinGrain.help.hs: -------------------------------------------------------------------------------- 1 | -- sinGrain 2 | X.sinGrain ar (impulse kr 10 0) 0.1 (range 440 880 (whiteNoiseId 'α' kr)) * 0.1 3 | 4 | -- sinGrain ; mouse control 5 | let x = mouseX kr 0.001 0.2 Linear 0.1 6 | y = mouseX kr 90 600 Linear 0.1 7 | in X.sinGrain ar (dustId 'β' kr 25) x y * 0.1 8 | 9 | -- sinGrain ; ln 2021-04-13 https://lukasnowok.github.io/spectrology/ 10 | X.sinGrain ar (impulse ar (sinOsc ar (1/6) 0 `in_range` (8,4000)) 0) 0.005 10000 11 | 12 | ---- ; drawings 13 | UI.ui_baudline 4096 50 "linear" 2 14 | -------------------------------------------------------------------------------- /Help/Ugen/sinOscFB.help.hs: -------------------------------------------------------------------------------- 1 | -- sinOscFB 2 | let x = mouseX kr 0 4 Linear 0.2 3 | in sinOscFB ar (mce2 400 301) x * 0.1 4 | 5 | -- sinOscFB 6 | let y = mouseY kr 10 1000 Exponential 0.2 7 | x = mouseX kr (pi/2) pi Linear 0.2 8 | in sinOscFB ar y x * 0.1 9 | 10 | -- sinOscFB 11 | let y = mouseY kr 1 1000 Exponential 0.2 12 | x = mouseX kr (pi/2) pi Linear 0.2 13 | in sinOscFB ar (100 * sinOscFB ar y 0 + 200) x * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/sineShaper.help.hs: -------------------------------------------------------------------------------- 1 | -- sineShaper 2 | X.sineShaper (sinOsc ar (mce2 400 404) 0 * 0.2) (mouseX kr 0 1 Linear 0.2) 3 | 4 | -- sineShaper 5 | X.sineShaper (soundIn 0) (mouseX kr 0 1 Linear 0.2) 6 | -------------------------------------------------------------------------------- /Help/Ugen/sinh.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "SinH" 3 | Sound.Sc3.Plot.plot_fn_r1_ln sinh (-4,4) 4 | -------------------------------------------------------------------------------- /Help/Ugen/slew.help.hs: -------------------------------------------------------------------------------- 1 | -- slew 2 | let z = lfPulse ar 800 0 0.5 * 0.1 in mce2 z (slew z 4000 4000) 3 | 4 | -- slew 5 | let z = saw ar 800 * 0.1 in mce2 z (slew z 400 400) 6 | 7 | -- slew 8 | let x = mouseX kr 200 12000 Exponential 0.2 9 | y = mouseY kr 200 12000 Exponential 0.2 10 | in mce2 (slew (0 - saw ar 440) x y * 0.05) (slew (lfPulse ar 800 0 0.5) x y * 0.1) 11 | 12 | ---- ; drawings 13 | Sound.Sc3.Plot.plot_ugen1 0.025 (lfPulse ar 800 0 0.5) 14 | Sound.Sc3.Plot.plot_ugen1 0.025 (slew (lfPulse ar 800 0 0.5) 4000 4000) 15 | Sound.Sc3.Plot.plot_ugen1 0.025 (slew (lfPulse ar 800 0 0.5) 500 500) 16 | -------------------------------------------------------------------------------- /Help/Ugen/slope.help.hs: -------------------------------------------------------------------------------- 1 | -- slope 2 | let a = lfNoise2Id 'α' ar 2 {- quadratic noise -} 3 | b = slope a {- first derivative, line segments -} 4 | c = slope b {- second derivative, constant segments -} 5 | s = 0.0002 6 | f = mce [a, b * s, c * s * s] * 220 + 220 7 | in mix (sinOsc ar f 0 * 0.1) 8 | 9 | ---- ; drawings 10 | let {a = lfNoise2Id 'α' ar 2000;b = slope a;c = slope b;m = 0.0002} 11 | Sound.Sc3.Plot.plot_ugen 0.05 (mce [a,b * m,c * m * m]) 12 | -------------------------------------------------------------------------------- /Help/Ugen/sms.help.hs: -------------------------------------------------------------------------------- 1 | -- sms ; sine reconstruction left channel, noises on right (sample rate must be 44100) 2 | let z = soundIn 0 3 | y = mouseY kr 1 50 Linear 0.2 4 | x = mouseX kr 0.5 4 Linear 0.2 5 | in X.sms {- ar -} z 50 y 8 0.3 x 0 0 0 1 (-1) 6 | 7 | -- sms ; default param 8 | let z = soundIn 0 9 | in X.sms {- ar -} z 80 80 4 0.2 1 0 0 0 1 (-1) 10 | -------------------------------------------------------------------------------- /Help/Ugen/softClip.help.hs: -------------------------------------------------------------------------------- 1 | -- softClip 2 | softClip (fSinOsc ar 500 0 * xLine kr 0.1 10 10 RemoveSynth) * 0.25 3 | -------------------------------------------------------------------------------- /Help/Ugen/softClipAmp.help.hs: -------------------------------------------------------------------------------- 1 | -- softClipAmp4 2 | X.softClipAmp4 (sinOsc ar 220 0 * 0.1) (mouseX kr 1 16 Linear 0.2) 3 | 4 | -- softClipAmp4 5 | X.softClipAmp4 (soundIn 0) (mouseX kr 1 8 Linear 0.2) 6 | 7 | -------------------------------------------------------------------------------- /Help/Ugen/sortBuf.help.hs: -------------------------------------------------------------------------------- 1 | -- sortBuf ; gradual erosion 2 | let bufnum = 0 3 | in pan2 (X.sortBuf ar bufnum (lfNoise0 kr 5 * 50000 + 60000) 0) 0 0.1 4 | 5 | ---- ; load sndfile 6 | withSc3 (async (b_allocRead 0 (sfResolve "pf-c5.aif") 0 0)) 7 | withSc3 (async (b_allocRead 0 (sfResolve "a11wlk01.wav") 0 0)) 8 | -------------------------------------------------------------------------------- /Help/Ugen/soundIn.help.hs: -------------------------------------------------------------------------------- 1 | -- soundIn ; composite of in' and numOutputBuses 2 | soundIn 0 * 0.5 3 | 4 | -- soundIn ; copy input from 1 & 0 to outputs 0 & 1. 5 | soundIn (mce2 1 0) * 0.5 6 | 7 | -- ; io matrix (0->0,1->2,2->1,3->3) 8 | -- 9 | -- 0 1 2 3 10 | -- 0 * 11 | -- 1 * 12 | -- 2 * 13 | -- 3 * 14 | soundIn (mce [0, 2, 1, 3]) 15 | -------------------------------------------------------------------------------- /Help/Ugen/specCentroid.help.hs: -------------------------------------------------------------------------------- 1 | -- specCentroid ; as the number of harmonics increases, the centroid is pushed higher 2 | let f0 = mouseY kr 1000 100 Exponential 0.2 3 | nh = mouseX kr 1 100 Exponential 0.2 4 | z = blip ar f0 nh 5 | f = fft' (localBufId 'α' 2048 1) z 6 | c = specCentroid kr f 7 | p = pollExt (impulse kr 1 0) c 0 (label "c") 8 | in sinOsc ar p 0 * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/specFlatness.help.hs: -------------------------------------------------------------------------------- 1 | -- specFlatness 2 | let z = soundIn 0 3 | g = 1 {- gain, set as required -} 4 | a = pollExt 1 (X.wAmp kr z 0.05) 0 (label "a") 5 | f = fft' (localBufId 'α' 2048 1) z 6 | c = pollExt 1 (specCentroid kr f) 0 (label "c") 7 | w = pollExt 1 (specFlatness kr f) 0 (label "w") 8 | in bpf (pinkNoiseId 'a' ar) c w * a * g 9 | -------------------------------------------------------------------------------- /Help/Ugen/spectralEntropy.help.hs: -------------------------------------------------------------------------------- 1 | -- spectralEntropy ; note numChannels and numBands must be equal 2 | let sig = soundIn 0 3 | chn = fft' (localBufId 'α' 1 2048) sig 4 | entropy = X.spectralEntropy 1 kr chn 2048 1 5 | in pan2 (blip ar 100 (sqrt entropy * 10)) 0 0.1 6 | 7 | -- spectralEntropy 8 | let sig = soundIn 0 9 | amp = amplitude kr sig 0.01 0.01 10 | chn = fft' (localBufId 'α' 1 1024) sig 11 | entropy = X.spectralEntropy 10 kr chn 1024 10 * (min amp 0.2) * 5 12 | in splay (blip ar (sqrt entropy * 200) (sqrt entropy)) 1 0.1 0 True 13 | -------------------------------------------------------------------------------- /Help/Ugen/spreader.help.hs: -------------------------------------------------------------------------------- 1 | -- spreader 2 | let theta = pi / 2 3 | filtsPerOctave = 8 4 | in X.spreader ar (pinkNoiseId 'α' ar * 0.1) theta filtsPerOctave 5 | 6 | -- spreader 7 | let theta = mouseX kr 0 (pi / 2) Linear 0.2 8 | filtsPerOctave = 8 9 | in X.spreader ar (pinkNoiseId 'α' ar * 0.1) theta filtsPerOctave 10 | 11 | -- spreader 12 | let in_ = sinOsc ar (mouseX kr 110 880 Exponential 0.2) 0 * 0.1 13 | theta = pi / 2 14 | filtsPerOctave = 8 15 | in X.spreader ar in_ theta filtsPerOctave 16 | -------------------------------------------------------------------------------- /Help/Ugen/sqrDif.help.hs: -------------------------------------------------------------------------------- 1 | -- sqrDif 2 | (fSinOsc ar 800 0 `sqrDif` fSinOsc ar (xLine kr 200 500 5 DoNothing) 0) * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/sqrSum.help.hs: -------------------------------------------------------------------------------- 1 | -- sqrSum 2 | (fSinOsc ar 800 0 `sqrSum` fSinOsc ar (xLine kr 200 500 5 DoNothing) 0) * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/standard2DL.help.hs: -------------------------------------------------------------------------------- 1 | -- standard2DL ; mouse-controlled param 2 | let x0 = 4.9789799812499 3 | y0 = 5.7473416156381 4 | in X.standard2DL ar 11025 44100 (mouseX kr 0.9 4 Linear 0.2) x0 y0 * 0.3 5 | 6 | -- standard2DL ; as a frequency control 7 | let x0 = 4.9789799812499 8 | y0 = 5.7473416156381 9 | k = mouseX kr 0.9 4 Linear 0.2 10 | f = X.standard2DL ar 10 20 k x0 y0 * 800 + 900 11 | in sinOsc ar f 0 * 0.3 12 | -------------------------------------------------------------------------------- /Help/Ugen/standardL.help.hs: -------------------------------------------------------------------------------- 1 | -- standardL 2 | standardL ar (sampleRate / 2) 1.0 0.5 0 * 0.1 3 | 4 | -- standardL ; vary frequency 5 | standardL ar (mouseX kr 20 sampleRate Linear 0.2) 1 0.5 0 * 0.1 6 | 7 | -- standardL ; mouse-controlled param 8 | standardL ar (sampleRate / 2) (mouseX kr 0.9 4 Linear 0.2) 0.5 0 * 0.1 9 | 10 | -- standardL ; frequency control 11 | sinOsc ar (standardL ar 40 (mouseX kr 0.9 4 Linear 0.2) 0.5 0 * 800 + 900) 0 * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/stkPluck.help.hs: -------------------------------------------------------------------------------- 1 | -- stkPluck ; default param 2 | let delete_when_silent s a t = mrg2 s (detectSilence s a t RemoveSynth) 3 | in delete_when_silent (X.stkPluck ar 440 0.99) 0.001 0.5 4 | 5 | -- stkPluck ; rand param ; texture=spawn,1,inf 6 | let freq = midiCps (iRandId 'α' 32 96) 7 | decay_ = randId 'β' 0.95 0.99 8 | s = leakDC (X.stkPluck ar freq decay_) 0.995 9 | in mrg2 s (detectSilence s 0.001 0.5 RemoveSynth) 10 | -------------------------------------------------------------------------------- /Help/Ugen/streson.help.hs: -------------------------------------------------------------------------------- 1 | -- streson ; http://www.csounds.com/manual/html/streson.html 2 | let z = lfSaw ar (mce2 220 180) 0 * 0.2 3 | dt = recip (linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 280 377) 4 | in X.streson z dt 0.9 * 0.1 5 | 6 | -- streson ; c.f. Sound.Sc3.Data.Modal.modal_frequency_ratios 7 | let dt = recip (linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 280 377) 8 | in X.streson (soundIn 0) dt 0.9 * 0.1 9 | 10 | ---- ; drawings 11 | Sound.Sc3.Plot.plot_ugen_nrt (20,1) 16.0 (recip (linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 280 377)) 12 | -------------------------------------------------------------------------------- /Help/Ugen/sub.help.hs: -------------------------------------------------------------------------------- 1 | -- sub (-) 2 | let o = fSinOsc ar 800 0 3 | n = pinkNoiseId 'α' ar 4 | in (o - n) * 0.1 5 | 6 | -- sub ; dc offset 7 | fSinOsc ar 440 0 * 0.1 - 0.5 8 | 9 | -- sub ; optimise identity 10 | (sinOsc ar 440 0 - 0) * 0.1 11 | -------------------------------------------------------------------------------- /Help/Ugen/subsampleOffset.help.hs: -------------------------------------------------------------------------------- 1 | -- subsampleOffset; impulse train that can be moved between samples 2 | let i = impulse ar 2000 0 3 | z = 4 4 | o = (1 - subsampleOffset) + mouseX kr 0 (z - 1) Linear 0.1 5 | r = delayC i (sampleDur * z) (sampleDur * o) 6 | in mrg2 (out 0 (pan2 i (-1) 0.1)) (offsetOut 0 (pan2 r 1 0.1)) 7 | 8 | ---- ; drawings 9 | UI.ui_sc3_scope 2 0 (2 ^ 14) 100 "audio" 0 10 | 11 | {- Create two pulse trains and move one relative to the other. When 12 | cursor is at the left, the impulses are adjacent, on the right, they 13 | are z samples apart. View this with an oscilloscope. -} 14 | -------------------------------------------------------------------------------- /Help/Ugen/sum3.help.hs: -------------------------------------------------------------------------------- 1 | -- sum3 2 | sum3 (sinOsc ar 440 0) (sinOsc ar 441 0) (sinOsc ar 442 0) * 0.1 3 | 4 | -- sum3 ; optimiser/re-writer applicable at ADD 5 | (sinOsc ar 440 0 + sinOsc ar 441 0 + sinOsc ar 442 0) * 0.1 6 | 7 | -- sum3 8 | mix (sinOsc ar (mce [440 .. 442]) 0) * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/sum4.help.hs: -------------------------------------------------------------------------------- 1 | -- sum4 2 | sum4 (sinOsc ar 440 0) (sinOsc ar 441 0) (sinOsc ar 442 0) (sinOsc ar 443 0) * 0.1 3 | 4 | -- sum4 ; optimiser/re-writer applicable at ADD 5 | mix (sinOsc ar (mce [440 .. 443]) 0) * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/sumSqr.help.hs: -------------------------------------------------------------------------------- 1 | -- sumSqr 2 | let o1 = fSinOsc ar 800 0 3 | o2 = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 4 | in sumSqr o1 o2 * 0.125 5 | 6 | -- sumSqr ; written out 7 | let o1 = fSinOsc ar 800 0 8 | o2 = fSinOsc ar (xLine kr 200 500 5 DoNothing) 0 9 | in (o1 * o1 + o2 * o2) * 0.125 10 | -------------------------------------------------------------------------------- /Help/Ugen/summer.help.hs: -------------------------------------------------------------------------------- 1 | -- summer 2 | sinOsc ar (X.summer (impulse kr 5 0) 1.5 0 0 * 100) 0 * 0.1 3 | 4 | -- summer 5 | let s_trig = dustId 'α' kr 5 6 | s_reset = impulse kr 0.5 0 7 | in sinOsc ar (X.summer s_trig (mce2 0.5 0.25) s_reset 1 * 100) 0 * 0.1 8 | -------------------------------------------------------------------------------- /Help/Ugen/svfBp.help.hs: -------------------------------------------------------------------------------- 1 | -- svfBp ; changing F 2 | let f = xLine kr 20 20000 20 DoNothing 3 | in X.svfBp (whiteNoiseId 'α' ar * 0.1) f 1 4 | 5 | -- svfBp ; changing Q 6 | let q = line kr 10 0.0001 20 RemoveSynth 7 | in X.svfBp (whiteNoiseId 'α' ar * 0.1) 400 q 8 | 9 | -- svfBp ; controls 10 | X.svfBp (saw ar 200 * control kr "amp" 0.1) (control kr "freq" 440) (control kr "q" 1) 11 | 12 | -- svfBp 13 | let f = sinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 14 | in X.svfBp (saw ar 200 * 0.1) f (control kr "q" 1) 15 | 16 | ---- ; drawings 17 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.05 (X.svfBp (whiteNoiseId 'α' ar) 900 1) 18 | -------------------------------------------------------------------------------- /Help/Ugen/svfHp.help.hs: -------------------------------------------------------------------------------- 1 | -- svfHp ; changing F 2 | let f = xLine kr 20000 20 20 RemoveSynth 3 | in X.svfHp (whiteNoiseId 'α' ar * 0.1) f 1 4 | 5 | -- svfHp ; changing Q 6 | let q = line kr 2 0.0001 20 RemoveSynth 7 | in X.svfHp (whiteNoiseId 'α' ar * 0.1) 12000 q 8 | 9 | -- svfHp ; controls 10 | X.svfHp (saw ar 200 * control kr "amp" 0.1) (control kr "freq" 440) (control kr "q" 1) 11 | 12 | -- svfHp 13 | let f = sinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 14 | in X.svfHp (saw ar 200 * 0.1) f (control kr "q" 1) 15 | 16 | ---- ; drawings 17 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.05 (X.svfHp (whiteNoiseId 'α' ar) 12000 1) 18 | -------------------------------------------------------------------------------- /Help/Ugen/svfLp.help.hs: -------------------------------------------------------------------------------- 1 | -- svfLp ; changing F 2 | let f = xLine kr 20 20000 20 RemoveSynth 3 | in X.svfLp (whiteNoiseId 'α' ar * 0.1) f 1 4 | 5 | -- svfLp ; changing Q 6 | let q = line kr 2 0.0001 20 RemoveSynth 7 | in X.svfLp (whiteNoiseId 'α' ar * 0.1) 400 q 8 | 9 | -- svfLp ; controls 10 | X.svfLp (saw ar 200 * control kr "amp" 0.1) (control kr "freq" 440) (control kr "q" 1) 11 | 12 | -- svfLp 13 | let f = sinOsc kr (xLine kr 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 14 | in X.svfLp (saw ar 200 * 0.1) f (control kr "q" 1) 15 | 16 | ---- ; drawings 17 | Sound.Sc3.Plot.FFT.plot_ugen_fft1 0.05 (X.svfLp (whiteNoiseId 'α' ar) 900 1) 18 | -------------------------------------------------------------------------------- /Help/Ugen/switchDelay.help.hs: -------------------------------------------------------------------------------- 1 | -- switchDelay ; simple feedback delay 2 | X.switchDelay (soundIn 0) 1 1 1 0.99 20 3 | 4 | -- switchDelay ; simple feedback delay 5 | X.switchDelay (soundIn 0) 1 0.7 0.4 0.6 20 6 | 7 | -- switchDelay ; change the buffer read pointer periodically. 8 | let ix = stepper (impulse kr 0.5 0) 0 0 3 1 0 9 | dt = select ix (mce [0.02,0.1,0.725,0.25]) 10 | in X.switchDelay (soundIn 0) 1 0.6 dt 0.7 20 11 | -------------------------------------------------------------------------------- /Help/Ugen/syncSaw.help.hs: -------------------------------------------------------------------------------- 1 | -- syncSaw 2 | let f = line kr 100 800 12 RemoveSynth 3 | in syncSaw ar 100 f * 0.1 4 | 5 | -- syncSaw ; mouse control 6 | let sy_f = mouseY kr 80 220 Exponential 0.2 7 | sw_f = sy_f * mouseX kr 1 3 Linear 0.2 8 | in syncSaw ar sy_f sw_f * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/t2a.help.hs: -------------------------------------------------------------------------------- 1 | -- t2a 2 | let tr = impulse kr (mouseX kr 1 100 Exponential 0.2) 0 3 | in ringz (t2a tr 0) 800 0.01 * 0.4 4 | 5 | -- t2a ; compare with k2a (oscilloscope) 6 | let tr = impulse kr 200 0 7 | in lag (mce2 (t2a tr 0) (k2a tr)) 0.001 8 | 9 | -- t2a ; removing jitter by randomising offset 10 | let tr = impulse kr (mouseX kr 1 100 Exponential 0.2) 0 11 | o = range 0 (blockSize - 1) (whiteNoiseId 'α' kr) 12 | in ringz (t2a tr o) 880 0.1 * 0.4 13 | 14 | ---- ; drawings 15 | UI.ui_sc3_scope 2 0 (2 ^ 14) 0 "audio" 0 16 | -------------------------------------------------------------------------------- /Help/Ugen/t2k.help.hs: -------------------------------------------------------------------------------- 1 | -- t2k 2 | trig (t2k (dustId 'α' ar 4)) 0.1 * sinOsc ar 800 0 * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/tBetaRand.help.hs: -------------------------------------------------------------------------------- 1 | -- tBetaRand 2 | let t = dustId 'α' kr 10 3 | f = X.tBetaRandId 'β' 300 3000 0.1 0.1 t 4 | in sinOsc ar f 0 * 0.1 5 | 6 | ---- ; ERROR ; tBetaRand ; mouse control of parameters (...scsynth -> 100% CPU -> CRASH) 7 | let t = dustId 'α' ar 10 8 | p1 = mouseX kr 1 5 Linear 0.2 9 | p2 = mouseY kr 1 5 Linear 0.2 10 | f = X.tBetaRandId 'β' 300 3000 p1 p2 t 11 | in sinOsc ar f 0 * 0.1 12 | 13 | ---- ; ERROR ; audio rate crashes server 14 | let t = dustId 'α' ar 100 15 | p1 = mouseX kr 1 5 Linear 0.2 16 | p2 = mouseY kr 1 5 Linear 0.2 17 | in lag (X.tBetaRandId 'β' (-1) 1 p1 p2 t) (10 / 48000) 18 | -------------------------------------------------------------------------------- /Help/Ugen/tBrownRand.help.hs: -------------------------------------------------------------------------------- 1 | -- tBrownRand 2 | let t = dustId 'α' kr 10 3 | dist = mouseX kr 0 5 Linear 0.2 4 | f = X.tBrownRandId 'β' 300 3000 1 dist t 5 | in sinOsc ar f 0 * 0.1 6 | 7 | -- tBrownRand 8 | let t = dustId 'α' kr 10 9 | n = X.tBrownRandId 'β' 0 1 0.2 0 t 10 | f = linExp n 0 1 300 3000 11 | o = sinOsc ar f 0 12 | l = X.tBrownRandId 'γ' (-1) 1 1 4 t 13 | in pan2 o l 0.1 14 | 15 | -- tBrownRand ; audio rate noise 16 | let x = mouseX kr 500 5000 Exponential 0.2 17 | y = mouseY kr 10 500 Exponential 0.2 18 | t = dustId 'α' ar x 19 | in lag (X.tBrownRandId 'β' (-1) 1 0.2 0 t) (y / 48000) 20 | -------------------------------------------------------------------------------- /Help/Ugen/tChoose.help.hs: -------------------------------------------------------------------------------- 1 | -- tChoose ; composite of tiRand and select 2 | let x = mouseX kr 1 1000 Exponential 0.1 3 | t = dustId 'a' ar x 4 | f = midiCps (tiRandId 'b' 48 60 t) 5 | o = let a = mce [sinOsc ar f 0 6 | ,saw ar (f * 2) 7 | ,pulse ar (f * 0.5) 0.1] 8 | in tChooseId 'c' t a 9 | in o * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/tDelay.help.hs: -------------------------------------------------------------------------------- 1 | -- tDelay 2 | let z = impulse ar 2 0 3 | z' = tDelay z 0.5 4 | o = sinOsc ar 440 0 * 0.1 5 | in mce [z * 0.1,toggleFF z' * o] 6 | -------------------------------------------------------------------------------- /Help/Ugen/tExpRand.help.hs: -------------------------------------------------------------------------------- 1 | -- tExpRand 2 | let f = tExpRandId 'α' 300.0 3000.0 (dustId 'β' kr 10) 3 | in sinOsc ar f 0 * 0.1 4 | 5 | -- tExpRand ; monadic form 6 | uid_st_eval 7 | (do f <- tExpRandM 300.0 3000.0 =<< dustM kr 10 8 | return (sinOsc ar f 0 * 0.1)) 9 | -------------------------------------------------------------------------------- /Help/Ugen/tExpRandN.help.hs: -------------------------------------------------------------------------------- 1 | -- tExpRandN ; n sine tones, set to exponentially-distributed random frequencies on trigger 2 | let n = 12 3 | tr = impulse kr 1 0 4 | in splay (sinOsc ar (X.tExpRandNId n 'α' 440 880 tr) 0) 1 0.1 0 True 5 | -------------------------------------------------------------------------------- /Help/Ugen/tGaussRand.help.hs: -------------------------------------------------------------------------------- 1 | -- tGaussRand ; c.f. tRand 2 | let t = dustId 'α' kr 10 3 | f = X.tGaussRandId 'β' 300 3000 t 4 | o = sinOsc ar f 0 5 | l = X.tGaussRandId 'γ' (-1) 1 t 6 | in pan2 o l 0.1 7 | 8 | -------------------------------------------------------------------------------- /Help/Ugen/tLine.help.hs: -------------------------------------------------------------------------------- 1 | -- tLine ; start and end reset randomly every 4 seconds, ramp every trigger 2 | let tr = impulse kr (1/4) 0 3 | f0 = tExpRandId 'α' 110 450 tr 4 | f1 = tExpRandId 'β' 110 440 tr 5 | in splay (sinOsc ar (mce [f0,tLine kr f0 f1 4 tr,f1]) 0) 1 1 0 True * mce [0.05,0.1,0.05] 6 | -------------------------------------------------------------------------------- /Help/Ugen/tRandN.help.hs: -------------------------------------------------------------------------------- 1 | -- tRandN ; n sine tones, set to uniform-random frequencies on trigger 2 | let n = 12 3 | tr = impulse kr 1 0 4 | in splay (sinOsc ar (X.tRandNId n 'α' 440 880 tr) 0) 1 0.1 0 True 5 | -------------------------------------------------------------------------------- /Help/Ugen/tScramble.help.hs: -------------------------------------------------------------------------------- 1 | -- tScramble ; two channel sin tones, channels scramble on impulse, scramble may be identity 2 | let tr = impulse kr 1 0 3 | in sinOsc ar (X.tScrambleId 'α' tr (mce2 440 880)) 0 * 0.1 4 | 5 | -- tScramble ; c-major sin tones across stereo field, scrambles on impulse 6 | let tr = impulse kr 1 0 7 | f = X.tScrambleId 'α' tr (mce (map midiCps [60,62,64,65,67,69,71,72])) 8 | in splay (sinOsc ar f 0 * 0.1) 1 1 0 True 9 | -------------------------------------------------------------------------------- /Help/Ugen/tWindex.help.hs: -------------------------------------------------------------------------------- 1 | -- tWindex 2 | let p = mce [1/5, 2/5, 2/5] 3 | a = mce [400, 500, 600] 4 | t = impulse kr 6 0 5 | i = tWindexId 'α' t 0 p 6 | in sinOsc ar (select i a) 0 * 0.1 7 | 8 | -- tWindex ; modulating probability values 9 | let p = mce [1/4, 1/2, sinOsc kr 0.3 0 * 0.5 + 0.5] 10 | a = mce [400, 500, 600] 11 | t = impulse kr 6 0 12 | i = tWindexId 'α' t 1 p 13 | in sinOsc ar (select i a) 0 * 0.1 14 | -------------------------------------------------------------------------------- /Help/Ugen/tXLine.help.hs: -------------------------------------------------------------------------------- 1 | -- tXLine ; start and end reset randomly every 4 seconds, ramp every trigger 2 | let tr = impulse kr (1/4) 0 3 | f0 = tExpRandId 'α' 110 450 tr 4 | f1 = tExpRandId 'β' 110 440 tr 5 | in splay (sinOsc ar (mce [f0,tXLine kr f0 f1 4 tr,f1]) 0) 1 1 0 True * mce [0.05,0.1,0.05] 6 | -------------------------------------------------------------------------------- /Help/Ugen/tan.help.hs: -------------------------------------------------------------------------------- 1 | ---- ; drawings 2 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "Tan" 3 | Sound.Sc3.Plot.plot_fn_r1_ln (Sound.Sc3.clip_hs (-6,6) . tan) (0,2 * pi) 4 | -------------------------------------------------------------------------------- /Help/Ugen/tanh.help.hs: -------------------------------------------------------------------------------- 1 | -- tanh 2 | let e = xLine kr 0.1 10 10 DoNothing 3 | o = fSinOsc ar 500 0.0 4 | in tanh (o * e) * 0.25 5 | 6 | ---- ; drawings 7 | Sound.Sc3.is_unary Sound.Sc3.Common.Base.CS "TanH" 8 | Sound.Sc3.Plot.plot_fn_r1_ln tanh (-4,4) 9 | -------------------------------------------------------------------------------- /Help/Ugen/tap.help.hs: -------------------------------------------------------------------------------- 1 | -- tap 2 | let b = clearBuf (localBufId 'α' 1 48000) -- sample-rate 3 | src = soundIn 0 -- use headphones 4 | put = bufWr b (phasor ar 0 1 0 (bufFrames kr b) 1) Loop src 5 | get = tap 1 ar b (mce2 0.1 0.9) 6 | in mrg2 get put 7 | -------------------------------------------------------------------------------- /Help/Ugen/thresh.help.hs: -------------------------------------------------------------------------------- 1 | -- thresh 2 | (lfNoise0Id 'α' ar 50 * 0.15) `thresh` 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/tiRand.help.hs: -------------------------------------------------------------------------------- 1 | -- tiRand 2 | let l = tiRandId 'α' (-1) 1 (dustId 'β' kr 10) 3 | in pan2 (pinkNoiseId 'γ' ar * 0.1) l 1 4 | 5 | -- tiRand ; monadic variant 6 | uid_st_eval 7 | (do l <- tiRandM (-1) 1 =<< dustM kr 10 8 | n <- pinkNoiseM ar 9 | return (pan2 (n * 0.1) l 1)) 10 | 11 | -- tiRand ; osc frequency 12 | uid_st_eval 13 | (do n <- tiRandM 4 12 =<< dustM kr 10 14 | let f = n * 150 + (mce [0,1]) 15 | return (sinOsc ar f 0 * 0.1)) 16 | -------------------------------------------------------------------------------- /Help/Ugen/timer.help.hs: -------------------------------------------------------------------------------- 1 | -- timer 2 | let t = impulse kr (mouseX kr 0.5 20 Exponential 0.1) 0 3 | in sinOsc ar (timer t * 500 + 500) 0 * 0.2 4 | -------------------------------------------------------------------------------- /Help/Ugen/toggleFF.help.hs: -------------------------------------------------------------------------------- 1 | -- toggleFF ; c.f. setResetFF 2 | let tr = dustId 'α' ar (xLine kr 1 1000 60 DoNothing) 3 | fr = toggleFF tr * 400 + 800 4 | in sinOsc ar fr 0 * 0.1 5 | -------------------------------------------------------------------------------- /Help/Ugen/trig.help.hs: -------------------------------------------------------------------------------- 1 | -- trig 2 | let d = dustId 'α' ar 1 3 | o = fSinOsc ar 800 0 * 0.5 4 | in o * trig d 0.2 5 | 6 | -- trig ; if duration is set to zero it is reset to one frame (at ar & kr) ; 3.11.2 7 | let env = decay2 (trig (mce2 (sinOsc kr 10 0 * 10) (sinOsc ar 9 0 * 1000)) 0) 0.01 0.2 8 | in sinOsc ar (mce2 440 441) 0 * env * 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/trig1.help.hs: -------------------------------------------------------------------------------- 1 | -- trig1 ; timed gate, duration in seconds 2 | let d = dustId 'α' ar 1 3 | o = fSinOsc ar 800 0 * 0.1 4 | in o * trig1 d 1.25 5 | 6 | -- trig1 7 | sinOsc ar 440 0 * trig1 (impulse kr 10 0) 0.1 * 0.1 8 | 9 | -- trig1 ; if duration is set to zero it is reset to one frame (at ar & kr) ; 3.11.2 10 | let env = decay2 (trig1 (mce2 (sinOsc kr 10 0) (sinOsc ar 9 0)) 0) 0.01 0.2 11 | in sinOsc ar (mce2 440 441) 0 * env * 0.1 12 | -------------------------------------------------------------------------------- /Help/Ugen/trigAvg.help.hs: -------------------------------------------------------------------------------- 1 | -- trigAvg 2 | let x = mouseX kr 0 1000 Linear 0.2 3 | b = mouseButton kr 0 1 0.2 4 | n = X.trigAvg kr (roundTo x 100) b 5 | in sinOsc ar n 0 * 0.1 6 | 7 | -- trigAvg 8 | let n = X.trigAvg kr (sinOsc ar 0.1 0) (impulse kr 0.2 0) 9 | in sinOsc ar 220 0 * n * 0.25 10 | -------------------------------------------------------------------------------- /Help/Ugen/trigControl.help.hs: -------------------------------------------------------------------------------- 1 | -- trigControl ; graph with the three types of non-audio controls ; trigger controls are drawn cyan 2 | let freq = control kr "freq" 440 3 | phase = control ir "phase" 0 4 | gate' = trigControl "gate" 1 5 | amp = control kr "amp" 0.1 6 | e = envGen kr gate' amp 0 1 DoNothing (envAsr 0.01 1 1 EnvLin) 7 | in sinOsc ar freq phase * e 8 | -------------------------------------------------------------------------------- /Help/Ugen/twChoose.help.hs: -------------------------------------------------------------------------------- 1 | -- tWChoose ; composite of tWindex and select 2 | let x = mouseX kr 1 1000 Exponential 0.1 3 | d = dustId 'α' ar x 4 | a = mce [sinOsc ar 220 0 5 | ,saw ar 440 6 | ,pulse ar 110 0.1] 7 | w = mce [0.5, 0.35, 0.15] 8 | o = tWChooseId 'β' d a w 0 9 | in o * 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/twoPole.help.hs: -------------------------------------------------------------------------------- 1 | -- twoPole 2 | let n = whiteNoiseId 'α' ar in twoPole (n * 0.005) 2000 0.95 3 | 4 | -- twoPole 5 | let n = whiteNoiseId 'α' ar 6 | f = xLine kr 800 8000 8 RemoveSynth 7 | in twoPole (n * 0.005) f 0.95 8 | -------------------------------------------------------------------------------- /Help/Ugen/twoZero.help.hs: -------------------------------------------------------------------------------- 1 | -- twoZero 2 | let n = whiteNoiseId 'α' ar * 0.1 3 | f = xLine kr 20 20000 8 RemoveSynth 4 | in twoZero (n * 0.125) f 1 5 | -------------------------------------------------------------------------------- /Help/Ugen/vDiskIn.help.hs: -------------------------------------------------------------------------------- 1 | -- vDiskIn 2 | let b = control kr "buf" 0 3 | nc = 2 4 | in vDiskIn nc 0 (sinOsc kr 0.25 0 * 0.25 + 1) Loop 0 5 | 6 | ---- ; allocate and read file, leave open 7 | let fn = sfResolve "pf-c5.aif" 8 | let nc = sfNumChannels fn 9 | withSc3 (mapM_ async [b_alloc 0 8192 nc,b_read 0 fn 0 (-1) 0 True]) 10 | 11 | -------------------------------------------------------------------------------- /Help/Ugen/varLag.help.hs: -------------------------------------------------------------------------------- 1 | -- varLag ; the varLag UGen is not working ; there is varLag_env instead 2 | let sqr = linLin (lfPulse kr 1 0 0.5) 0 1 100 400 3 | crv = varLag_env sqr 0.2 (EnvNum (line kr (-8) 8 15 RemoveSynth)) Nothing 4 | in sinOsc ar crv 0 * 0.3 5 | -------------------------------------------------------------------------------- /Help/Ugen/varShapeOsc.help.hs: -------------------------------------------------------------------------------- 1 | -- varShapeOsc 2 | let modulator = sinOsc kr (lfNoise2Id 'a' kr 4 * 10) 0 3 | freq = 100 4 | pw = sinOsc kr 0.01 0 `in_range` (0,1) 5 | waveshape = lag modulator 0.1 `in_range` (0,1) 6 | sync_ = 1 7 | syncfreq = 182 8 | sig = X.varShapeOsc ar freq pw waveshape sync_ syncfreq 9 | in pan2 sig modulator 0.1 10 | -------------------------------------------------------------------------------- /Help/Ugen/vbJonVerb.help.hs: -------------------------------------------------------------------------------- 1 | -- vbJonVerb ; default param 2 | X.vbJonVerb (dust ar 2) 0.7 0.3 0.8 0.5 0.5 3 | 4 | -- vbJonVerb 5 | let freq = mce (map (* 1000) [1,2.1,2.9]) 6 | src = mix (resonz (mixFill 3 (\_ -> dust ar 0.25)) freq 0.01) * 10 7 | in X.vbJonVerb src 0.8 0.3 0.8 0.1 0.5 + src 8 | 9 | -- vbJonVerb ; default param ; id 10 | X.vbJonVerb (dustId 'α' ar 2) 0.7 0.3 0.8 0.5 0.5 11 | 12 | -- vbJonVerb ; id 13 | let freq = mce (map (* 1000) [1,2.1,2.9]) 14 | src = mix (resonz (mixFill 3 (\z -> dustId (z::Int) ar 0.25)) freq 0.01) * 10 15 | in X.vbJonVerb src 0.8 0.3 0.8 0.1 0.5 + src 16 | -------------------------------------------------------------------------------- /Help/Ugen/vbSlide.help.hs: -------------------------------------------------------------------------------- 1 | -- vbSlide 2 | let src = lfNoise0Id 'α' ar 3 `in_range` (0,1) 3 | flt = X.vbSlide src 500 1500 4 | gen x = sinOsc ar (midiCps (x `in_range` (30,80))) 0 * 0.1 5 | in mce2 (gen flt) (gen src) 6 | 7 | ---- ; drawings 8 | import Sound.Sc3.Plot {- hsc3-plot -} 9 | plot_ugen_nrt (48000,64) 0.07 (let src = lfPulse ar 10 0 0.2 in mce2 src (X.vbSlide src 100 500)) 10 | 11 | -------------------------------------------------------------------------------- /Help/Ugen/wrap.help.hs: -------------------------------------------------------------------------------- 1 | -- wrap ; ln 2021-04-15 https://lukasnowok.github.io/spectrology/ 2 | let s = sinOsc ar (sinOsc ar (1 / 40) 0 * 100 + 20000) 0 3 | in wrap s (xLine ar (-1.0) (-0.01) 20 DoNothing) 1 * 0.1 4 | 5 | ---- ; drawings 6 | UI.ui_baudline 4096 50 "linear" 2 7 | -------------------------------------------------------------------------------- /Help/Ugen/wrap2.help.hs: -------------------------------------------------------------------------------- 1 | -- c.f. sc3_wrap_ni 2 | wrap2 (fSinOsc ar 1000 0) (line kr 0 1.01 8 DoNothing) * 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/wrapIndex.help.hs: -------------------------------------------------------------------------------- 1 | -- wrapIndex ; c.f. index 2 | let b = asLocalBufId 'α' [200,300,400,500,600,800] 3 | x = mouseX kr 0 18 Linear 0.1 4 | f = wrapIndex b x 5 | in sinOsc ar f 0 * 0.1 6 | -------------------------------------------------------------------------------- /Help/Ugen/wt_FilterScale.help.lhs: -------------------------------------------------------------------------------- 1 | > import Sound.Sc3 {- hsc3 -} 2 | > import Sound.Sc3.UGen.Bindings.HW.External.Wavelets {- hsc3 -} 3 | 4 | > g_01 = 5 | > let i = whiteNoiseId 'α' ar * 0.2 6 | > b = localBufId 'β' 2048 1 7 | > c = dwt b i 0.5 0 1 0 0 8 | > x = mouseX kr (-1) 1 Linear 0.1 9 | > c' = wt_FilterScale c x 10 | > in pan2 (idwt c' 0 0 0) x 1 11 | -------------------------------------------------------------------------------- /Help/Ugen/wt_TimeWipe.help.lhs: -------------------------------------------------------------------------------- 1 | > import Sound.Sc3 {- hsc3 -} 2 | > import Sound.Sc3.Ugen.Bindings.Hw.External.Wavelets {- hsc3 -} 3 | 4 | > g_01 = 5 | > let i = whiteNoiseId 'α' ar * 0.2 6 | > b = localBufId 'β' 2048 1 7 | > c = dwt b i 0.5 0 1 0 0 8 | > x = mouseX kr 0 1 Linear 0.1 9 | > c' = wt_TimeWipe c x 10 | > in pan2 (idwt c' 0 0 0) (x * 2 - 1) 1 11 | -------------------------------------------------------------------------------- /Help/Ugen/xFade2.help.hs: -------------------------------------------------------------------------------- 1 | -- xFade2 ; c.f. linXFade2 2 | xFade2 (saw ar 440) (sinOsc ar 440 0) (lfTri kr 0.1 0) 0.1 3 | -------------------------------------------------------------------------------- /Help/Ugen/xLine.help.hs: -------------------------------------------------------------------------------- 1 | -- xLine ; sc3 reorders mul and add inputs to precede the doneAction input 2 | let f = xLine kr 200 17000 10 RemoveSynth 3 | in sinOsc ar f 0 * 0.1 4 | -------------------------------------------------------------------------------- /Help/Ugen/xOut.help.hs: -------------------------------------------------------------------------------- 1 | -- xOut ; send signal to a bus, crossfading with existing contents 2 | let p a b = sinOsc ar (mce2 a b) 0 * 0.1 3 | x = mouseX kr 0 1 Linear 0.1 4 | y = mouseY kr 0 1 Linear 0.1 5 | in mrg [out 0 (p 220 221) 6 | ,xOut 0 x (p 330 331) 7 | ,xOut 0 y (p 440 441) 8 | ,out 0 (p 120 121)] 9 | -------------------------------------------------------------------------------- /Help/Ugen/zOsc.help.hs: -------------------------------------------------------------------------------- 1 | -- zOsc 2 | let modulator = sinOsc kr 0.1 0 3 | freq = lfNoise2Id 'α' kr 10 `in_exprange` (10,1000) 4 | formantfreq = lfNoise2Id 'β' kr 1 `in_exprange` (700,1500) 5 | shape = modulator 6 | mode = sinOsc kr 0.91 0 7 | sig = X.zOsc ar freq formantfreq shape mode 8 | in pan2 sig modulator 0.1 9 | -------------------------------------------------------------------------------- /Help/Ugen/zeroCrossing.help.hs: -------------------------------------------------------------------------------- 1 | -- zeroCrossing 2 | let a = sinOsc ar (sinOsc kr 1 0 * 600 + 700) 0 * 0.1 3 | in mce [a, impulse ar (zeroCrossing a) 0 * 0.25] 4 | 5 | -- zeroCrossing 6 | let a = soundIn 0 7 | in mce [a, sinOsc ar (zeroCrossing a) 0 * 0.1] 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo "hsc3" 3 | 4 | clean: 5 | rm -Rf dist dist-newstyle *~ 6 | 7 | push-all: 8 | r.gitlab-push.sh hsc3 9 | r.github-push.sh hsc3 10 | 11 | push-tags: 12 | r.gitlab-push.sh hsc3 --tags 13 | r.github-push.sh hsc3 --tags 14 | 15 | indent: 16 | fourmolu -i Sound 17 | 18 | doctest: 19 | doctest -Wno-x-partial -Wno-incomplete-uni-patterns Sound 20 | -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env runhaskell 2 | import Distribution.Simple 3 | main = defaultMain 4 | -------------------------------------------------------------------------------- /Sound/Sc3.hs: -------------------------------------------------------------------------------- 1 | {- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Monad", 2 | "Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings". 3 | -} 4 | module Sound.Sc3 (module M) where 5 | 6 | import Sound.Sc3.Common as M 7 | import Sound.Sc3.Server.Monad as M 8 | import Sound.Sc3.Ugen as M 9 | import Sound.Sc3.Ugen.Bindings as M 10 | -------------------------------------------------------------------------------- /Sound/Sc3/Common.hs: -------------------------------------------------------------------------------- 1 | -- | Composite of SC3.Common sub-modules. 2 | module Sound.Sc3.Common (module M) where 3 | 4 | import Sound.Sc3.Common.Buffer as M 5 | import Sound.Sc3.Common.Enum as M 6 | import Sound.Sc3.Common.Envelope as M 7 | import Sound.Sc3.Common.Help as M 8 | import Sound.Sc3.Common.Math as M 9 | import Sound.Sc3.Common.Math.Operator as M 10 | import Sound.Sc3.Common.Math.Warp as M 11 | import Sound.Sc3.Common.Mce as M 12 | import Sound.Sc3.Common.Monad as M 13 | import Sound.Sc3.Common.Rate as M 14 | import Sound.Sc3.Common.SoundFile as M 15 | import Sound.Sc3.Common.Uid as M 16 | -------------------------------------------------------------------------------- /Sound/Sc3/Fd.hs: -------------------------------------------------------------------------------- 1 | {- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Fd", 2 | "Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings". 3 | -} 4 | module Sound.Sc3.Fd (module M) where 5 | 6 | import Sound.Sc3.Common as M 7 | import Sound.Sc3.Server.Fd as M 8 | import Sound.Sc3.Ugen as M 9 | import Sound.Sc3.Ugen.Bindings as M 10 | -------------------------------------------------------------------------------- /Sound/Sc3/Server.hs: -------------------------------------------------------------------------------- 1 | {- | Collection of modules for communicating with the SuperCollider 2 | synthesis server, see also "Sound.Sc3.Server.FD" and 3 | "Sound.Sc3.Server.Monad". 4 | -} 5 | module Sound.Sc3.Server (module S) where 6 | 7 | import Sound.Sc3.Server.Command as S 8 | import Sound.Sc3.Server.Enum as S 9 | import Sound.Sc3.Server.Nrt as S 10 | import Sound.Sc3.Server.Nrt.Edit as S 11 | import Sound.Sc3.Server.Nrt.Render as S 12 | import Sound.Sc3.Server.Param as S 13 | import Sound.Sc3.Server.Recorder as S 14 | import Sound.Sc3.Server.Scsynth as S 15 | import Sound.Sc3.Server.Status as S 16 | import Sound.Sc3.Server.Synthdef as S 17 | -------------------------------------------------------------------------------- /Sound/Sc3/Server/Command.hs: -------------------------------------------------------------------------------- 1 | -- | Collection of standard /command/ modules. 2 | module Sound.Sc3.Server.Command (module S) where 3 | 4 | import Sound.Sc3.Server.Command.Completion as S 5 | import Sound.Sc3.Server.Command.Enum as S 6 | import Sound.Sc3.Server.Command.Plain as S 7 | -------------------------------------------------------------------------------- /Sound/Sc3/Server/Fd.hs: -------------------------------------------------------------------------------- 1 | -- | Composite of "Sound.Sc3.Server" and /Fd/ transport. 2 | module Sound.Sc3.Server.Fd (module M) where 3 | 4 | import Sound.Sc3.Server as M 5 | import Sound.Sc3.Server.Transport.Fd as M 6 | -------------------------------------------------------------------------------- /Sound/Sc3/Server/Monad.hs: -------------------------------------------------------------------------------- 1 | -- | Composite of "Sound.Sc3.Server" and 'Monad' transport. 2 | module Sound.Sc3.Server.Monad (module S) where 3 | 4 | import Sound.Sc3.Server as S 5 | import Sound.Sc3.Server.Transport.Monad as S 6 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Bindings.hs: -------------------------------------------------------------------------------- 1 | -- | SC3 Ugen bindings (composite module). 2 | module Sound.Sc3.Ugen.Bindings (module B) where 3 | 4 | import Sound.Sc3.Ugen.Bindings.Composite as B 5 | import Sound.Sc3.Ugen.Bindings.Db as B 6 | import Sound.Sc3.Ugen.Bindings.Hw as B 7 | 8 | -- import Sound.Sc3.Ugen.Bindings.Hw.External as B 9 | -- import Sound.Sc3.Ugen.Bindings.Monad as B 10 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Bindings/Hw/External.hs: -------------------------------------------------------------------------------- 1 | -- | Bindings to unit generators not distributed with SuperCollider proper. 2 | module Sound.Sc3.Ugen.Bindings.Hw.External (module U) where 3 | 4 | import Sound.Sc3.Ugen.Bindings.Hw.External.F0 as U 5 | import Sound.Sc3.Ugen.Bindings.Hw.External.Sc3_Plugins as U 6 | import Sound.Sc3.Ugen.Bindings.Hw.External.Zita as U 7 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Enum.hs: -------------------------------------------------------------------------------- 1 | -- | Data types for enumerated and non signal unit generator inputs. 2 | module Sound.Sc3.Ugen.Enum where 3 | 4 | import Sound.Sc3.Common.Enum {- hsc3 -} 5 | import Sound.Sc3.Common.Envelope {- hsc3 -} 6 | import Sound.Sc3.Ugen.Ugen {- hsc3 -} 7 | 8 | -- | Type specialised envelope curve. 9 | type EnvCurve = Envelope_Curve Ugen 10 | 11 | -- | Lift to Ugen. 12 | from_buffer :: Buffer Ugen -> Ugen 13 | from_buffer b = 14 | case b of 15 | Buffer_Id i -> constant i 16 | Buffer u -> u 17 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Label.hs: -------------------------------------------------------------------------------- 1 | -- | Label. 2 | module Sound.Sc3.Ugen.Label where 3 | 4 | newtype Label = Label {ugenLabel :: String} deriving (Ord, Eq, Read, Show) 5 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Mrg.hs: -------------------------------------------------------------------------------- 1 | -- | Multiple root graph (Mrg) 2 | module Sound.Sc3.Ugen.Mrg where 3 | 4 | data Mrg t = Mrg 5 | { mrgLeft :: t 6 | , mrgRight :: t 7 | } 8 | deriving (Ord, Eq, Read, Show) 9 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Proxy.hs: -------------------------------------------------------------------------------- 1 | -- | Proxy indicating an output port at a multi-channel Primitive. 2 | module Sound.Sc3.Ugen.Proxy where 3 | 4 | import Sound.Sc3.Common.Rate {- hsc3 -} 5 | 6 | import Sound.Sc3.Ugen.Primitive {- hsc3 -} 7 | 8 | data Proxy t = Proxy 9 | { proxySource :: Primitive t 10 | , proxyIndex :: Int 11 | } 12 | deriving (Ord, Eq, Read, Show) 13 | 14 | proxyRate :: Proxy t -> Rate 15 | proxyRate = ugenRate . proxySource 16 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/README: -------------------------------------------------------------------------------- 1 | There were previously modules Circuit and Netlist which implemented the data-reify model. 2 | These have been deleted, however they're in the vcs history if required. (2022-07-05) 3 | -------------------------------------------------------------------------------- /Sound/Sc3/Ugen/Types.hs: -------------------------------------------------------------------------------- 1 | -- | Composite module of all Ugen related types. 2 | module Sound.Sc3.Ugen.Types (module M) where 3 | 4 | import Sound.Sc3.Ugen.Brackets as M 5 | import Sound.Sc3.Ugen.Constant as M 6 | import Sound.Sc3.Ugen.Control as M 7 | import Sound.Sc3.Ugen.Label as M 8 | import Sound.Sc3.Ugen.Mrg as M 9 | import Sound.Sc3.Ugen.Primitive as M 10 | import Sound.Sc3.Ugen.Proxy as M 11 | import Sound.Sc3.Ugen.Ugen as M 12 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: hsc3.cabal 2 | 3 | source-repository-package 4 | type: git 5 | location: https://gitlab.com/rd--/hosc.git 6 | -------------------------------------------------------------------------------- /contrib/stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: lts-12.20 2 | packages: 3 | - . 4 | - location: 5 | git: https://github.com/rd--/hosc.git 6 | commit: master 7 | extra-dep: true 8 | -------------------------------------------------------------------------------- /emacs/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | emacs -batch -f batch-byte-compile *.el 3 | 4 | clean: 5 | rm -f *.elc 6 | -------------------------------------------------------------------------------- /ext/faust/Makefile: -------------------------------------------------------------------------------- 1 | FAUST_RAW = https://raw.githubusercontent.com/grame-cncm/faust/master-dev 2 | 3 | mk-get-dsp: 4 | wget $(FAUST_RAW)/examples/reverb/zitaRev.dsp 5 | 6 | mk-ugen: 7 | faust2supercollider -d zitaRev.dsp 8 | 9 | mk-install-ugen: 10 | cp zitaRev.so ~/opt/lib/SuperCollider/plugins 11 | 12 | clean: 13 | rm -fR faust.* 14 | rm -f zitaRev.sc zitaRev.so 15 | 16 | mk-dep: 17 | sudo apt-get install faust 18 | -------------------------------------------------------------------------------- /ext/faust/zitaRev.dsp: -------------------------------------------------------------------------------- 1 | declare name "zitaRev"; 2 | declare version "0.0"; 3 | declare author "JOS, Revised by RM"; 4 | declare description "Example GUI for `zita_rev1_stereo` (mostly following the Linux `zita-rev1` GUI)."; 5 | 6 | import("stdfaust.lib"); 7 | 8 | process = dm.zita_rev1; 9 | -------------------------------------------------------------------------------- /gen/lib-context.hs: -------------------------------------------------------------------------------- 1 | import Sound.SC3.Common.Context {- hsc3 -} 2 | 3 | main :: IO () 4 | main = do 5 | let dir = "/home/rohan/sw/hsc3/lib/" 6 | context_write (dir ++ "hsc3-min-imports.hs") min_context 7 | context_write (dir ++ "hsc3-std-imports.hs") std_context 8 | -------------------------------------------------------------------------------- /lib/hsc3-min-imports.hs: -------------------------------------------------------------------------------- 1 | import Prelude {- base -} 2 | import Control.Monad {- base -} 3 | import Data.Bits {- base -} 4 | import Data.Function {- base -} 5 | import Data.List {- base -} 6 | import Sound.Sc3 {- hsc3 -} 7 | -------------------------------------------------------------------------------- /lib/hsc3-std-extensions.hs: -------------------------------------------------------------------------------- 1 | {-# Language OverloadedLists #-} 2 | {-# Language FlexibleContexts #-} 3 | -------------------------------------------------------------------------------- /md/notes.md: -------------------------------------------------------------------------------- 1 | # Remainder 2 | 3 | - simplify so that a plain form can run in hugs 4 | + external process to translate from text description of scsyndef to hex encoded binary format 5 | + osc communication using a plain text format, external process (or proxy) to encode and forward messages 6 | -------------------------------------------------------------------------------- /md/video.md: -------------------------------------------------------------------------------- 1 | # Haskell SuperCollider 2 | 3 | Haskell SuperCollider ; 2021-03-10 ; Ugen graph to Html tree 4 | 5 | 7 | --------------------------------------------------------------------------------