diff --git a/doc-schelp/HelpSource/Classes/AbstractFunction.scrbl b/doc-schelp/HelpSource/Classes/AbstractFunction.scrbl index 966480b..efb3032 100644 --- a/doc-schelp/HelpSource/Classes/AbstractFunction.scrbl +++ b/doc-schelp/HelpSource/Classes/AbstractFunction.scrbl @@ -23,12 +23,11 @@ instance of class BinaryOpUGen which has the two operands as inputs. @racketblock[ { var a, b; a = LFSaw.ar(220); b = LFPulse.ar(1442); [a, b, a * b] }.plot; -:: +] For an overview of common operators, see link::Overviews/Operators::, for specific examples, see also e.g. link::Classes/Function::, link::Classes/UGen::, link::Classes/Pattern::. To see which classes implement a specific method, see that method in the generated link::Overviews/Methods:: overview. -] @section{instanceMethods} @@ -49,7 +48,6 @@ a = { 10.rand.postln }; b = a.neg; b.value; // Patterns, Streams, UGens, and Proxies are AbstractFunctions, too: a = Pgeom(1, 2, 5).neg; a.asStream.nextN(8); { a = LFNoise1.ar(1500); [a, a.neg] }.plot; -:: ] @section{method} reciprocal diff --git a/doc-schelp/HelpSource/Classes/classes.scrbl b/doc-schelp/HelpSource/Classes/classes.scrbl new file mode 100644 index 0000000..963b78e --- /dev/null +++ b/doc-schelp/HelpSource/Classes/classes.scrbl @@ -0,0 +1,859 @@ +#lang scribble/manual + +@title{Classes} + +@include-section["A2K.scrbl"] +@include-section["APF.scrbl"] +@include-section["AbstractDispatcher.scrbl"] +@include-section["AbstractFunction.scrbl"] +@include-section["AbstractIn.scrbl"] +@include-section["AbstractMessageMatcher.scrbl"] +@include-section["AbstractOut.scrbl"] +@include-section["AbstractResponderFunc.scrbl"] +@include-section["AbstractSystemAction.scrbl"] +@include-section["AbstractWrappingDispatcher.scrbl"] +@include-section["AllpassC.scrbl"] +@include-section["AllpassL.scrbl"] +@include-section["AllpassN.scrbl"] +@include-section["AmpComp.scrbl"] +@include-section["AmpCompA.scrbl"] +@include-section["Amplitude.scrbl"] +@include-section["AppClock.scrbl"] +@include-section["ApplicationStart.scrbl"] +@include-section["Archive.scrbl"] +@include-section["Array.scrbl"] +@include-section["Array2D.scrbl"] +@include-section["ArrayedCollection.scrbl"] +@include-section["Association.scrbl"] +@include-section["AudioIn.scrbl"] +@include-section["BAllPass.scrbl"] +@include-section["BBandPass.scrbl"] +@include-section["BBandStop.scrbl"] +@include-section["BEQSuite.scrbl"] +@include-section["BHiPass.scrbl"] +@include-section["BHiPass4.scrbl"] +@include-section["BHiShelf.scrbl"] +@include-section["BLowPass.scrbl"] +@include-section["BLowPass4.scrbl"] +@include-section["BLowShelf.scrbl"] +@include-section["BPF.scrbl"] +@include-section["BPZ2.scrbl"] +@include-section["BPeakEQ.scrbl"] +@include-section["BRF.scrbl"] +@include-section["BRZ2.scrbl"] +@include-section["Bag.scrbl"] +@include-section["Balance2.scrbl"] +@include-section["Ball.scrbl"] +@include-section["BasicOpUGen.scrbl"] +@include-section["BeatTrack.scrbl"] +@include-section["BeatTrack2.scrbl"] +@include-section["BendResponder.scrbl"] +@include-section["BiPanB2.scrbl"] +@include-section["BinaryOpFunction.scrbl"] +@include-section["BinaryOpStream.scrbl"] +@include-section["BinaryOpUGen.scrbl"] +@include-section["Blip.scrbl"] +@include-section["Boolean.scrbl"] +@include-section["BrownNoise.scrbl"] +@include-section["BufAllpassC.scrbl"] +@include-section["BufAllpassL.scrbl"] +@include-section["BufAllpassN.scrbl"] +@include-section["BufChannels.scrbl"] +@include-section["BufCombC.scrbl"] +@include-section["BufCombL.scrbl"] +@include-section["BufCombN.scrbl"] +@include-section["BufDelayC.scrbl"] +@include-section["BufDelayL.scrbl"] +@include-section["BufDelayN.scrbl"] +@include-section["BufDur.scrbl"] +@include-section["BufFrames.scrbl"] +@include-section["BufInfoUGenBase.scrbl"] +@include-section["BufRateScale.scrbl"] +@include-section["BufRd.scrbl"] +@include-section["BufSampleRate.scrbl"] +@include-section["BufSamples.scrbl"] +@include-section["BufWr.scrbl"] +@include-section["Buffer.scrbl"] +@include-section["Bus.scrbl"] +@include-section["BusPlug.scrbl"] +@include-section["Button.scrbl"] +@include-section["CCResponder.scrbl"] +@include-section["COsc.scrbl"] +@include-section["CSVFileReader.scrbl"] +@include-section["Changed.scrbl"] +@include-section["Char.scrbl"] +@include-section["CheckBadValues.scrbl"] +@include-section["CheckBox.scrbl"] +@include-section["Class.scrbl"] +@include-section["Clip.scrbl"] +@include-section["ClipNoise.scrbl"] +@include-section["Clock.scrbl"] +@include-section["CmdPeriod.scrbl"] +@include-section["CoinGate.scrbl"] +@include-section["Collection.scrbl"] +@include-section["Color.scrbl"] +@include-section["CombC.scrbl"] +@include-section["CombL.scrbl"] +@include-section["CombN.scrbl"] +@include-section["Compander.scrbl"] +@include-section["CompanderD.scrbl"] +@include-section["Complex.scrbl"] +@include-section["CompositeView.scrbl"] +@include-section["Condition.scrbl"] +@include-section["ContiguousBlockAllocator.scrbl"] +@include-section["Control.scrbl"] +@include-section["ControlDur.scrbl"] +@include-section["ControlName.scrbl"] +@include-section["ControlRate.scrbl"] +@include-section["ControlSpec.scrbl"] +@include-section["Convolution.scrbl"] +@include-section["Convolution2.scrbl"] +@include-section["Convolution2L.scrbl"] +@include-section["Convolution3.scrbl"] +@include-section["Crackle.scrbl"] +@include-section["CuspL.scrbl"] +@include-section["CuspN.scrbl"] +@include-section["DC.scrbl"] +@include-section["Date.scrbl"] +@include-section["Dbrown.scrbl"] +@include-section["Dbufrd.scrbl"] +@include-section["Dbufwr.scrbl"] +@include-section["Dconst.scrbl"] +@include-section["DebugNodeWatcher.scrbl"] +@include-section["Decay.scrbl"] +@include-section["Decay2.scrbl"] +@include-section["DecodeB2.scrbl"] +@include-section["DegreeToKey.scrbl"] +@include-section["DelTapRd.scrbl"] +@include-section["DelTapWr.scrbl"] +@include-section["Delay1.scrbl"] +@include-section["Delay2.scrbl"] +@include-section["DelayC.scrbl"] +@include-section["DelayL.scrbl"] +@include-section["DelayN.scrbl"] +@include-section["Demand.scrbl"] +@include-section["DemandEnvGen.scrbl"] +@include-section["DetectIndex.scrbl"] +@include-section["DetectSilence.scrbl"] +@include-section["Dgeom.scrbl"] +@include-section["Dialog.scrbl"] +@include-section["Dibrown.scrbl"] +@include-section["Dictionary.scrbl"] +@include-section["DiskIn.scrbl"] +@include-section["DiskOut.scrbl"] +@include-section["Diwhite.scrbl"] +@include-section["Done.scrbl"] +@include-section["DoubleArray.scrbl"] +@include-section["Download.scrbl"] +@include-section["Dpoll.scrbl"] +@include-section["DragBoth.scrbl"] +@include-section["DragSink.scrbl"] +@include-section["DragSource.scrbl"] +@include-section["Drand.scrbl"] +@include-section["DrawGrid.scrbl"] +@include-section["Dreset.scrbl"] +@include-section["Dseq.scrbl"] +@include-section["Dser.scrbl"] +@include-section["Dseries.scrbl"] +@include-section["Dshuf.scrbl"] +@include-section["Dstutter.scrbl"] +@include-section["Dswitch.scrbl"] +@include-section["Dswitch1.scrbl"] +@include-section["Dunique.scrbl"] +@include-section["Dust.scrbl"] +@include-section["Dust2.scrbl"] +@include-section["Duty.scrbl"] +@include-section["Dwhite.scrbl"] +@include-section["Dwrand.scrbl"] +@include-section["Dxrand.scrbl"] +@include-section["DynKlang.scrbl"] +@include-section["DynKlank.scrbl"] +@include-section["EZGui.scrbl"] +@include-section["EZKnob.scrbl"] +@include-section["EZListView.scrbl"] +@include-section["EZLists.scrbl"] +@include-section["EZNumber.scrbl"] +@include-section["EZPopUpMenu.scrbl"] +@include-section["EZRanger.scrbl"] +@include-section["EZScroller.scrbl"] +@include-section["EZSlider.scrbl"] +@include-section["EZText.scrbl"] +@include-section["Env.scrbl"] +@include-section["EnvGate.scrbl"] +@include-section["EnvGen.scrbl"] +@include-section["EnvelopeView.scrbl"] +@include-section["EnvirGui.scrbl"] +@include-section["Environment.scrbl"] +@include-section["EnvironmentRedirect.scrbl"] +@include-section["Error.scrbl"] +@include-section["Event.scrbl"] +@include-section["EventPatternProxy.scrbl"] +@include-section["EventStreamCleanup.scrbl"] +@include-section["EventStreamPlayer.scrbl"] +@include-section["Exception.scrbl"] +@include-section["ExpRand.scrbl"] +@include-section["FBSineC.scrbl"] +@include-section["FBSineL.scrbl"] +@include-section["FBSineN.scrbl"] +@include-section["FFT.scrbl"] +@include-section["FFTTrigger.scrbl"] +@include-section["FOS.scrbl"] +@include-section["FSinOsc.scrbl"] +@include-section["False.scrbl"] +@include-section["Fdef.scrbl"] +@include-section["File.scrbl"] +@include-section["FileDialog.scrbl"] +@include-section["FileReader.scrbl"] +@include-section["Filter.scrbl"] +@include-section["FilterPattern.scrbl"] +@include-section["Float.scrbl"] +@include-section["FloatArray.scrbl"] +@include-section["FlowLayout.scrbl"] +@include-section["FlowVar.scrbl"] +@include-section["FlowView.scrbl"] +@include-section["Fold.scrbl"] +@include-section["Font.scrbl"] +@include-section["Formant.scrbl"] +@include-section["Formlet.scrbl"] +@include-section["Frame.scrbl"] +@include-section["Free.scrbl"] +@include-section["FreeSelf.scrbl"] +@include-section["FreeSelfWhenDone.scrbl"] +@include-section["FreeVerb.scrbl"] +@include-section["FreeVerb2.scrbl"] +@include-section["FreqScope.scrbl"] +@include-section["FreqScopeView.scrbl"] +@include-section["FreqShift.scrbl"] +@include-section["FuncFilterPattern.scrbl"] +@include-section["Function.scrbl"] +@include-section["FunctionDef.scrbl"] +@include-section["FunctionList.scrbl"] +@include-section["GVerb.scrbl"] +@include-section["Gate.scrbl"] +@include-section["GbmanL.scrbl"] +@include-section["GbmanN.scrbl"] +@include-section["Gendy1.scrbl"] +@include-section["Gendy2.scrbl"] +@include-section["Gendy3.scrbl"] +@include-section["Git.scrbl"] +@include-section["Gradient.scrbl"] +@include-section["GrainBuf.scrbl"] +@include-section["GrainFM.scrbl"] +@include-section["GrainIn.scrbl"] +@include-section["GrainSin.scrbl"] +@include-section["GrayNoise.scrbl"] +@include-section["GridLayout.scrbl"] +@include-section["GridLines.scrbl"] +@include-section["Group.scrbl"] +@include-section["HID.scrbl"] +@include-section["HIDCollection.scrbl"] +@include-section["HIDElement.scrbl"] +@include-section["HIDElementProto.scrbl"] +@include-section["HIDFunc.scrbl"] +@include-section["HIDInfo.scrbl"] +@include-section["HIDProto.scrbl"] +@include-section["HIDUsage.scrbl"] +@include-section["HIDdef.scrbl"] +@include-section["HLayout.scrbl"] +@include-section["HLayoutView.scrbl"] +@include-section["HPF.scrbl"] +@include-section["HPZ1.scrbl"] +@include-section["HPZ2.scrbl"] +@include-section["Harmonics.scrbl"] +@include-section["Hasher.scrbl"] +@include-section["HelpBrowser.scrbl"] +@include-section["HenonC.scrbl"] +@include-section["HenonL.scrbl"] +@include-section["HenonN.scrbl"] +@include-section["Hilbert.scrbl"] +@include-section["HilbertFIR.scrbl"] +@include-section["HiliteGradient.scrbl"] +@include-section["History.scrbl"] +@include-section["HistoryGui.scrbl"] +@include-section["IEnvGen.scrbl"] +@include-section["IFFT.scrbl"] +@include-section["IODesc.scrbl"] +@include-section["IRand.scrbl"] +@include-section["IdentityBag.scrbl"] +@include-section["IdentityDictionary.scrbl"] +@include-section["IdentitySet.scrbl"] +@include-section["Image.scrbl"] +@include-section["Impulse.scrbl"] +@include-section["In.scrbl"] +@include-section["InBus.scrbl"] +@include-section["InFeedback.scrbl"] +@include-section["InRange.scrbl"] +@include-section["InRect.scrbl"] +@include-section["InTrig.scrbl"] +@include-section["Index.scrbl"] +@include-section["IndexInBetween.scrbl"] +@include-section["IndexL.scrbl"] +@include-section["InfoUGenBase.scrbl"] +@include-section["Int16Array.scrbl"] +@include-section["Int32Array.scrbl"] +@include-section["Int8Array.scrbl"] +@include-section["Integrator.scrbl"] +@include-section["InterplEnv.scrbl"] +@include-section["InterplPairs.scrbl"] +@include-section["InterplXYC.scrbl"] +@include-section["Interpreter.scrbl"] +@include-section["Interval.scrbl"] +@include-section["JITGui.scrbl"] +@include-section["K2A.scrbl"] +@include-section["KeyState.scrbl"] +@include-section["KeyTrack.scrbl"] +@include-section["Klang.scrbl"] +@include-section["Knob.scrbl"] +@include-section["LFClipNoise.scrbl"] +@include-section["LFCub.scrbl"] +@include-section["LFDClipNoise.scrbl"] +@include-section["LFDNoise0.scrbl"] +@include-section["LFDNoise1.scrbl"] +@include-section["LFDNoise3.scrbl"] +@include-section["LFGauss.scrbl"] +@include-section["LFNoise0.scrbl"] +@include-section["LFNoise1.scrbl"] +@include-section["LFNoise2.scrbl"] +@include-section["LFPar.scrbl"] +@include-section["LFPulse.scrbl"] +@include-section["LFSaw.scrbl"] +@include-section["LFTri.scrbl"] +@include-section["LID.scrbl"] +@include-section["LIDGui.scrbl"] +@include-section["LIDInfo.scrbl"] +@include-section["LIDSlot.scrbl"] +@include-section["LPF.scrbl"] +@include-section["LPZ1.scrbl"] +@include-section["LPZ2.scrbl"] +@include-section["Lag.scrbl"] +@include-section["Lag2.scrbl"] +@include-section["Lag2UD.scrbl"] +@include-section["Lag3.scrbl"] +@include-section["Lag3UD.scrbl"] +@include-section["LagControl.scrbl"] +@include-section["LagIn.scrbl"] +@include-section["LagUD.scrbl"] +@include-section["LanguageConfig.scrbl"] +@include-section["LastValue.scrbl"] +@include-section["Latch.scrbl"] +@include-section["LatoocarfianC.scrbl"] +@include-section["LatoocarfianL.scrbl"] +@include-section["LatoocarfianN.scrbl"] +@include-section["Layout.scrbl"] +@include-section["LazyEnvir.scrbl"] +@include-section["LeakDC.scrbl"] +@include-section["LeastChange.scrbl"] +@include-section["LevelIndicator.scrbl"] +@include-section["Library.scrbl"] +@include-section["LibraryBase.scrbl"] +@include-section["Limiter.scrbl"] +@include-section["LinCongC.scrbl"] +@include-section["LinCongL.scrbl"] +@include-section["LinCongN.scrbl"] +@include-section["LinExp.scrbl"] +@include-section["LinLin.scrbl"] +@include-section["LinPan2.scrbl"] +@include-section["LinRand.scrbl"] +@include-section["LinSelectX.scrbl"] +@include-section["LinXFade2.scrbl"] +@include-section["Line.scrbl"] +@include-section["LineLayout.scrbl"] +@include-section["Linen.scrbl"] +@include-section["LinkedList.scrbl"] +@include-section["LinkedListNode.scrbl"] +@include-section["List.scrbl"] +@include-section["ListPattern.scrbl"] +@include-section["ListView.scrbl"] +@include-section["LocalBuf.scrbl"] +@include-section["LocalIn.scrbl"] +@include-section["LocalOut.scrbl"] +@include-section["Logistic.scrbl"] +@include-section["LorenzL.scrbl"] +@include-section["Loudness.scrbl"] +@include-section["MFCC.scrbl"] +@include-section["MIDIClient.scrbl"] +@include-section["MIDIFunc.scrbl"] +@include-section["MIDIFuncBothCAMessageMatcher.scrbl"] +@include-section["MIDIFuncBothMessageMatcher.scrbl"] +@include-section["MIDIFuncChanArrayMessageMatcher.scrbl"] +@include-section["MIDIFuncChanMessageMatcher.scrbl"] +@include-section["MIDIFuncSrcMessageMatcher.scrbl"] +@include-section["MIDIFuncSrcMessageMatcherNV.scrbl"] +@include-section["MIDIIn.scrbl"] +@include-section["MIDIMessageDispatcher.scrbl"] +@include-section["MIDIMessageDispatcherNV.scrbl"] +@include-section["MIDIOut.scrbl"] +@include-section["MIDIResponder.scrbl"] +@include-section["MIDIdef.scrbl"] +@include-section["Magnitude.scrbl"] +@include-section["Main.scrbl"] +@include-section["MantissaMask.scrbl"] +@include-section["MaxLocalBufs.scrbl"] +@include-section["Maybe.scrbl"] +@include-section["Median.scrbl"] +@include-section["Message.scrbl"] +@include-section["MidEQ.scrbl"] +@include-section["Mix.scrbl"] +@include-section["ModDif.scrbl"] +@include-section["Monitor.scrbl"] +@include-section["MonitorGui.scrbl"] +@include-section["MoogFF.scrbl"] +@include-section["MostChange.scrbl"] +@include-section["MouseButton.scrbl"] +@include-section["MouseX.scrbl"] +@include-section["MouseY.scrbl"] +@include-section["MulAdd.scrbl"] +@include-section["MultiLevelIdentityDictionary.scrbl"] +@include-section["MultiOutUGen.scrbl"] +@include-section["MultiSliderView.scrbl"] +@include-section["MultiTap.scrbl"] +@include-section["NAryOpFunction.scrbl"] +@include-section["NAryOpStream.scrbl"] +@include-section["NRand.scrbl"] +@include-section["NamedControl.scrbl"] +@include-section["Ndef.scrbl"] +@include-section["NdefGui.scrbl"] +@include-section["NdefMixer.scrbl"] +@include-section["NdefMixerOld.scrbl"] +@include-section["NdefParamGui.scrbl"] +@include-section["NetAddr.scrbl"] +@include-section["Nil.scrbl"] +@include-section["NodeControl.scrbl"] +@include-section["NodeMap.scrbl"] +@include-section["NodeProxy.scrbl"] +@include-section["NodeProxyEditor.scrbl"] +@include-section["NodeWatcher.scrbl"] +@include-section["Normalizer.scrbl"] +@include-section["NoteOffResponder.scrbl"] +@include-section["NoteOnResponder.scrbl"] +@include-section["NotificationCenter.scrbl"] +@include-section["NumAudioBuses.scrbl"] +@include-section["NumBuffers.scrbl"] +@include-section["NumChannels.scrbl"] +@include-section["NumControlBuses.scrbl"] +@include-section["NumInputBuses.scrbl"] +@include-section["NumOutputBuses.scrbl"] +@include-section["NumRunningSynths.scrbl"] +@include-section["Number.scrbl"] +@include-section["NumberBox.scrbl"] +@include-section["OSCArgsMatcher.scrbl"] +@include-section["OSCBundle.scrbl"] +@include-section["OSCFunc.scrbl"] +@include-section["OSCFuncAddrMessageMatcher.scrbl"] +@include-section["OSCFuncBothMessageMatcher.scrbl"] +@include-section["OSCFuncRecvPortMessageMatcher.scrbl"] +@include-section["OSCMessageDispatcher.scrbl"] +@include-section["OSCMessagePatternDispatcher.scrbl"] +@include-section["OSCdef.scrbl"] +@include-section["OSCpathResponder.scrbl"] +@include-section["OSCresponder.scrbl"] +@include-section["OSCresponderNode.scrbl"] +@include-section["Object.scrbl"] +@include-section["ObjectGui.scrbl"] +@include-section["ObjectTable.scrbl"] +@include-section["OffsetOut.scrbl"] +@include-section["OnError.scrbl"] +@include-section["OnePole.scrbl"] +@include-section["OneZero.scrbl"] +@include-section["Onsets.scrbl"] +@include-section["Order.scrbl"] +@include-section["OrderedIdentitySet.scrbl"] +@include-section["Osc.scrbl"] +@include-section["OscN.scrbl"] +@include-section["Out.scrbl"] +@include-section["OutputProxy.scrbl"] +@include-section["PMOsc.scrbl"] +@include-section["PSinGrain.scrbl"] +@include-section["PV_Add.scrbl"] +@include-section["PV_BinScramble.scrbl"] +@include-section["PV_BinShift.scrbl"] +@include-section["PV_BinWipe.scrbl"] +@include-section["PV_BrickWall.scrbl"] +@include-section["PV_ChainUGen.scrbl"] +@include-section["PV_ConformalMap.scrbl"] +@include-section["PV_Conj.scrbl"] +@include-section["PV_Copy.scrbl"] +@include-section["PV_CopyPhase.scrbl"] +@include-section["PV_Diffuser.scrbl"] +@include-section["PV_Div.scrbl"] +@include-section["PV_HainsworthFoote.scrbl"] +@include-section["PV_JensenAndersen.scrbl"] +@include-section["PV_LocalMax.scrbl"] +@include-section["PV_MagAbove.scrbl"] +@include-section["PV_MagBelow.scrbl"] +@include-section["PV_MagClip.scrbl"] +@include-section["PV_MagDiv.scrbl"] +@include-section["PV_MagFreeze.scrbl"] +@include-section["PV_MagMul.scrbl"] +@include-section["PV_MagNoise.scrbl"] +@include-section["PV_MagShift.scrbl"] +@include-section["PV_MagSmear.scrbl"] +@include-section["PV_MagSquared.scrbl"] +@include-section["PV_Max.scrbl"] +@include-section["PV_Min.scrbl"] +@include-section["PV_Mul.scrbl"] +@include-section["PV_PhaseShift.scrbl"] +@include-section["PV_PhaseShift270.scrbl"] +@include-section["PV_PhaseShift90.scrbl"] +@include-section["PV_RandComb.scrbl"] +@include-section["PV_RandWipe.scrbl"] +@include-section["PV_RectComb.scrbl"] +@include-section["PV_RectComb2.scrbl"] +@include-section["PackFFT.scrbl"] +@include-section["Padd.scrbl"] +@include-section["Paddp.scrbl"] +@include-section["Paddpre.scrbl"] +@include-section["PageLayout.scrbl"] +@include-section["Pair.scrbl"] +@include-section["Pan2.scrbl"] +@include-section["Pan4.scrbl"] +@include-section["PanAz.scrbl"] +@include-section["PanB.scrbl"] +@include-section["PanB2.scrbl"] +@include-section["ParGroup.scrbl"] +@include-section["ParamView.scrbl"] +@include-section["PartConv.scrbl"] +@include-section["PathName.scrbl"] +@include-section["Pattern.scrbl"] +@include-section["PatternConductor.scrbl"] +@include-section["PatternProxy.scrbl"] +@include-section["Pause.scrbl"] +@include-section["PauseSelf.scrbl"] +@include-section["PauseSelfWhenDone.scrbl"] +@include-section["Pavaroh.scrbl"] +@include-section["Pbeta.scrbl"] +@include-section["Pbind.scrbl"] +@include-section["PbindProxy.scrbl"] +@include-section["Pbindef.scrbl"] +@include-section["Pbindf.scrbl"] +@include-section["Pbinop.scrbl"] +@include-section["Pbrown.scrbl"] +@include-section["Pbus.scrbl"] +@include-section["Pcauchy.scrbl"] +@include-section["Pchain.scrbl"] +@include-section["Pclutch.scrbl"] +@include-section["Pcollect.scrbl"] +@include-section["Pconst.scrbl"] +@include-section["Pdef.scrbl"] +@include-section["PdefAllGui.scrbl"] +@include-section["PdefEditor.scrbl"] +@include-section["PdefGui.scrbl"] +@include-section["Pdefn.scrbl"] +@include-section["PdefnAllGui.scrbl"] +@include-section["PdefnGui.scrbl"] +@include-section["PdegreeToKey.scrbl"] +@include-section["Pdfsm.scrbl"] +@include-section["Pdict.scrbl"] +@include-section["PdurStutter.scrbl"] +@include-section["Peak.scrbl"] +@include-section["PeakFollower.scrbl"] +@include-section["Pen.scrbl"] +@include-section["Penvir.scrbl"] +@include-section["Pevent.scrbl"] +@include-section["Pexprand.scrbl"] +@include-section["Pfin.scrbl"] +@include-section["Pfindur.scrbl"] +@include-section["Pfinval.scrbl"] +@include-section["Pfset.scrbl"] +@include-section["Pfsm.scrbl"] +@include-section["Pfunc.scrbl"] +@include-section["Pfuncn.scrbl"] +@include-section["Pfx.scrbl"] +@include-section["Pfxb.scrbl"] +@include-section["Pgate.scrbl"] +@include-section["Pgauss.scrbl"] +@include-section["Pgbrown.scrbl"] +@include-section["Pgeom.scrbl"] +@include-section["Pgpar.scrbl"] +@include-section["Pgroup.scrbl"] +@include-section["Phasor.scrbl"] +@include-section["Phprand.scrbl"] +@include-section["Pif.scrbl"] +@include-section["Pindex.scrbl"] +@include-section["PingPong.scrbl"] +@include-section["PinkNoise.scrbl"] +@include-section["Pipe.scrbl"] +@include-section["Pitch.scrbl"] +@include-section["PitchShift.scrbl"] +@include-section["Pkey.scrbl"] +@include-section["Place.scrbl"] +@include-section["Plambda.scrbl"] +@include-section["Platform.scrbl"] +@include-section["PlayBuf.scrbl"] +@include-section["Plazy.scrbl"] +@include-section["PlazyEnvir.scrbl"] +@include-section["PlazyEnvirN.scrbl"] +@include-section["Plotter.scrbl"] +@include-section["Plprand.scrbl"] +@include-section["Pluck.scrbl"] +@include-section["Pmeanrand.scrbl"] +@include-section["Pmono.scrbl"] +@include-section["PmonoArtic.scrbl"] +@include-section["Pmul.scrbl"] +@include-section["Pmulp.scrbl"] +@include-section["Pmulpre.scrbl"] +@include-section["Pn.scrbl"] +@include-section["Pnaryop.scrbl"] +@include-section["Pnsym.scrbl"] +@include-section["Point.scrbl"] +@include-section["Polar.scrbl"] +@include-section["Poll.scrbl"] +@include-section["PopUpMenu.scrbl"] +@include-section["Post.scrbl"] +@include-section["Ppar.scrbl"] +@include-section["PparGroup.scrbl"] +@include-section["Ppatlace.scrbl"] +@include-section["Ppatmod.scrbl"] +@include-section["Ppoisson.scrbl"] +@include-section["Pprob.scrbl"] +@include-section["Pprotect.scrbl"] +@include-section["Pproto.scrbl"] +@include-section["Prand.scrbl"] +@include-section["Preject.scrbl"] +@include-section["Prewrite.scrbl"] +@include-section["PriorityQueue.scrbl"] +@include-section["Process.scrbl"] +@include-section["ProgramChangeResponder.scrbl"] +@include-section["Prorate.scrbl"] +@include-section["Prout.scrbl"] +@include-section["ProxyMixer.scrbl"] +@include-section["ProxyMixerOld.scrbl"] +@include-section["ProxyMonitorGui.scrbl"] +@include-section["ProxyNodeMap.scrbl"] +@include-section["ProxySpace.scrbl"] +@include-section["ProxySynthDef.scrbl"] +@include-section["Pseed.scrbl"] +@include-section["Pseg.scrbl"] +@include-section["Pselect.scrbl"] +@include-section["Pseq.scrbl"] +@include-section["Pser.scrbl"] +@include-section["Pseries.scrbl"] +@include-section["Pset.scrbl"] +@include-section["Psetp.scrbl"] +@include-section["Psetpre.scrbl"] +@include-section["Pshuf.scrbl"] +@include-section["Pslide.scrbl"] +@include-section["Pspawn.scrbl"] +@include-section["Pspawner.scrbl"] +@include-section["Pstep.scrbl"] +@include-section["PstepNadd.scrbl"] +@include-section["PstepNfunc.scrbl"] +@include-section["Pstutter.scrbl"] +@include-section["Pswitch.scrbl"] +@include-section["Pswitch1.scrbl"] +@include-section["Psym.scrbl"] +@include-section["Psync.scrbl"] +@include-section["Ptime.scrbl"] +@include-section["Ptpar.scrbl"] +@include-section["Ptuple.scrbl"] +@include-section["Pulse.scrbl"] +@include-section["PulseCount.scrbl"] +@include-section["PulseDivider.scrbl"] +@include-section["Punop.scrbl"] +@include-section["PureUGen.scrbl"] +@include-section["Pwalk.scrbl"] +@include-section["Pwhile.scrbl"] +@include-section["Pwhite.scrbl"] +@include-section["Pwrand.scrbl"] +@include-section["Pwrap.scrbl"] +@include-section["Pxrand.scrbl"] +@include-section["QPalette.scrbl"] +@include-section["QPenPrinter.scrbl"] +@include-section["QuadC.scrbl"] +@include-section["QuadL.scrbl"] +@include-section["QuadN.scrbl"] +@include-section["Quant.scrbl"] +@include-section["Quark.scrbl"] +@include-section["Quarks.scrbl"] +@include-section["QuartzComposerView.scrbl"] +@include-section["RHPF.scrbl"] +@include-section["RLPF.scrbl"] +@include-section["RadiansPerSample.scrbl"] +@include-section["Ramp.scrbl"] +@include-section["Rand.scrbl"] +@include-section["RandID.scrbl"] +@include-section["RandSeed.scrbl"] +@include-section["RangeSlider.scrbl"] +@include-section["RawArray.scrbl"] +@include-section["RawPointer.scrbl"] +@include-section["RecNodeProxy.scrbl"] +@include-section["RecordBuf.scrbl"] +@include-section["Recorder.scrbl"] +@include-section["Rect.scrbl"] +@include-section["Ref.scrbl"] +@include-section["RefCopy.scrbl"] +@include-section["ReplaceOut.scrbl"] +@include-section["Resonz.scrbl"] +@include-section["Rest.scrbl"] +@include-section["Ringz.scrbl"] +@include-section["RootNode.scrbl"] +@include-section["Rotate2.scrbl"] +@include-section["Routine.scrbl"] +@include-section["RunningMax.scrbl"] +@include-section["RunningMin.scrbl"] +@include-section["RunningSum.scrbl"] +@include-section["SCContainerView.scrbl"] +@include-section["SCDocHTMLRenderer.scrbl"] +@include-section["SCDocNode.scrbl"] +@include-section["SCDragView.scrbl"] +@include-section["SCEnvelopeEdit.scrbl"] +@include-section["SCImage.scrbl"] +@include-section["SCImageKernel.scrbl"] +@include-section["SCViewHolder.scrbl"] +@include-section["SOS.scrbl"] +@include-section["SampleDur.scrbl"] +@include-section["SampleRate.scrbl"] +@include-section["Sanitize.scrbl"] +@include-section["Saw.scrbl"] +@include-section["ScIDE.scrbl"] +@include-section["Scale.scrbl"] +@include-section["Scheduler.scrbl"] +@include-section["Schmidt.scrbl"] +@include-section["ScopeOut.scrbl"] +@include-section["ScopeView.scrbl"] +@include-section["Score.scrbl"] +@include-section["ScrollView.scrbl"] +@include-section["Select.scrbl"] +@include-section["SelectX.scrbl"] +@include-section["SelectXFocus.scrbl"] +@include-section["Semaphore.scrbl"] +@include-section["SemiColonFileReader.scrbl"] +@include-section["SendPeakRMS.scrbl"] +@include-section["SendReply.scrbl"] +@include-section["SendTrig.scrbl"] +@include-section["SerialPort.scrbl"] +@include-section["Server.scrbl"] +@include-section["ServerBoot.scrbl"] +@include-section["ServerMeter.scrbl"] +@include-section["ServerMeterView.scrbl"] +@include-section["ServerOptions.scrbl"] +@include-section["ServerQuit.scrbl"] +@include-section["ServerTree.scrbl"] +@include-section["Set.scrbl"] +@include-section["SetResetFF.scrbl"] +@include-section["Shaper.scrbl"] +@include-section["SharedIn.scrbl"] +@include-section["SharedOut.scrbl"] +@include-section["ShutDown.scrbl"] +@include-section["Signal.scrbl"] +@include-section["Silent.scrbl"] +@include-section["SimpleController.scrbl"] +@include-section["SimpleNumber.scrbl"] +@include-section["SinOsc.scrbl"] +@include-section["SinOscFB.scrbl"] +@include-section["SkipJack.scrbl"] +@include-section["Slew.scrbl"] +@include-section["Slider.scrbl"] +@include-section["Slider2D.scrbl"] +@include-section["Slope.scrbl"] +@include-section["SortedList.scrbl"] +@include-section["SoundFile.scrbl"] +@include-section["SoundFileView.scrbl"] +@include-section["SoundIn.scrbl"] +@include-section["SparseArray.scrbl"] +@include-section["SpecCentroid.scrbl"] +@include-section["SpecFlatness.scrbl"] +@include-section["SpecPcile.scrbl"] +@include-section["Speech.scrbl"] +@include-section["Splay.scrbl"] +@include-section["SplayAz.scrbl"] +@include-section["SplayZ.scrbl"] +@include-section["Spring.scrbl"] +@include-section["StackLayout.scrbl"] +@include-section["StandardL.scrbl"] +@include-section["StandardN.scrbl"] +@include-section["StaticText.scrbl"] +@include-section["Stepper.scrbl"] +@include-section["StereoConvolution2L.scrbl"] +@include-section["Stethoscope.scrbl"] +@include-section["Stream.scrbl"] +@include-section["StreamClutch.scrbl"] +@include-section["String.ext.scrbl"] +@include-section["String.scrbl"] +@include-section["SubsampleOffset.scrbl"] +@include-section["Sum3.scrbl"] +@include-section["Sum4.scrbl"] +@include-section["Sweep.scrbl"] +@include-section["Symbol.scrbl"] +@include-section["SymbolArray.scrbl"] +@include-section["SyncSaw.scrbl"] +@include-section["Synth.scrbl"] +@include-section["SynthDef.scrbl"] +@include-section["SynthDesc.scrbl"] +@include-section["SynthDescLib.scrbl"] +@include-section["SystemClock.scrbl"] +@include-section["T2A.scrbl"] +@include-section["T2K.scrbl"] +@include-section["TBall.scrbl"] +@include-section["TChoose.scrbl"] +@include-section["TDelay.scrbl"] +@include-section["TDuty.scrbl"] +@include-section["TDuty_old.scrbl"] +@include-section["TExpRand.scrbl"] +@include-section["TGrains.scrbl"] +@include-section["TIRand.scrbl"] +@include-section["TRand.scrbl"] +@include-section["TWChoose.scrbl"] +@include-section["TWindex.scrbl"] +@include-section["TabFileReader.scrbl"] +@include-section["Tap.scrbl"] +@include-section["Task.scrbl"] +@include-section["TaskProxy.scrbl"] +@include-section["TaskProxyGui.scrbl"] +@include-section["Tdef.scrbl"] +@include-section["TdefAllGui.scrbl"] +@include-section["TdefEditor.scrbl"] +@include-section["TdefGui.scrbl"] +@include-section["TempoBusClock.scrbl"] +@include-section["TempoClock.scrbl"] +@include-section["TextField.scrbl"] +@include-section["TextView.scrbl"] +@include-section["Thread.scrbl"] +@include-section["Thunk.scrbl"] +@include-section["Timer.scrbl"] +@include-section["ToggleFF.scrbl"] +@include-section["TouchResponder.scrbl"] +@include-section["TreeView.scrbl"] +@include-section["TreeViewItem.scrbl"] +@include-section["Trig.scrbl"] +@include-section["Trig1.scrbl"] +@include-section["TrigControl.scrbl"] +@include-section["True.scrbl"] +@include-section["Tuning.scrbl"] +@include-section["TwoPole.scrbl"] +@include-section["TwoWayIdentityDictionary.scrbl"] +@include-section["TwoZero.scrbl"] +@include-section["UGen.scrbl"] +@include-section["UnaryOpFunction.scrbl"] +@include-section["UnaryOpStream.scrbl"] +@include-section["UnaryOpUGen.scrbl"] +@include-section["UniqueID.scrbl"] +@include-section["UnixFILE.scrbl"] +@include-section["Unpack1FFT.scrbl"] +@include-section["UnpackFFT.scrbl"] +@include-section["UserView.scrbl"] +@include-section["VDiskIn.scrbl"] +@include-section["VLayout.scrbl"] +@include-section["VLayoutView.scrbl"] +@include-section["VOsc.scrbl"] +@include-section["VOsc3.scrbl"] +@include-section["VarLag.scrbl"] +@include-section["VarSaw.scrbl"] +@include-section["Vibrato.scrbl"] +@include-section["View.scrbl"] +@include-section["Volume.scrbl"] +@include-section["Warp.scrbl"] +@include-section["Warp1.scrbl"] +@include-section["Wavetable.scrbl"] +@include-section["WebView.scrbl"] +@include-section["WhiteNoise.scrbl"] +@include-section["WiiMote.scrbl"] +@include-section["Window.scrbl"] +@include-section["Wrap.scrbl"] +@include-section["WrapIndex.scrbl"] +@include-section["XFade2.scrbl"] +@include-section["XIn.scrbl"] +@include-section["XInFeedback.scrbl"] +@include-section["XLine.scrbl"] +@include-section["XOut.scrbl"] +@include-section["ZeroCrossing.scrbl"] diff --git a/doc-schelp/HelpSource/Guides/guides.scrbl b/doc-schelp/HelpSource/Guides/guides.scrbl new file mode 100644 index 0000000..8dcde63 --- /dev/null +++ b/doc-schelp/HelpSource/Guides/guides.scrbl @@ -0,0 +1,49 @@ +Guides + +@include-section["AggregateDevice.scrbl"] +@include-section["Backwards-Compatibility.scrbl"] +@include-section["Bundled-Messages.scrbl"] +@include-section["ClientVsServer.scrbl"] +@include-section["Debugging-tips.scrbl"] +@include-section["EmacsGUI.scrbl"] +@include-section["FFT-Overview.scrbl"] +@include-section["GUI-Introduction.scrbl"] +@include-section["GUI-Layout-Management.scrbl"] +@include-section["Glossary.scrbl"] +@include-section["HID_permissions.scrbl"] +@include-section["How-to-Use-the-Interpreter.scrbl"] +@include-section["Intro-to-Objects.scrbl"] +@include-section["J-concepts-in-SC.scrbl"] +@include-section["LID_permissions.scrbl"] +@include-section["ListComprehensions.scrbl"] +@include-section["MIDI.scrbl"] +@include-section["More-On-Getting-Help.scrbl"] +@include-section["Multichannel-Expansion.scrbl"] +@include-section["News-3_5.scrbl"] +@include-section["News-3_6.scrbl"] +@include-section["News-3_7.scrbl"] +@include-section["News-3_8.scrbl"] +@include-section["News-Qt-GUI.scrbl"] +@include-section["NodeMessaging.scrbl"] +@include-section["Non-Realtime-Synthesis.scrbl"] +@include-section["OSC_communication.scrbl"] +@include-section["Order-of-execution.scrbl"] +@include-section["Polymorphism.scrbl"] +@include-section["Randomness.scrbl"] +@include-section["SCIde.scrbl"] +@include-section["Server-Guide.scrbl"] +@include-section["ServerTiming.scrbl"] +@include-section["Spawning.scrbl"] +@include-section["Sync-Async.scrbl"] +@include-section["SynthDefsVsSynths.scrbl"] +@include-section["Tour_of_UGens.scrbl"] +@include-section["Tracing-Processes.scrbl"] +@include-section["UGens-and-Synths.scrbl"] +@include-section["Understanding-Errors.scrbl"] +@include-section["UsingExtensions.scrbl"] +@include-section["UsingMIDI.scrbl"] +@include-section["UsingQuarks.scrbl"] +@include-section["Working_with_HID.scrbl"] +@include-section["WritingPrimitives.scrbl"] +@include-section["WritingUGens.scrbl"] +@include-section["standalones.scrbl"] diff --git a/doc-schelp/HelpSource/Overviews/overviews.scrbl b/doc-schelp/HelpSource/Overviews/overviews.scrbl new file mode 100644 index 0000000..ec954d8 --- /dev/null +++ b/doc-schelp/HelpSource/Overviews/overviews.scrbl @@ -0,0 +1,10 @@ +Overview + +@include-section["ClassTree.scrbl"] +@include-section["Collections.scrbl"] +@include-section["Event_types.scrbl"] +@include-section["JITLib.scrbl"] +@include-section["Operators.scrbl"] +@include-section["SC3vsSC2.scrbl"] +@include-section["Streams.scrbl"] +@include-section["SymbolicNotations.scrbl"] diff --git a/doc-schelp/HelpSource/Reference/reference.scrbl b/doc-schelp/HelpSource/Reference/reference.scrbl new file mode 100644 index 0000000..906c049 --- /dev/null +++ b/doc-schelp/HelpSource/Reference/reference.scrbl @@ -0,0 +1,38 @@ +Reference + +@include-section["Adverbs.scrbl"] +@include-section["Assignment.scrbl"] +@include-section["Control-Structures.scrbl"] +@include-section["EmacsEditor.scrbl"] +@include-section["Expression-Sequence.scrbl"] +@include-section["Functions.scrbl"] +@include-section["Key-Value-Pairs.scrbl"] +@include-section["KeyboardShortcuts.scrbl"] +@include-section["Literals.scrbl"] +@include-section["Messages.scrbl"] +@include-section["Modifiers.scrbl"] +@include-section["NodeEvent.scrbl"] +@include-section["NodeProxy_roles.scrbl"] +@include-section["Partial-Application.scrbl"] +@include-section["Resize.scrbl"] +@include-section["Scope.scrbl"] +@include-section["Server-Architecture.scrbl"] +@include-section["Server-Command-Reference.scrbl"] +@include-section["ServerPluginAPI.scrbl"] +@include-section["StartupFile.scrbl"] +@include-section["Syntax-Shortcuts.scrbl"] +@include-section["Synth-Definition-File-Format.scrbl"] +@include-section["asTarget.scrbl"] +@include-section["default_group.scrbl"] +@include-section["gui.scrbl"] +@include-section["gui_alignments.scrbl"] +@include-section["if.scrbl"] +@include-section["initClass.scrbl"] +@include-section["loop.scrbl"] +@include-section["play.scrbl"] +@include-section["playN.scrbl"] +@include-section["plot.scrbl"] +@include-section["randomSeed.scrbl"] +@include-section["softPut.scrbl"] +@include-section["softSet.scrbl"] +@include-section["softVol_.scrbl"] diff --git a/doc-schelp/supercolllider-help.scrbl b/doc-schelp/supercolllider-help.scrbl new file mode 100644 index 0000000..70bd690 --- /dev/null +++ b/doc-schelp/supercolllider-help.scrbl @@ -0,0 +1,20 @@ +#lang scribble/manual + +@title{rsc3: racket/scheme/supercollider} + +@table-of-contents[] + +Partially regenerated documentation (sc3.schelp -> rsc3.scrbl) + +@; ------------------------------------------------------------------------ + +@include-section["HelpSource/Help.scrbl"] +@include-section["HelpSource/Classes/classes.scrbl"] +@include-section["HelpSource/Guides/guides.scrbl"] +@include-section["HelpSource/Other/JITLibChanges3.7.scrbl"] +@include-section["HelpSource/Overviews/overviews.scrbl"] +@include-section["HelpSource/Reference/reference.scrbl"] +@include-section["HelpSource/Tutorials/Tutorial.scrbl"] +@; further "HelpSource/Tutorials/" + +@index-section[] diff --git a/doc/examples/graph/lfo-modulation.rkt b/doc/examples/graph/lfo-modulation.rkt index 5d28615..14c6d89 100644 --- a/doc/examples/graph/lfo-modulation.rkt +++ b/doc/examples/graph/lfo-modulation.rkt @@ -12,3 +12,4 @@ (comb-l s 0.3 (mce2 0.2 0.25) 2))) (audition (out 0 lfo-modulation)) + diff --git a/doc/help/server-command/b-alloc.help.scrbl b/doc/help/server-command/b-alloc.help.scrbl index 256dd1e..46bf59f 100644 --- a/doc/help/server-command/b-alloc.help.scrbl +++ b/doc/help/server-command/b-alloc.help.scrbl @@ -3,6 +3,7 @@ @title{/b_alloc Allocate buffer space.} + int - buffer number int - number of frames int - number of channels (optional. default = 1 channel) @@ -12,3 +13,4 @@ Allocates zero filled buffer to number of channels and samples. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-allocRead.help.scrbl b/doc/help/server-command/b-allocRead.help.scrbl index 5ac8657..cad459b 100644 --- a/doc/help/server-command/b-allocRead.help.scrbl +++ b/doc/help/server-command/b-allocRead.help.scrbl @@ -3,6 +3,7 @@ @title{/b_allocRead Allocate buffer space and read a sound file.} + int - buffer number string - path name of a sound file. int - starting frame in file (optional. default = 0) @@ -18,3 +19,4 @@ file is read. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-close.help.scrbl b/doc/help/server-command/b-close.help.scrbl index 2aefc00..c7b0440 100644 --- a/doc/help/server-command/b-close.help.scrbl +++ b/doc/help/server-command/b-close.help.scrbl @@ -3,8 +3,10 @@ @title{/b_close} + int - buffer number After using a buffer with DiskOut, close the soundfile and write header information. + diff --git a/doc/help/server-command/b-fill.help.scrbl b/doc/help/server-command/b-fill.help.scrbl index 7928da0..10eeaf1 100644 --- a/doc/help/server-command/b-fill.help.scrbl +++ b/doc/help/server-command/b-fill.help.scrbl @@ -3,6 +3,7 @@ @title{/b_fill Fill ranges of sample value(s)} + int - buffer number [ int - sample starting index @@ -15,3 +16,4 @@ range, the starting sample index is given followed by the number of samples to change, followed by the value to fill. This is only meant for setting a few samples, not whole buffers or large sections. + diff --git a/doc/help/server-command/b-free.help.scrbl b/doc/help/server-command/b-free.help.scrbl index 8a8df54..16bf10c 100644 --- a/doc/help/server-command/b-free.help.scrbl +++ b/doc/help/server-command/b-free.help.scrbl @@ -3,6 +3,7 @@ @title{/b_free Free buffer data.} + int - buffer number bytes - an OSC message to execute upon completion. (optional) @@ -10,3 +11,4 @@ Frees buffer space allocated for this buffer. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-gen.help.scrbl b/doc/help/server-command/b-gen.help.scrbl index 65732ac..eaafd1e 100644 --- a/doc/help/server-command/b-gen.help.scrbl +++ b/doc/help/server-command/b-gen.help.scrbl @@ -3,6 +3,7 @@ @title{/b_gen Call a command to fill a buffer} + int - buffer number string - command name .. command arguments @@ -83,3 +84,4 @@ negative, the maximum number of samples possible is copied. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-get.help.scrbl b/doc/help/server-command/b-get.help.scrbl index 3371535..1702fe3 100644 --- a/doc/help/server-command/b-get.help.scrbl +++ b/doc/help/server-command/b-get.help.scrbl @@ -3,6 +3,7 @@ @title{/b_get Get sample value(s)} + int - buffer number [ int - a sample index @@ -10,3 +11,4 @@ int - buffer number Replies to sender with the corresponding /b_set command. + diff --git a/doc/help/server-command/b-getn.help.scrbl b/doc/help/server-command/b-getn.help.scrbl index 0c27052..05da5d7 100644 --- a/doc/help/server-command/b-getn.help.scrbl +++ b/doc/help/server-command/b-getn.help.scrbl @@ -3,6 +3,7 @@ @title{/b_getn Get ranges of sample value(s)} + int - buffer number [ int - starting sample index @@ -13,3 +14,4 @@ Get contiguous ranges of samples. Replies to sender with the corresponding /b_setn command. This is only meant for getting a few samples, not whole buffers or large sections. + diff --git a/doc/help/server-command/b-query.help.scrbl b/doc/help/server-command/b-query.help.scrbl index 8452914..c0dccac 100644 --- a/doc/help/server-command/b-query.help.scrbl +++ b/doc/help/server-command/b-query.help.scrbl @@ -3,6 +3,7 @@ @title{/b_query} + [ int - buffer number ] * N @@ -17,8 +18,12 @@ Responds to the sender with a /b_info message. The arguments to float - sample rate ] * N + +@racketblock[ (with-sc3 (lambda (fd) (async fd (/b_alloc 10 6 1)) (async fd (/b_query 10)))) +] + diff --git a/doc/help/server-command/b-read.help.scrbl b/doc/help/server-command/b-read.help.scrbl index a28c991..e9b3cfa 100644 --- a/doc/help/server-command/b-read.help.scrbl +++ b/doc/help/server-command/b-read.help.scrbl @@ -3,6 +3,7 @@ @title{/b_read Read sound file data into an existing buffer.} + int - buffer number string - path name of a sound file. int - starting frame in file (optional. default = 0) @@ -19,3 +20,4 @@ open" to one, otherwise set it to zero. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-set.help.scrbl b/doc/help/server-command/b-set.help.scrbl index cd963ae..67166ee 100644 --- a/doc/help/server-command/b-set.help.scrbl +++ b/doc/help/server-command/b-set.help.scrbl @@ -3,6 +3,7 @@ @title{/b_set Set sample value(s)} + int - buffer number [ int - a sample index @@ -13,3 +14,4 @@ Takes a list of pairs of sample indices and values and sets the samples to those values. + diff --git a/doc/help/server-command/b-setn.help.scrbl b/doc/help/server-command/b-setn.help.scrbl index 1fdf49f..8c36970 100644 --- a/doc/help/server-command/b-setn.help.scrbl +++ b/doc/help/server-command/b-setn.help.scrbl @@ -3,6 +3,7 @@ @title{/b_setn Set ranges of sample value(s)} + int - buffer number [ int - sample starting index @@ -17,3 +18,4 @@ range, the starting sample index is given followed by the number of samples to change, followed by the values. + diff --git a/doc/help/server-command/b-write.help.scrbl b/doc/help/server-command/b-write.help.scrbl index 3b88401..2bcca5a 100644 --- a/doc/help/server-command/b-write.help.scrbl +++ b/doc/help/server-command/b-write.help.scrbl @@ -3,6 +3,7 @@ @title{/b_write Write sound file data.} + int - buffer number string - path name of a sound file. string - header format. @@ -29,3 +30,4 @@ the DiskOut ugen does so. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/b-zero.help.scrbl b/doc/help/server-command/b-zero.help.scrbl index 527bcc9..4547103 100644 --- a/doc/help/server-command/b-zero.help.scrbl +++ b/doc/help/server-command/b-zero.help.scrbl @@ -3,6 +3,7 @@ @title{/b_zero Zero sample data} + int - buffer number bytes - an OSC message to execute upon completion. (optional) @@ -10,3 +11,4 @@ Sets all samples in the buffer to zero. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/c-fill.help.scrbl b/doc/help/server-command/c-fill.help.scrbl index 7fe9963..898716e 100644 --- a/doc/help/server-command/c-fill.help.scrbl +++ b/doc/help/server-command/c-fill.help.scrbl @@ -3,6 +3,7 @@ @title{/c_fill Fill ranges of bus value(s)} + [ int - starting bus index int - number of buses to fill (M) @@ -13,3 +14,4 @@ Set contiguous ranges of buses to single values. For each range, the starting sample index is given followed by the number of buses to change, followed by the value to fill. + diff --git a/doc/help/server-command/c-get.help.scm b/doc/help/server-command/c-get.help.scm index 2a1c4fb..9c24676 100644 --- a/doc/help/server-command/c-get.help.scm +++ b/doc/help/server-command/c-get.help.scm @@ -1,9 +1,8 @@ -;/c_get Get bus value(s) +; /c_get Get bus value(s) ; [ ; int - a bus index ; ] * N - + ; Takes a list of buses and replies to sender with the corresponding ; /c_set command. - diff --git a/doc/help/server-command/c-get.help.scrbl b/doc/help/server-command/c-get.help.scrbl index 599a4cf..83357a9 100644 --- a/doc/help/server-command/c-get.help.scrbl +++ b/doc/help/server-command/c-get.help.scrbl @@ -3,10 +3,11 @@ @title{/c_get Get bus value(s)} + [ -int - a bus index + int - a bus index ] * N - + Takes a list of buses and replies to sender with the corresponding /c_set command. diff --git a/doc/help/server-command/c-getn.help.scrbl b/doc/help/server-command/c-getn.help.scrbl index 1a2f829..1cbc8a0 100644 --- a/doc/help/server-command/c-getn.help.scrbl +++ b/doc/help/server-command/c-getn.help.scrbl @@ -3,6 +3,7 @@ @title{/c_getn Get ranges of bus value(s)} + [ int - starting bus index int - number of sequential buses to get (M) @@ -11,3 +12,4 @@ int - number of sequential buses to get (M) Get contiguous ranges of buses. Replies to sender with the corresponding /c_setn command. + diff --git a/doc/help/server-command/c-setn.help.scrbl b/doc/help/server-command/c-setn.help.scrbl index e1521a7..baf3dff 100644 --- a/doc/help/server-command/c-setn.help.scrbl +++ b/doc/help/server-command/c-setn.help.scrbl @@ -3,6 +3,7 @@ @title{/c_setn Set ranges of bus value(s)} + [ int - starting bus index int - number of sequential buses to change (M) @@ -15,3 +16,4 @@ Set contiguous ranges of buses to sets of values. For each range, the starting bus index is given followed by the number of channels to change, followed by the values. + diff --git a/doc/help/server-command/c_set.help.scrbl b/doc/help/server-command/c_set.help.scrbl index 3228143..f734299 100644 --- a/doc/help/server-command/c_set.help.scrbl +++ b/doc/help/server-command/c_set.help.scrbl @@ -3,6 +3,7 @@ @title{/c_set Set bus value(s)} + [ int - a bus index float - a control value @@ -11,3 +12,4 @@ float - a control value Takes a list of pairs of bus indices and values and sets the buses to those values. + diff --git a/doc/help/server-command/clearSched.help.scrbl b/doc/help/server-command/clearSched.help.scrbl index e479c1a..ab134c8 100644 --- a/doc/help/server-command/clearSched.help.scrbl +++ b/doc/help/server-command/clearSched.help.scrbl @@ -3,5 +3,7 @@ @title{/clearSched Clear all scheduled bundles.} + Removes all bundles from the scheduling queue. + diff --git a/doc/help/server-command/d-free.help.scrbl b/doc/help/server-command/d-free.help.scrbl index 6a6d597..42d6a64 100644 --- a/doc/help/server-command/d-free.help.scrbl +++ b/doc/help/server-command/d-free.help.scrbl @@ -3,9 +3,11 @@ @title{/d_free delete synth definition} + [ string - synth def name ] * N Removes a synth definition once all synths using it have ended. + diff --git a/doc/help/server-command/d-load.help.scrbl b/doc/help/server-command/d-load.help.scrbl index 0ce6269..80213f4 100644 --- a/doc/help/server-command/d-load.help.scrbl +++ b/doc/help/server-command/d-load.help.scrbl @@ -3,6 +3,7 @@ @title{/d_load Load synth definition} + string - pathname of file. Can be a pattern like "synthdefs/perc-*" bytes - an OSC message to execute upon completion. (optional) @@ -11,3 +12,4 @@ names are overwritten. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/d-recv.help.scrbl b/doc/help/server-command/d-recv.help.scrbl index c3e22d4..75d8716 100644 --- a/doc/help/server-command/d-recv.help.scrbl +++ b/doc/help/server-command/d-recv.help.scrbl @@ -3,6 +3,7 @@ @title{/d_recv Receive a synth definition file} + bytes - buffer of data. bytes - an OSC message to execute upon completion. (optional) @@ -11,3 +12,4 @@ message. Resident definitions with the same names are overwritten. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/dumpOSC.help.scrbl b/doc/help/server-command/dumpOSC.help.scrbl index 3f94b42..3bef9a3 100644 --- a/doc/help/server-command/dumpOSC.help.scrbl +++ b/doc/help/server-command/dumpOSC.help.scrbl @@ -3,6 +3,7 @@ @title{/dumpOSC Display incoming OSC messages} + int - code Turns on and off printing of the contents of incoming Open Sound @@ -14,3 +15,4 @@ The values for the code are as follows: 2 - print the contents in hexadecimal. 3 - print both the parsed and hexadecimal representations of the contents. + diff --git a/doc/help/server-command/g-deepFree.help.scrbl b/doc/help/server-command/g-deepFree.help.scrbl index 4fda227..4e0f504 100644 --- a/doc/help/server-command/g-deepFree.help.scrbl +++ b/doc/help/server-command/g-deepFree.help.scrbl @@ -3,6 +3,7 @@ @title{/g_deepFree Free all synths in this group and all its sub-groups.} + [ int - group ID ] * N @@ -11,3 +12,4 @@ Traverses all groups below this group and frees all the synths. Sub-groups are not freed. A list of groups may be specified. + diff --git a/doc/help/server-command/g-freeAll.help.scrbl b/doc/help/server-command/g-freeAll.help.scrbl index ef2b45a..06921e9 100644 --- a/doc/help/server-command/g-freeAll.help.scrbl +++ b/doc/help/server-command/g-freeAll.help.scrbl @@ -3,9 +3,11 @@ @title{/g_freeAll Delete all nodes in a group.} + [ int - group ID ] * N Frees all nodes in the group. A list of groups may be specified. + diff --git a/doc/help/server-command/g-head.help.scrbl b/doc/help/server-command/g-head.help.scrbl index c9d3daa..e1072d4 100644 --- a/doc/help/server-command/g-head.help.scrbl +++ b/doc/help/server-command/g-head.help.scrbl @@ -3,6 +3,7 @@ @title{/g_head Add node to head of group} + [ int - group ID int - node ID @@ -10,3 +11,4 @@ Adds the node to the head (first to be executed) of the group. + diff --git a/doc/help/server-command/g-new.help.scrbl b/doc/help/server-command/g-new.help.scrbl index 7892e1b..e5aaf00 100644 --- a/doc/help/server-command/g-new.help.scrbl +++ b/doc/help/server-command/g-new.help.scrbl @@ -3,6 +3,7 @@ @title{/g_new Create a new group} + [ int - new group ID int - add action (0,1,2, 3 or 4 see below) @@ -33,3 +34,4 @@ ID. The target node is freed. Multiple groups may be created in one command by adding arguments. + diff --git a/doc/help/server-command/g-new1.help.scrbl b/doc/help/server-command/g-new1.help.scrbl index acebb7d..c93497d 100644 --- a/doc/help/server-command/g-new1.help.scrbl +++ b/doc/help/server-command/g-new1.help.scrbl @@ -4,3 +4,4 @@ @title{see g-new} + diff --git a/doc/help/server-command/g-tail.help.scrbl b/doc/help/server-command/g-tail.help.scrbl index 97061da..0951c99 100644 --- a/doc/help/server-command/g-tail.help.scrbl +++ b/doc/help/server-command/g-tail.help.scrbl @@ -3,6 +3,7 @@ @title{/g_tail Add node to tail of group} + [ int - group ID int - node ID @@ -11,3 +12,4 @@ Adds the node to the tail (last to be executed) of the group. + diff --git a/doc/help/server-command/n-after.help.scrbl b/doc/help/server-command/n-after.help.scrbl index e2b7781..bda4840 100644 --- a/doc/help/server-command/n-after.help.scrbl +++ b/doc/help/server-command/n-after.help.scrbl @@ -3,6 +3,7 @@ @title{/n_after Place a node after another} + [ int - the ID of the node to place (A) int - the ID of the node after which the above is placed (B) @@ -11,3 +12,4 @@ Places node A in the same group as node B, to execute immediately after node B. + diff --git a/doc/help/server-command/n-before.help.scrbl b/doc/help/server-command/n-before.help.scrbl index e6b911e..0739961 100644 --- a/doc/help/server-command/n-before.help.scrbl +++ b/doc/help/server-command/n-before.help.scrbl @@ -3,6 +3,7 @@ @title{/n_before Place a node before another} + [ int - the ID of the node to place (A) int - the ID of the node before which the above is placed (B) @@ -11,3 +12,4 @@ Places node A in the same group as node B, to execute immediately before node B. + diff --git a/doc/help/server-command/n-fill.help.scrbl b/doc/help/server-command/n-fill.help.scrbl index 705a0da..190762c 100644 --- a/doc/help/server-command/n-fill.help.scrbl +++ b/doc/help/server-command/n-fill.help.scrbl @@ -3,6 +3,7 @@ @title{/n_fill Fill ranges of a node's control value(s)} + int - node ID [ int or string - a control index or name @@ -15,3 +16,4 @@ range, the starting control index is given followed by the number of controls to change, followed by the value to fill. If the node is a group, then it sets the controls of every node in the group. + diff --git a/doc/help/server-command/n-free.help.scrbl b/doc/help/server-command/n-free.help.scrbl index f491c0f..cde7561 100644 --- a/doc/help/server-command/n-free.help.scrbl +++ b/doc/help/server-command/n-free.help.scrbl @@ -3,6 +3,7 @@ @title{/n_free Delete a node.} + [ int - node ID ] * N @@ -11,3 +12,4 @@ Stops a node abruptly, removes it from its group, and frees its memory. A list of node IDs may be specified. Using this method can cause a click if the node is not silent at the time it is freed. + diff --git a/doc/help/server-command/n-map.help.scrbl b/doc/help/server-command/n-map.help.scrbl index 07f3d79..87a6c0f 100644 --- a/doc/help/server-command/n-map.help.scrbl +++ b/doc/help/server-command/n-map.help.scrbl @@ -3,6 +3,7 @@ @title{/n_map Map a node's controls to read from a bus} + int - node ID [ int or string - a control index or name @@ -17,3 +18,4 @@ group. If the control bus index is -1 then any current mapping is undone and control reverts to normal. + diff --git a/doc/help/server-command/n-mapn.help.scrbl b/doc/help/server-command/n-mapn.help.scrbl index 3ddc9c5..d0c3f8c 100644 --- a/doc/help/server-command/n-mapn.help.scrbl +++ b/doc/help/server-command/n-mapn.help.scrbl @@ -3,6 +3,7 @@ @title{/n_mapn Map a node's controls to read from buses} + int - node ID [ int or string - a control index or name @@ -18,3 +19,4 @@ then any current mapping is undone and control reverts to normal. See also: /n_map + diff --git a/doc/help/server-command/n-query.help.scrbl b/doc/help/server-command/n-query.help.scrbl index 0069911..5123e97 100644 --- a/doc/help/server-command/n-query.help.scrbl +++ b/doc/help/server-command/n-query.help.scrbl @@ -3,6 +3,7 @@ @title{/n_query Get info about a node} + [ int - node ID ] * N @@ -12,3 +13,4 @@ clients. See Node Notifications below for the format of the /n_info message. + diff --git a/doc/help/server-command/n-run.help.scrbl b/doc/help/server-command/n-run.help.scrbl index 96bbdcc..dc68968 100644 --- a/doc/help/server-command/n-run.help.scrbl +++ b/doc/help/server-command/n-run.help.scrbl @@ -3,6 +3,7 @@ @title{/n_run Turn node on or off} + [ int - node ID int - run flag @@ -13,3 +14,4 @@ the run flag is set back to one, then it will be executed. Using this method to start and stop nodes can cause a click if the node is not silent at the time run flag is toggled. + diff --git a/doc/help/server-command/n-set.help.scrbl b/doc/help/server-command/n-set.help.scrbl index 6d8ea7e..e37edff 100644 --- a/doc/help/server-command/n-set.help.scrbl +++ b/doc/help/server-command/n-set.help.scrbl @@ -3,6 +3,7 @@ @title{/n_set Set a node's control value(s)} + int - node ID [ int or string - a control index or name @@ -13,19 +14,29 @@ Takes a list of pairs of control indices and values and sets the controls to those values. If the node is a group, then it sets the controls of every node in the group. + +@racketblock[ (with-sc3 (lambda (fd) (letc ((f 440) (a 0.1)) (send-synth fd "sin" (out 0 (mul (sin-osc ar f 0) a)))) (send fd (s-new0 "sin" 1001 add-to-tail 1)))) +] + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-set1 1001 "f" 1280)))) +] + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-set 1001 (list (tuple2 "f" (random 60 900)) (tuple2 "a" (random 0.05 0.25))))))) +] + diff --git a/doc/help/server-command/n-set1.help.scrbl b/doc/help/server-command/n-set1.help.scrbl index 41e0594..78151da 100644 --- a/doc/help/server-command/n-set1.help.scrbl +++ b/doc/help/server-command/n-set1.help.scrbl @@ -4,3 +4,4 @@ @title{see n-set} + diff --git a/doc/help/server-command/n-setn.help.scrbl b/doc/help/server-command/n-setn.help.scrbl index 68d02ff..22733de 100644 --- a/doc/help/server-command/n-setn.help.scrbl +++ b/doc/help/server-command/n-setn.help.scrbl @@ -3,6 +3,7 @@ @title{/n_setn Set ranges of a node's control value(s)} + int - node ID [ int or string - a control index or name @@ -17,3 +18,4 @@ range, the starting control index is given followed by the number of controls to change, followed by the values. If the node is a group, then it sets the controls of every node in the group. + diff --git a/doc/help/server-command/n-trace.help.scrbl b/doc/help/server-command/n-trace.help.scrbl index 86d30cf..9dec730 100644 --- a/doc/help/server-command/n-trace.help.scrbl +++ b/doc/help/server-command/n-trace.help.scrbl @@ -3,6 +3,7 @@ @title{/n_trace Trace a node} + [ int - node ID ] * N @@ -13,3 +14,4 @@ the node IDs and names of each node in the group for one control period. + diff --git a/doc/help/server-command/notify.help.scrbl b/doc/help/server-command/notify.help.scrbl index dcce616..c6a2c7c 100644 --- a/doc/help/server-command/notify.help.scrbl +++ b/doc/help/server-command/notify.help.scrbl @@ -3,6 +3,7 @@ @title{/notify Register to receive notifications from server} + int - one to receive notifications, zero to stop receiving them. If argument is one, server will remember your return address and @@ -11,3 +12,4 @@ sending you notifications. Asynchronous. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/nrt_end.help.scrbl b/doc/help/server-command/nrt_end.help.scrbl index af0a529..865791f 100644 --- a/doc/help/server-command/nrt_end.help.scrbl +++ b/doc/help/server-command/nrt_end.help.scrbl @@ -3,6 +3,7 @@ @title{/nrt_end end real time mode, close file} + **NOT YET IMPLEMENTED** no arguments. @@ -12,3 +13,4 @@ bundle timestamp will establish the ending time of the file. This command will end non real time mode and close the sound file. Replies to sender with /done when complete. + diff --git a/doc/help/server-command/quit.help.scrbl b/doc/help/server-command/quit.help.scrbl index 51b155f..7a44fb2 100644 --- a/doc/help/server-command/quit.help.scrbl +++ b/doc/help/server-command/quit.help.scrbl @@ -3,9 +3,11 @@ @title{/quit Quit program} + No arguments. Exits the synthesis server. Asynchronous. Replies to sender with /done just before completion. + diff --git a/doc/help/server-command/s-get.help.scrbl b/doc/help/server-command/s-get.help.scrbl index 1eeb96d..596c48d 100644 --- a/doc/help/server-command/s-get.help.scrbl +++ b/doc/help/server-command/s-get.help.scrbl @@ -3,6 +3,7 @@ @title{/s_get Get control value(s)} + int - synth ID [ int or string - a control index or name @@ -10,3 +11,4 @@ int - synth ID Replies to sender with the corresponding /n_set command. + diff --git a/doc/help/server-command/s-getn.help.scrbl b/doc/help/server-command/s-getn.help.scrbl index c5f027b..e78bb9b 100644 --- a/doc/help/server-command/s-getn.help.scrbl +++ b/doc/help/server-command/s-getn.help.scrbl @@ -3,6 +3,7 @@ @title{/s_getn Get ranges of control value(s)} + int - synth ID [ int|string - a control index or name @@ -12,3 +13,4 @@ int - synth ID Get contiguous ranges of controls. Replies to sender with the corresponding /n_setn command. + diff --git a/doc/help/server-command/s-new.help.scrbl b/doc/help/server-command/s-new.help.scrbl index 86d3caf..5d59931 100644 --- a/doc/help/server-command/s-new.help.scrbl +++ b/doc/help/server-command/s-new.help.scrbl @@ -3,6 +3,7 @@ @title{/s_new Create a new synth} + string - synth definition name int - synth ID int - add action (0,1,2, 3 or 4 see below) @@ -49,3 +50,4 @@ ID or not). This is how you can map the controls of a node with an auto generated ID. In a multi-client situation, the only way you can be sure what node -1 refers to is to put the messages in a bundle. + diff --git a/doc/help/server-command/s-new0.help.scrbl b/doc/help/server-command/s-new0.help.scrbl index a3758d0..dcf9779 100644 --- a/doc/help/server-command/s-new0.help.scrbl +++ b/doc/help/server-command/s-new0.help.scrbl @@ -4,3 +4,4 @@ @title{see s-new} + diff --git a/doc/help/server-command/s-noid.help.scrbl b/doc/help/server-command/s-noid.help.scrbl index 874daae..764b817 100644 --- a/doc/help/server-command/s-noid.help.scrbl +++ b/doc/help/server-command/s-noid.help.scrbl @@ -3,6 +3,7 @@ @title{/s_noid Auto-reassign synth's ID to a reserved value} + [ int - synth ID ] * N @@ -13,3 +14,4 @@ server will reassign this synth to a reserved negative number. This command is purely for bookkeeping convenience of the client. No notification is sent when this occurs. + diff --git a/doc/help/server-command/status.help.scrbl b/doc/help/server-command/status.help.scrbl index dbbb925..79d7cc2 100644 --- a/doc/help/server-command/status.help.scrbl +++ b/doc/help/server-command/status.help.scrbl @@ -3,6 +3,7 @@ @title{/status Query the status} + No arguments. Replies to sender with the following message. @@ -20,3 +21,4 @@ Replies to sender with the following message. + diff --git a/doc/help/server-command/sync.help.scrbl b/doc/help/server-command/sync.help.scrbl index ae16bc0..bc0787e 100644 --- a/doc/help/server-command/sync.help.scrbl +++ b/doc/help/server-command/sync.help.scrbl @@ -3,6 +3,7 @@ @title{/sync Notify when async commands have completed.} + int - a unique number identifying this command. Replies with a /synced message when all asynchronous commands @@ -11,3 +12,4 @@ sent unique ID. Asynchronous. Replies to sender with /synced, ID when complete. + diff --git a/doc/help/server-command/tr.help.scrbl b/doc/help/server-command/tr.help.scrbl index e922575..f60c9d7 100644 --- a/doc/help/server-command/tr.help.scrbl +++ b/doc/help/server-command/tr.help.scrbl @@ -3,6 +3,7 @@ @title{/tr A trigger message} + int - node ID int - trigger ID float - trigger value @@ -14,3 +15,4 @@ The node ID is the node that is sending the trigger. The trigger ID and value are determined by inputs to the SendTrig unit generator which is the originator of this message. + diff --git a/doc/help/server-command/u-cmd.help.scrbl b/doc/help/server-command/u-cmd.help.scrbl index 77a7df1..0c309f3 100644 --- a/doc/help/server-command/u-cmd.help.scrbl +++ b/doc/help/server-command/u-cmd.help.scrbl @@ -3,6 +3,7 @@ @title{/u_cmd send a command to a unit generator} + int - node ID int - unit generator index string - command name @@ -11,3 +12,4 @@ string - command name Sends all arguments following the command name to the unit generator to be performed. Commands are defined by unit generator plug ins. + diff --git a/doc/help/ugen/analysis/amplitude.help.scrbl b/doc/help/ugen/analysis/amplitude.help.scrbl index 4038c2d..aaea053 100644 --- a/doc/help/ugen/analysis/amplitude.help.scrbl +++ b/doc/help/ugen/analysis/amplitude.help.scrbl @@ -3,12 +3,20 @@ @title{(amplitude rate in attackTime releaseTime)} + Amplitude follower. Tracks the peak amplitude of a signal. + +@racketblock[ (audition (out 0 (mul (pulse ar 90 0.3) (amplitude kr (in 1 ar num-output-buses) 0.01 0.01)))) +] + +@racketblock[ (let* ((a (amplitude kr (in 1 ar num-output-buses) 0.01 0.01)) (f (mul-add a 1200 400))) (audition (out 0 (mul (sin-osc ar f 0) 0.3)))) +] + diff --git a/doc/help/ugen/analysis/compander.help.scrbl b/doc/help/ugen/analysis/compander.help.scrbl index d68e9c8..9afcc0e 100644 --- a/doc/help/ugen/analysis/compander.help.scrbl +++ b/doc/help/ugen/analysis/compander.help.scrbl @@ -3,6 +3,7 @@ @title{(compander input control thresh slopeBelow slopeAbove clampTime relaxTime)} + Compressor, expander, limiter, gate, ducker. General purpose dynamics processor. @@ -43,29 +44,48 @@ relaxTime: The amount of time for the amplitude adjustment to be Example signal to process. + +@racketblock[ (define z (mul (decay2 (mul (impulse ar 8 0) (mul (lf-saw kr 0.3 0) 0.3)) 0.001 0.3) (mix (pulse ar (mce2 80 81) 0.3)))) +] + +@racketblock[ (audition (out 0 z)) +] Noise gate + +@racketblock[ (let ((x (mouse-x kr 0.01 1 0 0.1))) (audition (out 0 (mce2 z (compander z z x 10 1 0.01 0.01))))) +] Compressor + +@racketblock[ (let ((x (mouse-x kr 0.01 1 0 0.1))) (audition (out 0 (mce2 z (compander z z x 1 0.5 0.01 0.01))))) +] limiter + +@racketblock[ (let ((x (mouse-x kr 0.01 1 0 0.1))) (audition (out 0 (mce2 z (compander z z x 1 0.1 0.01 0.01))))) +] Sustainer + +@racketblock[ (let ((x (mouse-x kr 0.01 1 0 0.1))) (audition (out 0 (mce2 z (compander z z x 0.1 1.0 0.01 0.01))))) +] + diff --git a/doc/help/ugen/analysis/pitch.help.scrbl b/doc/help/ugen/analysis/pitch.help.scrbl index 54f1b7c..be8bf4f 100644 --- a/doc/help/ugen/analysis/pitch.help.scrbl +++ b/doc/help/ugen/analysis/pitch.help.scrbl @@ -22,9 +22,14 @@ minFreq = 60.0, maxFreq = 4000.0, execFreq = 100.0, maxBinsPerOctave = 16, median = 1, ampThreshold = 0.01, peakThreshold = 0.5, downSample = 1. + +@racketblock[ (define (pitch* in median ampThreshold) (pitch in 444.0 60.0 4000.0 100.0 16 median ampThreshold 0.5 1)) +] + +@racketblock[ (let* ((in (mul (sin-osc ar (mouse-x kr 220 660 0 0.1) 0) (mouse-y kr 0.05 0.25 0 0.1))) (amp (amplitude kr in 0.05 0.05)) @@ -32,11 +37,16 @@ peakThreshold = 0.5, downSample = 1. (f (fdiv (car (mce-channels freq+)) 2)) (o (mul (sin-osc ar f 0) amp))) (audition (out 0 (mce2 in o)))) +] + +@racketblock[ (let* ((in (sound-in 0)) (amp (amplitude kr in 0.05 0.05)) (freq+ (pitch* in 7 0.02)) (f (car (mce-channels freq+))) (o (mul (sin-osc ar f 0) amp))) (audition (out 0 (mce2 in o)))) +] + diff --git a/doc/help/ugen/analysis/running-sum.help.scrbl b/doc/help/ugen/analysis/running-sum.help.scrbl index 54db354..37d0fe0 100644 --- a/doc/help/ugen/analysis/running-sum.help.scrbl +++ b/doc/help/ugen/analysis/running-sum.help.scrbl @@ -3,6 +3,7 @@ @title{(running-sum in numsamp)} + A running sum over a user specified number of samples, useful for running RMS power windowing. @@ -10,9 +11,13 @@ in - input signal numsamp - How many samples to take the running sum over (initialisation rate) + +@racketblock[ (let ((n 40)) (audition (out 0 (foldl1 mul (list (sin-osc ar 440 0) (running-sum (sound-in (mce2 0 1)) n) (recip n)))))) +] + diff --git a/doc/help/ugen/analysis/slope.help.scrbl b/doc/help/ugen/analysis/slope.help.scrbl index 3cffeb4..25a6d06 100644 --- a/doc/help/ugen/analysis/slope.help.scrbl +++ b/doc/help/ugen/analysis/slope.help.scrbl @@ -3,6 +3,7 @@ @title{(slope in)} + slope of signal. Measures the rate of change per second of a signal. Formula implemented is: @@ -13,6 +14,8 @@ in - input signal to measure. a = quadratic noise, b = first derivative line segments, c = second derivative constant segments + +@racketblock[ (let* ((r 2) (a (lf-noise2 kr r)) (scale (recip r)) @@ -20,4 +23,6 @@ derivative constant segments (c (mul (slope b) (squared scale))) (o (sin-osc ar (mul-add (mce3 a b c) 220 220) 0))) (audition (out 0 (mix (mul o 1/3))))) +] + diff --git a/doc/help/ugen/analysis/zero-crossing.help.scrbl b/doc/help/ugen/analysis/zero-crossing.help.scrbl index ea5c922..c1dee9b 100644 --- a/doc/help/ugen/analysis/zero-crossing.help.scrbl +++ b/doc/help/ugen/analysis/zero-crossing.help.scrbl @@ -3,6 +3,7 @@ @title{(zero-crossing in)} + Zero crossing frequency follower. outputs a frequency based upon the distance between interceptions @@ -13,7 +14,11 @@ in some situations. in - input signal. + +@racketblock[ (let* ((a (mul (sin-osc ar (mul-add (sin-osc kr 1 0) 600 700) 0) 0.1)) (b (mul (impulse ar (zero-crossing a) 0) 0.25))) (audition (out 0 (mce2 a b)))) +] + diff --git a/doc/help/ugen/binary-ops/abs-dif.help.scrbl b/doc/help/ugen/binary-ops/abs-dif.help.scrbl index 6428497..dfb9bfd 100644 --- a/doc/help/ugen/binary-ops/abs-dif.help.scrbl +++ b/doc/help/ugen/binary-ops/abs-dif.help.scrbl @@ -3,10 +3,15 @@ @title{(abs-dif a b)} + Calculates the value of (abs (- a b). Finding the magnitude of the difference of two values is a common operation. + +@racketblock[ (audition (out 0 (mul (f-sin-osc ar 440 0) (abs-dif 0.2 (mul (f-sin-osc ar 2 0) 0.5))))) +] + diff --git a/doc/help/ugen/binary-ops/add.help.scrbl b/doc/help/ugen/binary-ops/add.help.scrbl index a26d80a..c95c61a 100644 --- a/doc/help/ugen/binary-ops/add.help.scrbl +++ b/doc/help/ugen/binary-ops/add.help.scrbl @@ -3,14 +3,22 @@ @title{(add a b)} + addition, written '+' in sclang. + +@racketblock[ (audition (out 0 (add (mul (f-sin-osc ar 800 0) 0.1) (mul (pink-noise ar) 0.1)))) +] DC offset. + +@racketblock[ (audition (out 0 (add (f-sin-osc ar 440 0) 0.1))) +] + diff --git a/doc/help/ugen/binary-ops/am-clip.help.scrbl b/doc/help/ugen/binary-ops/am-clip.help.scrbl index 657e7ed..1f6319b 100644 --- a/doc/help/ugen/binary-ops/am-clip.help.scrbl +++ b/doc/help/ugen/binary-ops/am-clip.help.scrbl @@ -3,9 +3,14 @@ @title{(am-clip a b)} + Two quadrant multiply, 0 when b <= 0, a*b when b > 0 + +@racketblock[ (audition (out 0 (am-clip (white-noise ar) (mul (f-sin-osc kr 1 0) 0.2)))) +] + diff --git a/doc/help/ugen/binary-ops/atan2.help.scrbl b/doc/help/ugen/binary-ops/atan2.help.scrbl index b46761f..797062b 100644 --- a/doc/help/ugen/binary-ops/atan2.help.scrbl +++ b/doc/help/ugen/binary-ops/atan2.help.scrbl @@ -3,6 +3,7 @@ @title{(Atan2 x y)} + Returns the arctangent of y/x. See also hypot. @@ -11,6 +12,8 @@ add a pan to the hypot doppler examples by using atan2 to find the azimuth, or direction angle, of the sound source. Assume speakers at +/- 45 degrees and clip the direction to between those. + +@racketblock[ (let* ((x 10) (y (mul (lf-saw kr 1/6 0) 100)) (distance (hypot x y)) @@ -22,4 +25,6 @@ at +/- 45 degrees and clip the direction to between those. (out 0 (pan2 (delay-l sound 110/344 (fdiv distance 344)) loc amplitude)))) +] + diff --git a/doc/help/ugen/binary-ops/clip2.help.scrbl b/doc/help/ugen/binary-ops/clip2.help.scrbl index a3fd331..17a9b17 100644 --- a/doc/help/ugen/binary-ops/clip2.help.scrbl +++ b/doc/help/ugen/binary-ops/clip2.help.scrbl @@ -3,11 +3,19 @@ @title{(clip2 a b)} + Bilateral clipping. clips a to +/- b + +@racketblock[ (audition (out 0 (clip2 (f-sin-osc ar 400 0) 0.2))) +] + +@racketblock[ (audition (out 0 (clip2 (f-sin-osc ar 400 0) (line kr 0 1 8 remove-synth)))) +] + diff --git a/doc/help/ugen/binary-ops/dif-sqr.help.scrbl b/doc/help/ugen/binary-ops/dif-sqr.help.scrbl index b0591cf..6070217 100644 --- a/doc/help/ugen/binary-ops/dif-sqr.help.scrbl +++ b/doc/help/ugen/binary-ops/dif-sqr.help.scrbl @@ -3,17 +3,25 @@ @title{(dif-sqr a b)} + Difference of squares. Return the value of (a*a) - (b*b). This is more efficient than using separate unit generators for each operation. + +@racketblock[ (audition (out 0 (mul (dif-sqr (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (audition (out 0 (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (mul (sub (mul a a) (mul b b)) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/eq.help.scm b/doc/help/ugen/binary-ops/eq.help.scm index 4fa61ba..55aed3a 100644 --- a/doc/help/ugen/binary-ops/eq.help.scm +++ b/doc/help/ugen/binary-ops/eq.help.scm @@ -1 +1,2 @@ -;; See gt \ No newline at end of file +;; eq +;; See gt diff --git a/doc/help/ugen/binary-ops/eq.help.scrbl b/doc/help/ugen/binary-ops/eq.help.scrbl index cae4927..379bcf8 100644 --- a/doc/help/ugen/binary-ops/eq.help.scrbl +++ b/doc/help/ugen/binary-ops/eq.help.scrbl @@ -1,6 +1,8 @@ #lang scribble/manual @(require (for-label racket)) -@title{See gt} +@title{eq} + +See gt diff --git a/doc/help/ugen/binary-ops/excess.help.scrbl b/doc/help/ugen/binary-ops/excess.help.scrbl index b5c261b..b4d1125 100644 --- a/doc/help/ugen/binary-ops/excess.help.scrbl +++ b/doc/help/ugen/binary-ops/excess.help.scrbl @@ -3,14 +3,22 @@ @title{(excess a b)} + clipping residual. Returns the difference of the original signal and its clipped form: (a - clip2(a,b)). + +@racketblock[ (audition (out 0 (excess (f-sin-osc ar 1000 0) (line kr 0 1 8 do-nothing)))) +] + +@racketblock[ (audition (out 0 (let ((a (f-sin-osc ar 1000 0)) (b (line kr 0 1 8 do-nothing))) (sub a (clip2 a b))))) +] + diff --git a/doc/help/ugen/binary-ops/fdiv.help.scrbl b/doc/help/ugen/binary-ops/fdiv.help.scrbl index 102b526..4877732 100644 --- a/doc/help/ugen/binary-ops/fdiv.help.scrbl +++ b/doc/help/ugen/binary-ops/fdiv.help.scrbl @@ -3,11 +3,16 @@ @title{(fdiv a b)} + Division, written '/' in sclang. Division can be tricky with signals because of division by zero. + +@racketblock[ (audition (out 0 (fdiv (mul (pink-noise ar) 0.1) (mul (f-sin-osc kr 10 0.5) 0.75)))) +] + diff --git a/doc/help/ugen/binary-ops/fold2.help.scrbl b/doc/help/ugen/binary-ops/fold2.help.scrbl index ed23084..60f123c 100644 --- a/doc/help/ugen/binary-ops/fold2.help.scrbl +++ b/doc/help/ugen/binary-ops/fold2.help.scrbl @@ -3,9 +3,14 @@ @title{(fold2 a b)} + Bilateral folding. folds a to +/- b. + +@racketblock[ (audition (out 0 (fold2 (f-sin-osc ar 1000 0) (line kr 0 1 8 do-nothing)))) +] + diff --git a/doc/help/ugen/binary-ops/ge.help.scrbl b/doc/help/ugen/binary-ops/ge.help.scrbl index 9f56e82..2966e15 100644 --- a/doc/help/ugen/binary-ops/ge.help.scrbl +++ b/doc/help/ugen/binary-ops/ge.help.scrbl @@ -3,5 +3,7 @@ @title{(ge a b)} + See gt + diff --git a/doc/help/ugen/binary-ops/gt.help.scrbl b/doc/help/ugen/binary-ops/gt.help.scrbl index 2a257e9..c100ac7 100644 --- a/doc/help/ugen/binary-ops/gt.help.scrbl +++ b/doc/help/ugen/binary-ops/gt.help.scrbl @@ -3,10 +3,13 @@ @title{(gt a b)} + Greater than, written '>' in sclang. Signal is 1.0 if a > b, otherwise it is 0.0. Similarly LT is <, GE >=, LE <= and EQ ==. These can be useful for triggering purposes, among other things. + +@racketblock[ (let* ((o (sin-osc kr 1 0)) (t (list (gt o 0) (ge o 0) @@ -23,4 +26,6 @@ These can be useful for triggering purposes, among other things. (p (env-perc 0.01 1 1 (list -4 -4))) (e (env-gen kr (make-mce t) 0.1 0 1 do-nothing p))) (audition (out 0 (mix (mul (sin-osc ar (make-mce f) 0) e))))) +] + diff --git a/doc/help/ugen/binary-ops/hypot.help.scrbl b/doc/help/ugen/binary-ops/hypot.help.scrbl index 866f720..3f2fefd 100644 --- a/doc/help/ugen/binary-ops/hypot.help.scrbl +++ b/doc/help/ugen/binary-ops/hypot.help.scrbl @@ -3,17 +3,23 @@ @title{(hypot x y)} + Returns the square root of the sum of the squares of a and b. Or equivalently, the distance from the origin to the point (x, y). + +@racketblock[ (audition (out 0 (mul (sin-osc ar 440 0) (hypot (mouse-x kr 0 0.1 0 0.1) (mouse-y kr 0 0.1 0 0.1))))) +] Object travels 200 meters in 6 secs (=120kph) passing 10 meters from the listener. The speed of sound is 344 meters/sec. + +@racketblock[ (let* ((x 10) (y (mul (lf-saw kr 1/6 0) 100)) (distance (hypot x y)) @@ -23,7 +29,10 @@ from the listener. The speed of sound is 344 meters/sec. (audition (out 0 (mul (f-sin-osc ar (mul 1000 pitch-ratio) 0) amplitude)))) +] + +@racketblock[ (let* ((x 10) (y (mul (lf-saw kr 1/6 0) 100)) (distance (hypot x y)) @@ -32,4 +41,6 @@ from the listener. The speed of sound is 344 meters/sec. (audition (out 0 (mul (delay-l sound 110/344 (fdiv distance 344)) amplitude)))) +] + diff --git a/doc/help/ugen/binary-ops/le.help.scrbl b/doc/help/ugen/binary-ops/le.help.scrbl index bb489f6..ccb5515 100644 --- a/doc/help/ugen/binary-ops/le.help.scrbl +++ b/doc/help/ugen/binary-ops/le.help.scrbl @@ -3,5 +3,7 @@ @title{(le a b)} + See gt + diff --git a/doc/help/ugen/binary-ops/lt.help.scrbl b/doc/help/ugen/binary-ops/lt.help.scrbl index 5a83c74..2eb89d3 100644 --- a/doc/help/ugen/binary-ops/lt.help.scrbl +++ b/doc/help/ugen/binary-ops/lt.help.scrbl @@ -3,5 +3,7 @@ @title{(lt a b)} + See gt + diff --git a/doc/help/ugen/binary-ops/max.help.scrbl b/doc/help/ugen/binary-ops/max.help.scrbl index b08fbbe..2d3322d 100644 --- a/doc/help/ugen/binary-ops/max.help.scrbl +++ b/doc/help/ugen/binary-ops/max.help.scrbl @@ -3,9 +3,14 @@ @title{(max a b)} + Maximum. + +@racketblock[ (audition (out 0 (let ((z (f-sin-osc ar 500 0))) (u:max z (f-sin-osc ar 0.1 0))))) +] + diff --git a/doc/help/ugen/binary-ops/min.help.scrbl b/doc/help/ugen/binary-ops/min.help.scrbl index 883d884..8ac324c 100644 --- a/doc/help/ugen/binary-ops/min.help.scrbl +++ b/doc/help/ugen/binary-ops/min.help.scrbl @@ -3,9 +3,14 @@ @title{(min a b)} + Minimum. + +@racketblock[ (audition (out 0 (let ((z (f-sin-osc ar 500 0))) (u:min z (f-sin-osc ar 0.1 0))))) +] + diff --git a/doc/help/ugen/binary-ops/mod.help.scrbl b/doc/help/ugen/binary-ops/mod.help.scrbl index 3ff5ca3..55733b2 100644 --- a/doc/help/ugen/binary-ops/mod.help.scrbl +++ b/doc/help/ugen/binary-ops/mod.help.scrbl @@ -3,8 +3,13 @@ @title{(Mod a b)} + Modulo, written % in sclang. outputs a modulo b. + +@racketblock[ (audition (out 0 (u:mod (f-sin-osc ar 100 4) 1))) +] + diff --git a/doc/help/ugen/binary-ops/mul.help.scrbl b/doc/help/ugen/binary-ops/mul.help.scrbl index e472602..a3bb404 100644 --- a/doc/help/ugen/binary-ops/mul.help.scrbl +++ b/doc/help/ugen/binary-ops/mul.help.scrbl @@ -3,22 +3,33 @@ @title{(mul a b)} + multiplication, written '*' in sclang. + +@racketblock[ (audition (out 0 (mul (sin-osc ar 440 0) 0.5))) +] Creates a beating effect (subaudio rate). + +@racketblock[ (audition (out 0 (mul3 (f-sin-osc kr 10 0) (pink-noise ar) 0.5))) +] Ring modulation. + +@racketblock[ (audition (out 0 (mul3 (sin-osc ar (x-line kr 100 1001 10 do-nothing) 0) (sync-saw ar 100 200) 0.25))) +] + diff --git a/doc/help/ugen/binary-ops/pow.help.scrbl b/doc/help/ugen/binary-ops/pow.help.scrbl index fa99da5..067f01e 100644 --- a/doc/help/ugen/binary-ops/pow.help.scrbl +++ b/doc/help/ugen/binary-ops/pow.help.scrbl @@ -3,17 +3,23 @@ @title{(pow a b)} + Exponentiation, written ** in sclang. When the signal is negative this function extends the usual definition of exponentiation and returns neg(neg(a) ** b). This allows exponentiation of negative signal values by noninteger exponents. + +@racketblock[ (audition (out 0 (let ((a (mul (f-sin-osc ar 100 0) 0.1))) (mce2 a (pow a 10))))) +] http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html + +@racketblock[ (let* ((n0 (mul-add (lf-noise2 kr 8) 200 300)) (n1 (mul-add (lf-noise2 kr 3) 10 20)) (s (blip ar n0 n1)) @@ -23,4 +29,6 @@ http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html (b (u:round d (pow 0.5 y)))) (audition (out 0 (mce2 d b)))) +] + diff --git a/doc/help/ugen/binary-ops/ring1.help.scrbl b/doc/help/ugen/binary-ops/ring1.help.scrbl index a95b44f..60fa002 100644 --- a/doc/help/ugen/binary-ops/ring1.help.scrbl +++ b/doc/help/ugen/binary-ops/ring1.help.scrbl @@ -3,19 +3,27 @@ @title{(ring1 a b)} + Ring modulation plus first source. Return the value of ((a*b) + a). This is more efficient than using separate unit generators for the multiply and add. See also mul, Ring1, Ring2, Ring3, Ring4. + +@racketblock[ (audition (out 0 (mul (ring1 (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (add (mul a b) a) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/ring2.help.scrbl b/doc/help/ugen/binary-ops/ring2.help.scrbl index 6813402..fa0fbce 100644 --- a/doc/help/ugen/binary-ops/ring2.help.scrbl +++ b/doc/help/ugen/binary-ops/ring2.help.scrbl @@ -3,19 +3,27 @@ @title{(ring2 a b)} + Ring modulation plus both sources. Return the value of ((a*b) + a + b). This is more efficient than using separate unit generators for the multiply and add. See also mul, Ring1, Ring3, Ring4. + +@racketblock[ (audition (out 0 (mul (ring2 (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (add3 (mul a b) a b) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/ring3.help.scrbl b/doc/help/ugen/binary-ops/ring3.help.scrbl index 65bd784..5fe139f 100644 --- a/doc/help/ugen/binary-ops/ring3.help.scrbl +++ b/doc/help/ugen/binary-ops/ring3.help.scrbl @@ -3,19 +3,27 @@ @title{(ring3 a b)} + Ring modulation variant. Return the value of (a * a * b). This is more efficient than using separate unit generators for the multiplies. See also mul, ring1, ring2, ring4. + +@racketblock[ (audition (out 0 (mul (ring3 (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul4 a a b 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/ring4.help.scrbl b/doc/help/ugen/binary-ops/ring4.help.scrbl index 940a1fd..d447e8a 100644 --- a/doc/help/ugen/binary-ops/ring4.help.scrbl +++ b/doc/help/ugen/binary-ops/ring4.help.scrbl @@ -3,20 +3,28 @@ @title{(ring4 a b)} + Ring modulation variant. Return the value of ((a*a *b) - (a*b*b)). This is more efficient than using separate unit generators for the multiplies. See also mul, ring1, ring2, ring3. + +@racketblock[ (audition (out 0 (mul (ring4 (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (sub (mul3 a a b) (mul3 a b b)) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/round-up.help.scrbl b/doc/help/ugen/binary-ops/round-up.help.scrbl index 0941ee2..5900e9e 100644 --- a/doc/help/ugen/binary-ops/round-up.help.scrbl +++ b/doc/help/ugen/binary-ops/round-up.help.scrbl @@ -3,14 +3,22 @@ @title{(round-up a b)} + Rounds a up to the nearest multiple of b. + +@racketblock[ (let* ((x (mouse-x kr 60 4000 0 0.1)) (f (round-up x 100))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let ((n (line kr 24 108 6 remove-synth))) (audition (out 0 (mul (saw ar (midi-cps (round-up n 1))) 0.2)))) +] + diff --git a/doc/help/ugen/binary-ops/round.help.scrbl b/doc/help/ugen/binary-ops/round.help.scrbl index 5cff52a..1325a87 100644 --- a/doc/help/ugen/binary-ops/round.help.scrbl +++ b/doc/help/ugen/binary-ops/round.help.scrbl @@ -3,14 +3,22 @@ @title{(round a b)} + Rounds a to the nearest multiple of b. + +@racketblock[ (let* ((x (mouse-x kr 60 4000 0 0.1)) (f (u:round x 100))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let ((n (line kr 24 108 6 remove-synth))) (audition (out 0 (mul (saw ar (midi-cps (u:round n 1))) 0.2)))) +] + diff --git a/doc/help/ugen/binary-ops/scale-neg.help.scrbl b/doc/help/ugen/binary-ops/scale-neg.help.scrbl index 8ee5e03..3f1093d 100644 --- a/doc/help/ugen/binary-ops/scale-neg.help.scrbl +++ b/doc/help/ugen/binary-ops/scale-neg.help.scrbl @@ -3,9 +3,14 @@ @title{(scale-neg a b)} + Scale negative part of input wave. a * b when a < 0, otherwise a. + +@racketblock[ (audition (out 0 (scale-neg (f-sin-osc ar 500 0) (line ar 1 -1 4 remove-synth)))) +] + diff --git a/doc/help/ugen/binary-ops/sqr-dif.help.scrbl b/doc/help/ugen/binary-ops/sqr-dif.help.scrbl index 35bf7b9..d3c4d21 100644 --- a/doc/help/ugen/binary-ops/sqr-dif.help.scrbl +++ b/doc/help/ugen/binary-ops/sqr-dif.help.scrbl @@ -3,18 +3,26 @@ @title{(sqr-dif a b)} + Square of the difference. Return the value of (a - b)**2. This is more efficient than using separate unit generators for each operation. + +@racketblock[ (audition (out 0 (mul (sqr-dif (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (mul (sub a b) (sub a b)) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/sqr-sum.help.scrbl b/doc/help/ugen/binary-ops/sqr-sum.help.scrbl index a01d0fe..05d2787 100644 --- a/doc/help/ugen/binary-ops/sqr-sum.help.scrbl +++ b/doc/help/ugen/binary-ops/sqr-sum.help.scrbl @@ -3,18 +3,26 @@ @title{(sqr-sum a b)} + Square of the difference. Return the value of (a + b)**2. This is more efficient than using separate unit generators for each operation. + +@racketblock[ (audition (out 0 (mul (sqr-sum (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (mul (add a b) (add a b)) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/sub.help.scrbl b/doc/help/ugen/binary-ops/sub.help.scrbl index bf33adb..0964960 100644 --- a/doc/help/ugen/binary-ops/sub.help.scrbl +++ b/doc/help/ugen/binary-ops/sub.help.scrbl @@ -3,13 +3,18 @@ @title{(sub a b)} + subtraction, written '-' in sclang. Silence. + +@racketblock[ (let ((z (f-sin-osc ar 800 0))) (audition (out 0 (sub z z)))) +] + diff --git a/doc/help/ugen/binary-ops/sum-sqr.help.scrbl b/doc/help/ugen/binary-ops/sum-sqr.help.scrbl index cdd344a..c7245a5 100644 --- a/doc/help/ugen/binary-ops/sum-sqr.help.scrbl +++ b/doc/help/ugen/binary-ops/sum-sqr.help.scrbl @@ -3,16 +3,24 @@ @title{(sum-sqr a b)} + Return the value of (a*a) + (b*b). This is more efficient than using separate unit generators for each operation. + +@racketblock[ (audition (out 0 (mul (sum-sqr (f-sin-osc ar 800 0) (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) 0.125))) +] + +@racketblock[ (let ((a (f-sin-osc ar 800 0)) (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) (audition (out 0 (mul (add (mul a a) (mul b b)) 0.125)))) +] + diff --git a/doc/help/ugen/binary-ops/thresh.help.scrbl b/doc/help/ugen/binary-ops/thresh.help.scrbl index a8f6186..ed69b13 100644 --- a/doc/help/ugen/binary-ops/thresh.help.scrbl +++ b/doc/help/ugen/binary-ops/thresh.help.scrbl @@ -3,8 +3,13 @@ @title{(thresh a b)} + Signal thresholding. 0 when a < b, otherwise a. + +@racketblock[ (audition (out 0 (thresh (mul (lf-noise0 ar 50) 0.5) 0.45))) +] + diff --git a/doc/help/ugen/binary-ops/trunc.help.scrbl b/doc/help/ugen/binary-ops/trunc.help.scrbl index 7fbb1e8..8454ab6 100644 --- a/doc/help/ugen/binary-ops/trunc.help.scrbl +++ b/doc/help/ugen/binary-ops/trunc.help.scrbl @@ -3,10 +3,15 @@ @title{(trunc a b)} + Truncate a to a multiple of b. + +@racketblock[ (let* ((x (mouse-x kr 60 4000 0 0.1)) (f (trunc x 100))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/binary-ops/wrap2.help.scrbl b/doc/help/ugen/binary-ops/wrap2.help.scrbl index a9d572e..b7a4132 100644 --- a/doc/help/ugen/binary-ops/wrap2.help.scrbl +++ b/doc/help/ugen/binary-ops/wrap2.help.scrbl @@ -3,9 +3,14 @@ @title{(wrap2 a b)} + Bilateral wrapping. wraps input wave to +/- b. + +@racketblock[ (audition (out 0 (wrap2 (f-sin-osc ar 1000 0) (line kr 0 1.01 8 do-nothing)))) +] + diff --git a/doc/help/ugen/chaos/crackle.help.scrbl b/doc/help/ugen/chaos/crackle.help.scrbl index d1ea7cb..9a348e6 100644 --- a/doc/help/ugen/chaos/crackle.help.scrbl +++ b/doc/help/ugen/chaos/crackle.help.scrbl @@ -3,16 +3,24 @@ @title{(crackle rate chaosParam)} + A noise generator based on a chaotic function. The parameter of the chaotic function has useful values from just below 1.0 to just above 2.0. Towards 2.0 the sound crackles. The equation implemented is: y0 = fabs(y1 * param - y2 - 0.05f) + +@racketblock[ (audition (out 0 (mul (crackle ar 1.95) 0.5))) +] Modulate chaos parameter + +@racketblock[ (let ((p (line kr 1.0 2.0 3 remove-synth))) (audition (out 0 (mul (crackle ar p) 0.5)))) +] + diff --git a/doc/help/ugen/chaos/cusp-l.help.scrbl b/doc/help/ugen/chaos/cusp-l.help.scrbl index 4e73b2c..0b5fa50 100644 --- a/doc/help/ugen/chaos/cusp-l.help.scrbl +++ b/doc/help/ugen/chaos/cusp-l.help.scrbl @@ -4,3 +4,4 @@ @title{See cusp-n} + diff --git a/doc/help/ugen/chaos/cusp-n.help.scrbl b/doc/help/ugen/chaos/cusp-n.help.scrbl index 695d4ee..24f7a9e 100644 --- a/doc/help/ugen/chaos/cusp-n.help.scrbl +++ b/doc/help/ugen/chaos/cusp-n.help.scrbl @@ -14,23 +14,36 @@ generator based on the difference equation: xn+1 = a - b*sqrt(|xn|) + +@racketblock[ (define cusp_ cusp-l) +] vary frequency + +@racketblock[ (let ((x (mouse-x kr 20 sample-rate 0 0.1))) (audition (out 0 (mul (cusp_ ar x 1.0 1.99 0) 0.3)))) +] mouse-controlled params + +@racketblock[ (let ((x (mouse-x kr 0.9 1.1 1 0.1)) (y (mouse-y kr 1.8 2 1 0.1))) (audition (out 0 (mul (cusp_ ar (fdiv sample-rate 4) x y 0) 0.3)))) +] as a frequency control + +@racketblock[ (let* ((x (mouse-x kr 0.9 1.1 1 0.1)) (y (mouse-y kr 1.8 2 1 0.1)) (f (mul-add (cusp_ ar 40 x y 0) 800 900))) (audition (out 0 (mul (sin-osc ar f 0.0) 0.4)))) +] + diff --git a/doc/help/ugen/chaos/fb-sine-c.help.scrbl b/doc/help/ugen/chaos/fb-sine-c.help.scrbl index b71f5c5..ee16867 100644 --- a/doc/help/ugen/chaos/fb-sine-c.help.scrbl +++ b/doc/help/ugen/chaos/fb-sine-c.help.scrbl @@ -3,6 +3,7 @@ @title{(fb-sine-c rate freq im fb a c xi yi)} + Feedback sine with chaotic phase indexing. freq - iteration frequency in Hz - 22050 @@ -25,24 +26,35 @@ sinewave results. sclang default values + +@racketblock[ (audition (out 0 (mul (fb-sine-c ar (fdiv sample-rate 4) 1 0.1 1.1 0.5 0.1 0.1) 0.2))) +] increase feedback + +@racketblock[ (let ((fb (line kr 0.01 4 10 do-nothing))) (audition (out 0 (mul (fb-sine-c ar sample-rate 1 fb 1.1 0.5 0.1 0.1) 0.2)))) +] increase phase multiplier + +@racketblock[ (let ((a (line kr 1 2 10 do-nothing))) (audition (out 0 (mul (fb-sine-c ar sample-rate 1 0 a 0.5 0.1 0.1) 0.2)))) +] randomly modulate parameters + +@racketblock[ (let* ((x (mouse-x kr 1 12 0 0.1)) (f (lambda (m a) (mul-add (lf-noise2 kr x) m a)))) (audition @@ -55,3 +67,5 @@ randomly modulate parameters 0.1 0.1) 0.2)))) +] + diff --git a/doc/help/ugen/chaos/fb-sine-l.help.scrbl b/doc/help/ugen/chaos/fb-sine-l.help.scrbl index 9479f22..b2a1d4e 100644 --- a/doc/help/ugen/chaos/fb-sine-l.help.scrbl +++ b/doc/help/ugen/chaos/fb-sine-l.help.scrbl @@ -4,3 +4,4 @@ @title{See fb-sine-c} + diff --git a/doc/help/ugen/chaos/fb-sine-n.help.scrbl b/doc/help/ugen/chaos/fb-sine-n.help.scrbl index 9479f22..b2a1d4e 100644 --- a/doc/help/ugen/chaos/fb-sine-n.help.scrbl +++ b/doc/help/ugen/chaos/fb-sine-n.help.scrbl @@ -4,3 +4,4 @@ @title{See fb-sine-c} + diff --git a/doc/help/ugen/chaos/gbman-c.help.scrbl b/doc/help/ugen/chaos/gbman-c.help.scrbl index 55a89ff..3f5aa32 100644 --- a/doc/help/ugen/chaos/gbman-c.help.scrbl +++ b/doc/help/ugen/chaos/gbman-c.help.scrbl @@ -4,3 +4,4 @@ @title{See GbmanL.} + diff --git a/doc/help/ugen/chaos/gbman-l.help.scrbl b/doc/help/ugen/chaos/gbman-l.help.scrbl index d3e1272..7719488 100644 --- a/doc/help/ugen/chaos/gbman-l.help.scrbl +++ b/doc/help/ugen/chaos/gbman-l.help.scrbl @@ -27,21 +27,34 @@ Jan. 1992. sclang default initial parameters. + +@racketblock[ (audition (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.1) 0.1))) +] Different initial parameters. + +@racketblock[ (audition (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) -0.7 -2.7) 0.1))) +] Wait for it... + +@racketblock[ (audition (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.0002) 0.1))) +] As a frequency control + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mul-add (gbman-l ar 40 1.2 2.1) 400 500) 0) 0.4))) +] + diff --git a/doc/help/ugen/chaos/gbman-n.help.scrbl b/doc/help/ugen/chaos/gbman-n.help.scrbl index 55a89ff..3f5aa32 100644 --- a/doc/help/ugen/chaos/gbman-n.help.scrbl +++ b/doc/help/ugen/chaos/gbman-n.help.scrbl @@ -4,3 +4,4 @@ @title{See GbmanL.} + diff --git a/doc/help/ugen/chaos/henon-c.help.scrbl b/doc/help/ugen/chaos/henon-c.help.scrbl index 7680d38..eafec55 100644 --- a/doc/help/ugen/chaos/henon-c.help.scrbl +++ b/doc/help/ugen/chaos/henon-c.help.scrbl @@ -4,3 +4,4 @@ @title{See henon-n} + diff --git a/doc/help/ugen/chaos/henon-l.help.scrbl b/doc/help/ugen/chaos/henon-l.help.scrbl index 7680d38..eafec55 100644 --- a/doc/help/ugen/chaos/henon-l.help.scrbl +++ b/doc/help/ugen/chaos/henon-l.help.scrbl @@ -4,3 +4,4 @@ @title{See henon-n} + diff --git a/doc/help/ugen/chaos/henon-n.help.scrbl b/doc/help/ugen/chaos/henon-n.help.scrbl index 833037a..68f816a 100644 --- a/doc/help/ugen/chaos/henon-n.help.scrbl +++ b/doc/help/ugen/chaos/henon-n.help.scrbl @@ -22,12 +22,17 @@ while studying the orbits of stars in globular clusters. With default initial parameters. + +@racketblock[ (audition (out 0 (mul (henon-n ar (mouse-x kr 20 sample-rate 0 0.1) 1.4 0.3 0 0) 0.1))) +] With mouse-control of parameters. + +@racketblock[ (audition (out 0 (mul (henon-n ar (fdiv sample-rate 4) @@ -36,9 +41,12 @@ With mouse-control of parameters. 0 0) 0.1))) +] With randomly modulate parameters. + +@racketblock[ (audition (out 0 (mul (henon-n ar (fdiv sample-rate 8) @@ -47,13 +55,18 @@ With randomly modulate parameters. 0 0) 0.1))) +] As a frequency control. + +@racketblock[ (let ((x (mouse-x kr 1 1.4 0 0.1)) (y (mouse-y kr 0 0.3 0 0.1)) (f 40)) (audition (out 0 (mul (sin-osc ar (mul-add (henon-n ar f x y 0 0) 800 900) 0) 0.4)))) +] + diff --git a/doc/help/ugen/chaos/latoocarfian-c.help.scrbl b/doc/help/ugen/chaos/latoocarfian-c.help.scrbl index a55735e..97e74f5 100644 --- a/doc/help/ugen/chaos/latoocarfian-c.help.scrbl +++ b/doc/help/ugen/chaos/latoocarfian-c.help.scrbl @@ -3,20 +3,50 @@ @title{(latoocarfian-c rate freq a b c d xi yi)} - -@racketblock[ (latoocarfian-l rate freq a b c d xi yi) -] - -@racketblock[ (latoocarfian-n rate freq a b c d xi yi) -] This is a function given in Clifford Pickover's book Chaos in Wonderland, pg 26. The function has four parameters a, b, c, and d. The function is: -xnew = sin +xnew = sin(y * b) + c * sin(x * b); +ynew = sin(x * a) + d * sin(y * a); +x = xnew; +y = ynew; +output = x; + +According to Pickover, parameters a and b should be in the range +from -3 to +3, and parameters c and d should be in the range from +0.5 to 1.5. The function can, depending on the parameters given, +give continuous chaotic output, converge to a single value +(silence) or oscillate in a cycle (tone). This UGen is +experimental and not optimized currently, so is rather hoggish of +CPU. + +Default initial parameters. + + @racketblock[ -(y * b) +(let ((x (mouse-x kr 20 sample-rate 0 0.1))) + (audition + (out 0 (mul (latoocarfian-c ar x 1 3 0.5 0.5 0.5 0.5) 0.2)))) ] + +randomly modulate all parameters. + + +@racketblock[ +(audition + (out 0 (mul (latoocarfian-c ar + (fdiv sample-rate 4) + (mul-add (lf-noise2 kr 2) 1.5 1.5) + (mul-add (lf-noise2 kr 2) 1.5 1.5) + (mul-add (lf-noise2 kr 2) 0.5 1.5) + (mul-add (lf-noise2 kr 2) 0.5 1.5) + 0.5 + 0.5) + 0.2))) +] + + diff --git a/doc/help/ugen/chaos/latoocarfian-l.help.scrbl b/doc/help/ugen/chaos/latoocarfian-l.help.scrbl index 12b324e..570a1da 100644 --- a/doc/help/ugen/chaos/latoocarfian-l.help.scrbl +++ b/doc/help/ugen/chaos/latoocarfian-l.help.scrbl @@ -4,3 +4,4 @@ @title{See latoocarfian-c.} + diff --git a/doc/help/ugen/chaos/latoocarfian-n.help.scrbl b/doc/help/ugen/chaos/latoocarfian-n.help.scrbl index 12b324e..570a1da 100644 --- a/doc/help/ugen/chaos/latoocarfian-n.help.scrbl +++ b/doc/help/ugen/chaos/latoocarfian-n.help.scrbl @@ -4,3 +4,4 @@ @title{See latoocarfian-c.} + diff --git a/doc/help/ugen/chaos/lin-cong-c.help.scrbl b/doc/help/ugen/chaos/lin-cong-c.help.scrbl index 8287346..d37a99a 100644 --- a/doc/help/ugen/chaos/lin-cong-c.help.scrbl +++ b/doc/help/ugen/chaos/lin-cong-c.help.scrbl @@ -24,13 +24,18 @@ The output signal is automatically scaled to a range of [-1, 1]. Default initial parameters. + +@racketblock[ (audition (out 0 (let ((x (mouse-x kr 20 sample-rate 0 0.1))) (mul (lin-cong-c ar x 1.1 0.13 1 0) 0.2)))) +] randomly modulate parameters. + +@racketblock[ (audition (out 0 (mul (lin-cong-c ar (mul-add (lf-noise2 kr 1.0) 1e4 1e4) @@ -39,9 +44,12 @@ randomly modulate parameters. (lf-noise2 kr 0.1) 0) 0.2))) +] As frequency control... + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mul-add (lin-cong-c ar 40 @@ -51,4 +59,6 @@ As frequency control... 0) 500 600) 0) 0.4))) +] + diff --git a/doc/help/ugen/chaos/lin-cong-l.help.scrbl b/doc/help/ugen/chaos/lin-cong-l.help.scrbl index ce86f56..4a9ee4b 100644 --- a/doc/help/ugen/chaos/lin-cong-l.help.scrbl +++ b/doc/help/ugen/chaos/lin-cong-l.help.scrbl @@ -4,3 +4,4 @@ @title{See lin-cong-c.} + diff --git a/doc/help/ugen/chaos/lin-cong-n.help.scrbl b/doc/help/ugen/chaos/lin-cong-n.help.scrbl index ce86f56..4a9ee4b 100644 --- a/doc/help/ugen/chaos/lin-cong-n.help.scrbl +++ b/doc/help/ugen/chaos/lin-cong-n.help.scrbl @@ -4,3 +4,4 @@ @title{See lin-cong-c.} + diff --git a/doc/help/ugen/chaos/logistic.help.scrbl b/doc/help/ugen/chaos/logistic.help.scrbl index e6972d0..8411100 100644 --- a/doc/help/ugen/chaos/logistic.help.scrbl +++ b/doc/help/ugen/chaos/logistic.help.scrbl @@ -3,10 +3,15 @@ @title{(logistic rate chaosParam freq)} + UNDOCUMENTED. Implements the equation: y1 = param * y1 * (1.0 - y1) + +@racketblock[ (audition (out 0 (mul (logistic ar 2.9 1000) 0.2))) +] + diff --git a/doc/help/ugen/chaos/lorenz-l.help.scrbl b/doc/help/ugen/chaos/lorenz-l.help.scrbl index 7f85ce8..9311663 100644 --- a/doc/help/ugen/chaos/lorenz-l.help.scrbl +++ b/doc/help/ugen/chaos/lorenz-l.help.scrbl @@ -3,6 +3,7 @@ @title{(lorenz-l rate freq s r b h xi yi zi)} + freq - iteration frequency in Hertz s, r, b - equation variables h - integration time step @@ -24,13 +25,18 @@ instability. A safe choice is the default amount of 0.05. vary frequency + +@racketblock[ (audition (out 0 (mul (lorenz-l ar (mouse-x kr 20 sample-rate 0 0.1) 10 28 2.667 0.05 0.1 0 0) 0.3))) +] randomly modulate params + +@racketblock[ (audition (out 0 (mul (lorenz-l ar sample-rate (mul-add (lf-noise0 kr 1) 2 10) @@ -39,9 +45,12 @@ randomly modulate params 0.05 0.1 0.0 0.0) 0.2))) +] as a frequency control + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mul-add @@ -59,4 +68,6 @@ as a frequency control 800 900) 0) 0.4))) +] + diff --git a/doc/help/ugen/chaos/quad-c.help.scrbl b/doc/help/ugen/chaos/quad-c.help.scrbl index b53701d..92b1b37 100644 --- a/doc/help/ugen/chaos/quad-c.help.scrbl +++ b/doc/help/ugen/chaos/quad-c.help.scrbl @@ -4,3 +4,4 @@ @title{See quad-n} + diff --git a/doc/help/ugen/chaos/quad-l.help.scrbl b/doc/help/ugen/chaos/quad-l.help.scrbl index b53701d..92b1b37 100644 --- a/doc/help/ugen/chaos/quad-l.help.scrbl +++ b/doc/help/ugen/chaos/quad-l.help.scrbl @@ -4,3 +4,4 @@ @title{See quad-n} + diff --git a/doc/help/ugen/chaos/quad-n.help.scrbl b/doc/help/ugen/chaos/quad-n.help.scrbl index 01b9f9e..183b5c2 100644 --- a/doc/help/ugen/chaos/quad-n.help.scrbl +++ b/doc/help/ugen/chaos/quad-n.help.scrbl @@ -14,17 +14,30 @@ General quadratic map chaotic generator. Non-, linear- and cubic- interpolating sound generators based on the difference equation: xn+1 = axn2 + bxn + c -(define quad_ quad-c) +@racketblock[ +(define quad_ quad-c) +] + + +@racketblock[ (audition (out 0 (mul (quad_ ar 4000 1 -1 -0.75 0) 0.2))) +] + +@racketblock[ (let ((r (mouse-x kr 3.5441 4 0 0.1))) (audition (out 0 (mul (quad_ ar 4000.0 (neg r) r 0 0.1) 0.4)))) +] + +@racketblock[ (let ((r (mouse-x kr 3.5441 4 0 0.1))) (audition (out 0 (mul (sin-osc ar (mul-add (quad_ ar 4 (neg r) r 0 0.1) 800 900) 0) 0.4)))) +] + diff --git a/doc/help/ugen/chaos/rossler.help.scrbl b/doc/help/ugen/chaos/rossler.help.scrbl index 3f50f53..e0f93e7 100644 --- a/doc/help/ugen/chaos/rossler.help.scrbl +++ b/doc/help/ugen/chaos/rossler.help.scrbl @@ -3,10 +3,15 @@ @title{(rossler rate chaosParam dt)} + The Rossler attractor is a well known chaotic function. The chaosParam can be varied from 1.0 to 25.0 with a dt of 0.04. Valid ranges for chaosParam vary depending on dt. + +@racketblock[ (audition (out 0 (mul (rossler ar 4 0.08) 0.1))) +] + diff --git a/doc/help/ugen/chaos/standard-l.help.scrbl b/doc/help/ugen/chaos/standard-l.help.scrbl index 005665d..3b4a3c6 100644 --- a/doc/help/ugen/chaos/standard-l.help.scrbl +++ b/doc/help/ugen/chaos/standard-l.help.scrbl @@ -23,20 +23,30 @@ the plasma physicist Boris Chirikov. Vary frequency + +@racketblock[ (audition (out 0 (mul (standard-l ar (mouse-x kr 20 sample-rate 0 0.1) 1 0.5 0) 0.3))) +] Mouse-controlled parameter. + +@racketblock[ (let ((f (fdiv sample-rate 2)) (x (mouse-x kr 0.9 4 0 0.1))) (audition (out 0 (mul (standard-l ar f x 0.5 0) 0.3)))) +] As a frequency control + +@racketblock[ (let* ((x (mouse-x kr 0.9 4 0 0.1)) (f (mul-add (standard-l ar 40 x 0.5 0) 800 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.4)))) +] + diff --git a/doc/help/ugen/chaos/standard-n.help.scrbl b/doc/help/ugen/chaos/standard-n.help.scrbl index 282eac1..fa5d85f 100644 --- a/doc/help/ugen/chaos/standard-n.help.scrbl +++ b/doc/help/ugen/chaos/standard-n.help.scrbl @@ -4,3 +4,4 @@ @title{See standard-l.} + diff --git a/doc/help/ugen/composite/mix-fill.help.scrbl b/doc/help/ugen/composite/mix-fill.help.scrbl index 1e3218e..b369922 100644 --- a/doc/help/ugen/composite/mix-fill.help.scrbl +++ b/doc/help/ugen/composite/mix-fill.help.scrbl @@ -1,10 +1,14 @@ #lang scribble/manual @(require (for-label racket)) -@title{(mix-fill n f) +@title{(mix-fill n f)} + + +@racketblock[ (let ((n 6) (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))} + (audition (out 0 (mix-fill n o)))) +] diff --git a/doc/help/ugen/composite/mix.help.scrbl b/doc/help/ugen/composite/mix.help.scrbl index eea9659..5884e75 100644 --- a/doc/help/ugen/composite/mix.help.scrbl +++ b/doc/help/ugen/composite/mix.help.scrbl @@ -3,14 +3,22 @@ @title{(mix UGen)} + Force multiple channel expansion and sum signals. + +@racketblock[ (let ((f (make-mce (list 600.2 622.0 641.3 677.7)))) (audition (out 0 (mul (mix (f-sin-osc ar f 0)) 0.1)))) +] Expansion nests. + +@racketblock[ (let ((l (f-sin-osc ar (mce2 100 500) 0)) (r (f-sin-osc ar (mce2 5000 501) 0))) (audition (out 0 (mul 0.05 (mix (mce2 l r)))))) +] + diff --git a/doc/help/ugen/controls/decay.help.scrbl b/doc/help/ugen/controls/decay.help.scrbl index 2fdb475..eb312ee 100644 --- a/doc/help/ugen/controls/decay.help.scrbl +++ b/doc/help/ugen/controls/decay.help.scrbl @@ -3,6 +3,7 @@ @title{(decay in decayTime)} + Exponential decay. This is essentially the same as integrator except that instead of supplying the coefficient directly, it is caculated from a 60 dB decay time. This is the time required for @@ -11,7 +12,11 @@ for exponential decaying envelopes triggered by impulses. Used as an envelope. + +@racketblock[ (audition (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) 0.2) (pink-noise ar)))) +] + diff --git a/doc/help/ugen/controls/decay2.help.scrbl b/doc/help/ugen/controls/decay2.help.scrbl index 0f861a4..574b2a2 100644 --- a/doc/help/ugen/controls/decay2.help.scrbl +++ b/doc/help/ugen/controls/decay2.help.scrbl @@ -3,6 +3,7 @@ @title{(decay2 in attackTime decayTime)} + Exponential decay. decay has a very sharp attack and can produce clicks. decay2 rounds off the attack by subtracting one decay from another. @@ -11,16 +12,23 @@ another. Used as an envelope + +@racketblock[ (audition (out 0 (mul (decay2 (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) 0.01 0.2) (mul (f-sin-osc ar 600 0) 0.25)))) +] Compare the above with decay used as the envelope. + +@racketblock[ (audition (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) 0.01) (mul (f-sin-osc ar 600 0) 0.25)))) +] + diff --git a/doc/help/ugen/controls/degree-to-key.help.scrbl b/doc/help/ugen/controls/degree-to-key.help.scrbl index 6226826..de6fbf7 100644 --- a/doc/help/ugen/controls/degree-to-key.help.scrbl +++ b/doc/help/ugen/controls/degree-to-key.help.scrbl @@ -3,6 +3,7 @@ @title{(degree-to-key bufnum in octave)} + Convert signal to modal pitch The input signal value is truncated to an integer value and used as @@ -16,6 +17,8 @@ in - the input signal. octave - the number of steps per octave in the scale. + +@racketblock[ (let* ((b 0) (p (list 0 2 3.2 5 7 9 10)) (x (mouse-x kr 0 15 0 0.1)) @@ -33,4 +36,6 @@ octave - the number of steps per octave in the scale. (send fd (b-setn1 0 0 p)) (let ((n (mul (lf-noise1 kr (mce2 3 3.05)) 0.04))) (play fd (out 0 (mul (add (c n 48) (c n 72)) 0.25))))))) +] + diff --git a/doc/help/ugen/controls/k2a.help.scrbl b/doc/help/ugen/controls/k2a.help.scrbl index 46130f1..2c7bd7c 100644 --- a/doc/help/ugen/controls/k2a.help.scrbl +++ b/doc/help/ugen/controls/k2a.help.scrbl @@ -3,6 +3,7 @@ @title{(k2a in)} + Control rate to audio rate converter. To be able to play a control rate UGen into an audio rate UGen, @@ -11,17 +12,27 @@ interpolation. in - input signal + +@racketblock[ (audition (out 0 (k2a (mul (white-noise kr) 0.3)))) +] + +@racketblock[ (audition (out 0 (mce2 (k2a (mul (white-noise kr) 0.3)) (mul (white-noise ar) 0.3)))) +] -(let* ((block-size 64) no ugen for this? + +@racketblock[ +(let* ((block-size 64) ;; no ugen for this? (freq (mul (fdiv (mouse-x kr 0.1 40 1 0.1) block-size) sample-rate))) (audition (out 0 (mul (mce2 (k2a (lf-noise0 kr freq)) (lf-noise0 ar freq)) 0.3)))) +] + diff --git a/doc/help/ugen/controls/key-state.help.scrbl b/doc/help/ugen/controls/key-state.help.scrbl index bebb9da..1b32294 100644 --- a/doc/help/ugen/controls/key-state.help.scrbl +++ b/doc/help/ugen/controls/key-state.help.scrbl @@ -3,13 +3,18 @@ @title{(key-state rate keynum minval maxval lag)} + Report the status of a particular key. A key is either pressed, or not pressed. The keycode 38 is the A key on my keyboard. Under X the xev(1) command is useful in determining your keyboard layout. + +@racketblock[ (audition (out 0 (mul (sin-osc ar 800 0) (key-state kr 38 0 0.1 0.5)))) +] + diff --git a/doc/help/ugen/controls/latch.help.scrbl b/doc/help/ugen/controls/latch.help.scrbl index 0461de0..ccc39b1 100644 --- a/doc/help/ugen/controls/latch.help.scrbl +++ b/doc/help/ugen/controls/latch.help.scrbl @@ -3,29 +3,40 @@ @title{(latch in trig)} + Sample and hold. Holds input signal value when triggered. in - input signal. trig - trigger. The trigger can be any signal. A trigger happens when the signal changes from non-positive to positive. + +@racketblock[ (audition (out 0 (mul (blip ar (mul-add (latch (white-noise ar) (impulse ar 9 0)) 400 500) 4) 0.2))) +] The above is just meant as example. lf-noise0 is a faster way to generate random steps : + +@racketblock[ (audition (out 0 (mul (blip ar (mul-add (lf-noise0 kr 9) 400 500) 4) 0.2))) +] http://create.ucsb.edu/pipermail/sc-users/2006-December/029991.html + +@racketblock[ (let* ((n0 (mul-add (lf-noise2 kr 8) 200 300)) (n1 (mul-add (lf-noise2 kr 3) 10 20)) (s (blip ar n0 n1)) (x (mouse-x kr 1000 (mul sample-rate 0.1) 1 0.1))) (audition (out 0 (latch s (impulse ar x 0))))) +] + diff --git a/doc/help/ugen/controls/mouse-button.help.scrbl b/doc/help/ugen/controls/mouse-button.help.scrbl index 93112fd..9a2cbe9 100644 --- a/doc/help/ugen/controls/mouse-button.help.scrbl +++ b/doc/help/ugen/controls/mouse-button.help.scrbl @@ -3,10 +3,15 @@ @title{(mouse-button rate minval maxval lag)} + Report the status of the first pointer button. The button is either pressed, or not pressed. + +@racketblock[ (audition (out 0 (mul (sin-osc ar 800 0) (mouse-button kr 0 0.1 0.1)))) +] + diff --git a/doc/help/ugen/controls/mouse-x.help.scrbl b/doc/help/ugen/controls/mouse-x.help.scrbl index 8b99443..72a2a60 100644 --- a/doc/help/ugen/controls/mouse-x.help.scrbl +++ b/doc/help/ugen/controls/mouse-x.help.scrbl @@ -3,22 +3,36 @@ @title{(mouse-x rate minval maxval warp lag)} + Cursor UGen. Report mouse location on root window of the machine that the synthesis server is running on. For a linear mapping set warp to 0, for an exponential mapping set warp to 1. -(import (rsc3)) +@racketblock[ +(import (rsc3)) +] + + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mouse-x kr 40 10000 1 0.1) 0) 0.1))) +] + +@racketblock[ (audition (out 0 (mce2 (mul (sin-osc ar (mouse-x kr 20 2000 1 0.1) 0) (mouse-y kr 0.01 0.1 0 0.1)) (mul (sin-osc ar (mouse-y kr 20 2000 1 0.1) 0) (mouse-x kr 0.01 0.1 0 0.1))))) +] Auto-pilot variant + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mouse-x* kr 40 10000 1 0.1) 0) 0.1))) +] + diff --git a/doc/help/ugen/controls/mouse-y.help.scrbl b/doc/help/ugen/controls/mouse-y.help.scrbl index 5a4f334..9f35224 100644 --- a/doc/help/ugen/controls/mouse-y.help.scrbl +++ b/doc/help/ugen/controls/mouse-y.help.scrbl @@ -3,11 +3,16 @@ @title{(mouse-y rate minval maxval warp lag)} + Report mouse location on root window of the machine that the synthesis server is running on. For a linear mapping set warp to 0, for an exponential mapping set warp to 1. + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mouse-x kr 20 2000 0 0.1) 0) (mouse-y kr 0.01 0.1 0 0.1)))) +] + diff --git a/doc/help/ugen/controls/mrg2.help.scrbl b/doc/help/ugen/controls/mrg2.help.scrbl index a20bc58..b28107b 100644 --- a/doc/help/ugen/controls/mrg2.help.scrbl +++ b/doc/help/ugen/controls/mrg2.help.scrbl @@ -3,30 +3,44 @@ @title{(mrg2 left right)} + mrg2 defines a node indicating a multiple root graph. + +@racketblock[ (let ((l (out 0 (mul (sin-osc ar 300 0) 0.1))) (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) (audition (mrg2 l r))) +] there is a leftmost rule, so that mrg nodes need not be terminal. + +@racketblock[ (let ((l (mul (sin-osc ar 300 0) 0.1)) (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) (audition (out 0 (mrg2 l r)))) +] the leftmost node may be an mce node + +@racketblock[ (let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1)) (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) (audition (out 0 (mrg2 l r)))) +] the implementation is not thorough + +@racketblock[ (let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1)) (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) (audition (out 0 (add (mrg2 l r) (mrg2 l r))))) +] + diff --git a/doc/help/ugen/controls/slew.help.scrbl b/doc/help/ugen/controls/slew.help.scrbl index 4c8fec8..43ced61 100644 --- a/doc/help/ugen/controls/slew.help.scrbl +++ b/doc/help/ugen/controls/slew.help.scrbl @@ -3,8 +3,13 @@ @title{(slew in up dn)} + Has the effect of removing transients and higher frequencies. + +@racketblock[ (audition (out 0 (slew (mul (saw ar 800) 0.2) 400 400))) +] + diff --git a/doc/help/ugen/controls/wrap-index.help.scrbl b/doc/help/ugen/controls/wrap-index.help.scrbl index f35810a..576b17f 100644 --- a/doc/help/ugen/controls/wrap-index.help.scrbl +++ b/doc/help/ugen/controls/wrap-index.help.scrbl @@ -3,6 +3,7 @@ @title{(wrap-index bufnum in)} + index into a table with a signal. The input signal value is truncated to an integer value and used as @@ -12,10 +13,14 @@ cyclically to the valid range. bufnum - index of the buffer in - the input signal. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 6 1)) (send fd (b-setn1 0 0 (list 200 300 400 500 600 800))) (let ((f (wrap-index 0 (mouse-x kr 0 18 0 0.1)))) (play fd (out 0 (mul (sin-osc ar f 0) 0.5)))))) +] + diff --git a/doc/help/ugen/delays/allpass-c.help.scrbl b/doc/help/ugen/delays/allpass-c.help.scrbl index 70af70f..901d39f 100644 --- a/doc/help/ugen/delays/allpass-c.help.scrbl +++ b/doc/help/ugen/delays/allpass-c.help.scrbl @@ -4,3 +4,4 @@ @title{See allpass-n} + diff --git a/doc/help/ugen/delays/allpass-l.help.scrbl b/doc/help/ugen/delays/allpass-l.help.scrbl index 70af70f..901d39f 100644 --- a/doc/help/ugen/delays/allpass-l.help.scrbl +++ b/doc/help/ugen/delays/allpass-l.help.scrbl @@ -4,3 +4,4 @@ @title{See allpass-n} + diff --git a/doc/help/ugen/delays/allpass-n.help.scrbl b/doc/help/ugen/delays/allpass-n.help.scrbl index 863f431..a0a7231 100644 --- a/doc/help/ugen/delays/allpass-n.help.scrbl +++ b/doc/help/ugen/delays/allpass-n.help.scrbl @@ -3,6 +3,7 @@ @title{(allpass-n in maxDelayTime delayTime decayTime)} + All pass delay line. allpass-n uses no interpolation, allpass-l uses linear interpolation, allpass-c uses all pass interpolation. All time values are in seconds. The decay time is the time for the @@ -13,26 +14,45 @@ harmonics at an octave lower. Since the allpass delay has no audible effect as a resonator on steady state sound ... -(define z (mul (white-noise ar) 0.1)) +@racketblock[ +(define z (mul (white-noise ar) 0.1)) +] + + +@racketblock[ (audition (out 0 (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))) +] ...these examples add the input to the effected sound so that you can hear the effect of the phase comb. + +@racketblock[ (audition (out 0 (add z (allpass-n z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2)))) +] + +@racketblock[ (audition (out 0 (add z (allpass-l z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2)))) +] + +@racketblock[ (audition (out 0 (add z (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2)))) +] Used as an echo - doesn't really sound different than Comb, but it outputs the input signal immediately (inverted) and the echoes are lower in amplitude. + +@racketblock[ (audition (out 0 (allpass-n (mul (decay (dust ar 1) 0.2) z) 0.2 0.2 3))) +] + diff --git a/doc/help/ugen/delays/buf-allpass-c.help.scrbl b/doc/help/ugen/delays/buf-allpass-c.help.scrbl index 02ae482..93a02b8 100644 --- a/doc/help/ugen/delays/buf-allpass-c.help.scrbl +++ b/doc/help/ugen/delays/buf-allpass-c.help.scrbl @@ -3,6 +3,7 @@ @title{(buf-allpass-c buf in delaytime decaytime)} + Buffer based all pass delay line with cubic interpolation All pass delay line with cubic interpolation which uses a buffer @@ -24,10 +25,17 @@ decaytime - time for the echoes to decay by 60 decibels. If this negative, thus emphasizing only odd harmonics at an octave lower. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 44100 1)))) +] + +@racketblock[ (let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5))) (audition (out 0 (buf-allpass-n 0 x 0.25 6)))) +] + diff --git a/doc/help/ugen/delays/buf-allpass-l.help.scrbl b/doc/help/ugen/delays/buf-allpass-l.help.scrbl index e6dff9a..605f196 100644 --- a/doc/help/ugen/delays/buf-allpass-l.help.scrbl +++ b/doc/help/ugen/delays/buf-allpass-l.help.scrbl @@ -4,3 +4,4 @@ @title{See Bufallpass-c} + diff --git a/doc/help/ugen/delays/buf-allpass-n.help.scrbl b/doc/help/ugen/delays/buf-allpass-n.help.scrbl index e6dff9a..605f196 100644 --- a/doc/help/ugen/delays/buf-allpass-n.help.scrbl +++ b/doc/help/ugen/delays/buf-allpass-n.help.scrbl @@ -4,3 +4,4 @@ @title{See Bufallpass-c} + diff --git a/doc/help/ugen/delays/buf-comb-c.help.scrbl b/doc/help/ugen/delays/buf-comb-c.help.scrbl index aa2ef85..90746b2 100644 --- a/doc/help/ugen/delays/buf-comb-c.help.scrbl +++ b/doc/help/ugen/delays/buf-comb-c.help.scrbl @@ -3,6 +3,7 @@ @title{(buf-comb-c buf in delaytime decaytime)} + Buffer based comb delay line with cubic interpolation All pass delay line with cubic interpolation which uses a buffer @@ -22,10 +23,17 @@ decaytime - time for the echoes to decay by 60 decibels. If this negative, thus emphasizing only odd harmonics at an octave lower. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 44100 1)))) +] + +@racketblock[ (let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5))) (audition (out 0 (buf-comb-n 0 x 0.25 6)))) +] + diff --git a/doc/help/ugen/delays/buf-comb-l.help.scrbl b/doc/help/ugen/delays/buf-comb-l.help.scrbl index 520e8fc..9033437 100644 --- a/doc/help/ugen/delays/buf-comb-l.help.scrbl +++ b/doc/help/ugen/delays/buf-comb-l.help.scrbl @@ -4,3 +4,4 @@ @title{See buf-comb-c} + diff --git a/doc/help/ugen/delays/buf-comb-n.help.scrbl b/doc/help/ugen/delays/buf-comb-n.help.scrbl index 520e8fc..9033437 100644 --- a/doc/help/ugen/delays/buf-comb-n.help.scrbl +++ b/doc/help/ugen/delays/buf-comb-n.help.scrbl @@ -4,3 +4,4 @@ @title{See buf-comb-c} + diff --git a/doc/help/ugen/delays/buf-delay-c.help.scrbl b/doc/help/ugen/delays/buf-delay-c.help.scrbl index e2b4ad0..73a4725 100644 --- a/doc/help/ugen/delays/buf-delay-c.help.scrbl +++ b/doc/help/ugen/delays/buf-delay-c.help.scrbl @@ -3,6 +3,7 @@ @title{(buf-delay-c buf in delaytime)} + Buffer based simple delay line with cubic interpolation. Simple delay line with cubic interpolation which uses a buffer for @@ -17,10 +18,17 @@ buf - buffer number. in - the input signal. delaytime - delay time in seconds. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 44100 1)))) +] + +@racketblock[ (let ((z (mul3 (decay (dust ar 1) 0.5) 0.3 (white-noise ar)))) (audition (out 0 (add (buf-delay-c 0 z 0.2) z)))) +] + diff --git a/doc/help/ugen/delays/buf-delay-l.help.scrbl b/doc/help/ugen/delays/buf-delay-l.help.scrbl index d613934..4b7ecf4 100644 --- a/doc/help/ugen/delays/buf-delay-l.help.scrbl +++ b/doc/help/ugen/delays/buf-delay-l.help.scrbl @@ -4,3 +4,4 @@ @title{See buf-delay-c} + diff --git a/doc/help/ugen/delays/buf-delay-n.help.scrbl b/doc/help/ugen/delays/buf-delay-n.help.scrbl index d613934..4b7ecf4 100644 --- a/doc/help/ugen/delays/buf-delay-n.help.scrbl +++ b/doc/help/ugen/delays/buf-delay-n.help.scrbl @@ -4,3 +4,4 @@ @title{See buf-delay-c} + diff --git a/doc/help/ugen/delays/buf-rd.help.scrbl b/doc/help/ugen/delays/buf-rd.help.scrbl index 6351b96..9efc717 100644 --- a/doc/help/ugen/delays/buf-rd.help.scrbl +++ b/doc/help/ugen/delays/buf-rd.help.scrbl @@ -3,6 +3,7 @@ @title{(buf-rd numChannels rate bufnum phase loop interpolation)} + Plays the content of a buffer. The number of channels must be a fixed integer. The architechture @@ -13,22 +14,36 @@ you have specified to the buf-rd, it will fail silently. The interpolation type is an integer: 1 no interpolation, 2 linear interpolation, 4 cubic interpolation. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (audition (out 0 (buf-rd 1 ar 0 (mul (sin-osc ar 0.1 0) (buf-frames ir 0)) 0 2))) +] + +@racketblock[ (let ((phase (mul (lf-noise1 ar (mouse-x kr (mce2 5 10) 100 0 0.1)) (buf-frames ir 0)))) (audition (out 0 (buf-rd-l 1 ar 0 phase 0)))) +] + +@racketblock[ (let ((phase (add (lf-tri ar 0.1 0) (mul (lf-tri ar 0.23 0) (buf-frames ir 0))))) (audition (out 0 (buf-rd-l 1 ar 0 phase 0)))) +] Use a phasor index into the file + +@racketblock[ (let ((phase (phasor ar 0 (mul (mouse-x kr 0.5 2 0 0.1) @@ -37,4 +52,6 @@ Use a phasor index into the file (buf-frames kr 0) 0))) (audition (out 0 (buf-rd 1 ar 0 phase 1 (mouse-y kr 0 5 0 0.1))))) +] + diff --git a/doc/help/ugen/delays/comb-c.help.scrbl b/doc/help/ugen/delays/comb-c.help.scrbl index 8873741..9e0134f 100644 --- a/doc/help/ugen/delays/comb-c.help.scrbl +++ b/doc/help/ugen/delays/comb-c.help.scrbl @@ -4,3 +4,4 @@ @title{See comb-n} + diff --git a/doc/help/ugen/delays/comb-l.help.scrbl b/doc/help/ugen/delays/comb-l.help.scrbl index 8873741..f1e3ffc 100644 --- a/doc/help/ugen/delays/comb-l.help.scrbl +++ b/doc/help/ugen/delays/comb-l.help.scrbl @@ -4,3 +4,5 @@ @title{See comb-n} + + diff --git a/doc/help/ugen/delays/comb-n.help.scrbl b/doc/help/ugen/delays/comb-n.help.scrbl index 12b97db..38f3651 100644 --- a/doc/help/ugen/delays/comb-n.help.scrbl +++ b/doc/help/ugen/delays/comb-n.help.scrbl @@ -16,22 +16,53 @@ lower. Comb used as a resonator. The resonant fundamental is equal to reciprocal of the delay time. -(define src (mul (white-noise ar) 0.01)) -(define ctl (x-line kr 0.0001 0.01 20 remove-synth)) -(define hear (lambda (u) (audition (out 0 u)))) +@racketblock[ +(define src (mul (white-noise ar) 0.01)) +] + +@racketblock[ +(define ctl (x-line kr 0.0001 0.01 20 remove-synth)) +] + +@racketblock[ +(define hear (lambda (u) (audition (out 0 u)))) +] + + +@racketblock[ (hear (comb-n src 0.01 ctl 0.2)) +] + +@racketblock[ (hear (comb-l src 0.01 ctl 0.2)) +] + +@racketblock[ (hear (comb-c src 0.01 ctl 0.2)) +] With negative feedback: + +@racketblock[ (hear (comb-n src 0.01 ctl -0.2)) +] + +@racketblock[ (hear (comb-l src 0.01 ctl -0.2)) +] + +@racketblock[ (hear (comb-c src 0.01 ctl -0.2)) +] Used as an echo. + +@racketblock[ (hear (comb-n (mul (decay (mul (dust ar 1) 0.5) 0.2) (white-noise ar)) 0.2 0.2 3)) +] + diff --git a/doc/help/ugen/delays/delay-c.help.scrbl b/doc/help/ugen/delays/delay-c.help.scrbl index 8f1f9a1..0b1f8a8 100644 --- a/doc/help/ugen/delays/delay-c.help.scrbl +++ b/doc/help/ugen/delays/delay-c.help.scrbl @@ -4,3 +4,4 @@ @title{See delay-n} + diff --git a/doc/help/ugen/delays/delay-l.help.scrbl b/doc/help/ugen/delays/delay-l.help.scrbl index 8f1f9a1..0b1f8a8 100644 --- a/doc/help/ugen/delays/delay-l.help.scrbl +++ b/doc/help/ugen/delays/delay-l.help.scrbl @@ -4,3 +4,4 @@ @title{See delay-n} + diff --git a/doc/help/ugen/delays/delay-n.help.scrbl b/doc/help/ugen/delays/delay-n.help.scrbl index ac39340..d2a53bd 100644 --- a/doc/help/ugen/delays/delay-n.help.scrbl +++ b/doc/help/ugen/delays/delay-n.help.scrbl @@ -14,8 +14,12 @@ time and cannot be extended. dust randomly triggers decay to create an exponential decay envelope for the white-noise input source. + +@racketblock[ (let ((z (mul (decay (dust ar 1) 0.3) (white-noise ar)))) (audition (out 0 (add (delay-n z 0.2 0.2) z)))) +] + diff --git a/doc/help/ugen/delays/delay1.help.scrbl b/doc/help/ugen/delays/delay1.help.scrbl index 2b78e43..22485b5 100644 --- a/doc/help/ugen/delays/delay1.help.scrbl +++ b/doc/help/ugen/delays/delay1.help.scrbl @@ -3,9 +3,14 @@ @title{(delay1 in)} + Fixed Single sample delay. + +@racketblock[ (let ((s (impulse ar 1 0))) (audition (out 0 (add s (delay1 s))))) +] + diff --git a/doc/help/ugen/delays/delay2.help.scrbl b/doc/help/ugen/delays/delay2.help.scrbl index a9fadb1..ada38c2 100644 --- a/doc/help/ugen/delays/delay2.help.scrbl +++ b/doc/help/ugen/delays/delay2.help.scrbl @@ -3,10 +3,15 @@ @title{(delay2 in)} + Fixed two sample delay. + +@racketblock[ (let ((s (impulse ar 1 0))) (audition (out 0 (add s (delay2 s))))) +] + diff --git a/doc/help/ugen/delays/free-verb.help.scrbl b/doc/help/ugen/delays/free-verb.help.scrbl index d657203..a3d43b6 100644 --- a/doc/help/ugen/delays/free-verb.help.scrbl +++ b/doc/help/ugen/delays/free-verb.help.scrbl @@ -12,6 +12,8 @@ in, in1, in2 - input signal room - room size (0,1) damp - reverb high frequency damping (0,1) + +@racketblock[ (let* ((i (impulse ar 1 0)) (c (lf-cub ar 1200 0)) (s (mul3 (decay i 0.25) c 0.1)) @@ -19,11 +21,16 @@ in, in1, in2 - input signal (y (mouse-y kr 0 1 0 0.1)) (r (free-verb s y x 0.5))) (audition (out 0 r))) +] + +@racketblock[ (let* ((i (sound-in (mce2 0 1))) (c (lambda (u n) (mce-channel u n))) (x (mouse-x kr 0 1 0 0.1)) (y (mouse-y kr 0 1 0 0.1)) (r (free-verb2 (c i 0) (c i 1) y x 0.5))) (audition (out 0 r))) +] + diff --git a/doc/help/ugen/delays/free-verb2.help.scrbl b/doc/help/ugen/delays/free-verb2.help.scrbl index 114573e..d21d20d 100644 --- a/doc/help/ugen/delays/free-verb2.help.scrbl +++ b/doc/help/ugen/delays/free-verb2.help.scrbl @@ -4,3 +4,4 @@ @title{See freeVerb} + diff --git a/doc/help/ugen/delays/pitch-shift.help.scrbl b/doc/help/ugen/delays/pitch-shift.help.scrbl index e3bee4e..9ae3d35 100644 --- a/doc/help/ugen/delays/pitch-shift.help.scrbl +++ b/doc/help/ugen/delays/pitch-shift.help.scrbl @@ -3,12 +3,17 @@ @title{(pitch-shift in winSize pchRatio pchDispersion timeDispersion)} + A simple time domain pitch shifter. + +@racketblock[ (audition (out 0 (pitch-shift (sin-osc ar 440 0) 0.2 (mouse-x kr 0.5 2 0 0.1) (mouse-y kr 0 0.1 0 0.1) 0))) +] + diff --git a/doc/help/ugen/delays/play-buf.help.scrbl b/doc/help/ugen/delays/play-buf.help.scrbl index c434809..a9b5769 100644 --- a/doc/help/ugen/delays/play-buf.help.scrbl +++ b/doc/help/ugen/delays/play-buf.help.scrbl @@ -3,6 +3,7 @@ @title{(play-buf numChannels bufnum rate trigger startPos loop)} + Sample playback oscillator. Plays back a memory resident sample. numChannels - number of channels that the buffer will be. This @@ -30,40 +31,65 @@ startPos - sample frame to start playback. loop - 1 means true, 0 means false. This is modulate-able. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)))) +] Play once only. + +@racketblock[ (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 0))) +] Play in infinite loop. + +@racketblock[ (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 1))) +] trigger playback at each pulse. + +@racketblock[ (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) (impulse kr 2 0) 0 0))) +] trigger playback at each pulse (diminishing intervals). + +@racketblock[ (let ((t (impulse kr (x-line kr 0.1 100 10 remove-synth) 0))) (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) t 0 0)))) +] Loop playback, accelerating pitch. + +@racketblock[ (let ((rate (x-line kr 0.1 100 60 remove-synth))) (audition (out 0 (play-buf 1 10 rate 1 0 1)))) +] Sine wave control of playback rate, negative rate plays backwards. + +@racketblock[ (let ((r (mul-add (f-sin-osc kr (x-line kr 0.2 8 30 remove-synth) 0) 3 0.6))) (audition (out 0 (play-buf 1 10 (mul (buf-rate-scale kr 10) r) 1 0 1)))) +] Release buffer. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-free 10)))) +] + diff --git a/doc/help/ugen/delays/pluck.help.scrbl b/doc/help/ugen/delays/pluck.help.scrbl index d72d6fc..6288671 100644 --- a/doc/help/ugen/delays/pluck.help.scrbl +++ b/doc/help/ugen/delays/pluck.help.scrbl @@ -3,6 +3,7 @@ @title{(pluck in tr maxdelaytime delaytime decaytime coef)} + Karplus-Strong synthesis. in - an excitation signal @@ -25,12 +26,17 @@ coef - the coef of the internal one-pole filter. Values should be Excitation signal is white-noise, triggered twice a second with varying one-pole coef. + +@racketblock[ (let ((n (mul (white-noise ar) 0.1)) (t (impulse kr 2 0)) (x (mouse-x kr -0.999 0.999 0 0.1)) (dl (/ 1 440))) (audition (out 0 (pluck n t dl dl 10 x)))) +] + +@racketblock[ (let* ((n 25) (gen (lambda (n f) (mce-fill n (lambda (_) (f))))) (f (gen n (lambda () (rand 0.05 0.2)))) @@ -42,4 +48,6 @@ varying one-pole coef. (ks (pluck w i 0.01 (fdiv 1 o) 2 (rand 0.01 0.2))) (l (gen n (lambda () (rand -1 1))))) (audition (out 0 (leak-dc (mix (pan2 ks l 1)) 0.995)))) +] + diff --git a/doc/help/ugen/delays/record-buf.help.scrbl b/doc/help/ugen/delays/record-buf.help.scrbl index 620b549..65cbc24 100644 --- a/doc/help/ugen/delays/record-buf.help.scrbl +++ b/doc/help/ugen/delays/record-buf.help.scrbl @@ -3,6 +3,7 @@ @title{(record-buf bufnum offset reclevel prelevel run loop trigger inputs)} + Records input into a Buffer. If recLevel is 1.0 and preLevel is 0.0 then the new input @@ -23,6 +24,8 @@ trigger - a trigger causes a jump to the start of the Buffer. A trigger occurs when a signal changes from <=0 to >0. inputArray - an Array of input channels + +@racketblock[ (with-sc3 (lambda (fd) (send-synth @@ -55,23 +58,49 @@ inputArray - an Array of input channels (gain 1)) (out 0 (mul (play-buf 2 bufnum rate trigger startPos loop) gain)))) (send fd (/s_new "player" z add-to-tail 1 "bufnum" b))))) +] + +@racketblock[ (define do-send (lambda (m) (with-sc3 (lambda (fd) (send fd m))))) +] + +@racketblock[ (do-send (/n_set 1001 "run" 1)) +] + +@racketblock[ (do-send (/n_set 1002 "loop" 1)) +] + +@racketblock[ (do-send (/n_set 1002 "gain" 2)) +] + +@racketblock[ (do-send (/n_set 1002 "trigger" 1)) +] + +@racketblock[ (do-send (/n_free 1001)) -(do-send (/n_free 1002)) +] +@racketblock[ +(do-send (/n_free 1002)) +] + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (/b_free 10)))) +] + diff --git a/doc/help/ugen/demand/dbrown.help.scrbl b/doc/help/ugen/demand/dbrown.help.scrbl index dca1f01..fb33434 100644 --- a/doc/help/ugen/demand/dbrown.help.scrbl +++ b/doc/help/ugen/demand/dbrown.help.scrbl @@ -16,10 +16,14 @@ dbrown returns numbers in the continuous range between lo and hi, dibrown returns integer values. The arguments can be a number or any other ugen. + +@racketblock[ (let ((f (lambda (u) (let* ((a (u dinf 0 15 1)) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (mul (sin-osc ar f 0) 0.1))))) (audition (out 0 (mce2 (f dbrown) (f dibrown))))) +] + diff --git a/doc/help/ugen/demand/dbufrd.help.scrbl b/doc/help/ugen/demand/dbufrd.help.scrbl index a12b5c5..82ea655 100644 --- a/doc/help/ugen/demand/dbufrd.help.scrbl +++ b/doc/help/ugen/demand/dbufrd.help.scrbl @@ -3,6 +3,7 @@ @title{(dbufrd bufnum phase loop)} + Buffer demand ugen. bufnum - buffer number to read from @@ -11,33 +12,49 @@ loop - loop when phase exceeds number of frames in buffer Example + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 24 1)) (send fd (b-setn1 10 0 (replicate-m 24 (exp-random 200 500)))))) +] + +@racketblock[ (let* ((q (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9)))) (p (dseq dinf (mce2 q (dbrown 5 0 23 1)))) (t (dust kr 10))) (audition (out 0 (mul (sin-osc ar (demand t 0 (dbufrd 10 p 1)) 0) 0.1)))) +] Buffer as a time pattern. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 11 24 1)) (send fd (b-setn1 11 0 (replicate-m 24 (choose (list 1 0.5 0.25))))))) +] + +@racketblock[ (let* ((p (dseq dinf (mce2 (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9))) (dbrown 5 0 23 1)))) (d (mul (dbufrd 11 (dseries dinf 0 1) 1) 0.5)) (l (dbufrd 10 p 1))) (audition (out 0 (mul (sin-osc ar (duty kr d 0 do-nothing l) 0) 0.1)))) +] free buffers + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-free 10)) (async fd (b-free 11)))) +] + diff --git a/doc/help/ugen/demand/demand-env-gen.help.scrbl b/doc/help/ugen/demand/demand-env-gen.help.scrbl index 63701be..5e92ce3 100644 --- a/doc/help/ugen/demand/demand-env-gen.help.scrbl +++ b/doc/help/ugen/demand/demand-env-gen.help.scrbl @@ -29,25 +29,35 @@ reset - if reset crosses from nonpositive to positive, the ugen Frequency envelope with random times. + +@racketblock[ (let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200)))) (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0)))) (y (mouse-y kr 0.01 3 1 0.1)) (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing))) (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.01)) 0) 0.1)))) +] Frequency modulation + +@racketblock[ (let* ((x (mouse-x kr -0.01 -4 0 0.1)) (y (mouse-y kr 1 3000 1 0.1)) (l (lambda () (dseq dinf (clone 32 (exp-rand 200 1000))))) (t (mul sample-dur y)) (f (demand-env-gen ar (mce2 (l) (l)) t 5 x 1 1 1 0 1 do-nothing))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] gate. Mouse x on right side of screen toggles gate. + +@racketblock[ (let* ((x (mouse-x kr 0 1 0 0.1)) (l (u:round (dwhite dinf 300 1000) 100)) (f (demand-env-gen kr l 0.1 5 0.3 (gt x 0.5) 1 1 0 1 do-nothing))) (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.21)) 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/demand.help.scrbl b/doc/help/ugen/demand/demand.help.scrbl index 8c08c21..91a2853 100644 --- a/doc/help/ugen/demand/demand.help.scrbl +++ b/doc/help/ugen/demand/demand.help.scrbl @@ -3,6 +3,7 @@ @title{(demand trig reset ugens)} + demand results from demand rate ugens. When there is a trigger at the trig input, a value is demanded from @@ -17,9 +18,14 @@ trig - trigger. trigger can be any signal. A trigger happens when reset - trigger. Resets the list of ugens when triggered. + +@racketblock[ (define (mirror1 l) (append l (cdr (reverse (cdr l))))) +] + +@racketblock[ (let* ((t (impulse kr 24 0)) (s (drand dinf (mce2 (dseq 1 (make-mce (mirror1 (enum-from-to 1 5)))) (drand 8 (make-mce (enum-from-to 4 11)))))) @@ -27,17 +33,25 @@ reset - trigger. Resets the list of ugens when triggered. (x (mouse-x kr -1 1 0 0.1)) (o (sin-osc ar (mce2 f (add f 0.7)) 0))) (audition (out 0 (mul (scale-neg (cubed (cubed o)) x) 0.1)))) +] + +@racketblock[ (let* ((t (impulse kr 10 0)) (r (dust kr 1)) (s (dgeom dinf (midi-cps 72) (midi-ratio 1))) (f (demand t r s)) (o (sin-osc ar (mce2 f (add f 0.7)) 0))) (audition (out 0 (mul (u:max (cubed o) 0) 0.1)))) +] + +@racketblock[ (let* ((t (impulse kr 10 0)) (s (midi-cps (diwhite dinf 60 72))) (f (demand t 0 s)) (o (sin-osc ar (mce2 f (add f 0.7)) 0))) (audition (out 0 (mul (cubed (cubed o)) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dgeom.help.scrbl b/doc/help/ugen/demand/dgeom.help.scrbl index 47ab2ef..ccae6e3 100644 --- a/doc/help/ugen/demand/dgeom.help.scrbl +++ b/doc/help/ugen/demand/dgeom.help.scrbl @@ -3,6 +3,7 @@ @title{(dgeom length start grow)} + demand rate geometric series ugen. start - start value @@ -11,23 +12,33 @@ length - number of values to create The arguments can be a number or any other ugen + +@racketblock[ (let* ((a (dgeom 15 1 1.2)) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] demand rate UGens are not shared... + +@racketblock[ (let* ((a (dgeom 15 1 1.2)) (t (impulse ar (mouse-x kr 1 40 1 0.1) 0)) (f0 (mul-add (demand (delay1 t) 0 a) 30 340)) (f1 (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1)))) +] + +@racketblock[ (let* ((a0 (dgeom 15 1 1.2)) (a1 (dgeom 15 1 1.2)) (t (impulse ar (mouse-x kr 1 40 1 0.1) 0)) (f0 (mul-add (demand (delay1 t) 0 a0) 30 340)) (f1 (mul-add (demand t 0 a1) 30 340))) (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dibrown.help.scrbl b/doc/help/ugen/demand/dibrown.help.scrbl index db29861..e7c1c8c 100644 --- a/doc/help/ugen/demand/dibrown.help.scrbl +++ b/doc/help/ugen/demand/dibrown.help.scrbl @@ -4,3 +4,4 @@ @title{See dbrown} + diff --git a/doc/help/ugen/demand/diwhite.help.scrbl b/doc/help/ugen/demand/diwhite.help.scrbl index 854de8f..39a1521 100644 --- a/doc/help/ugen/demand/diwhite.help.scrbl +++ b/doc/help/ugen/demand/diwhite.help.scrbl @@ -4,3 +4,4 @@ @title{See dwhite} + diff --git a/doc/help/ugen/demand/drand.help.scrbl b/doc/help/ugen/demand/drand.help.scrbl index 86127cc..feb1935 100644 --- a/doc/help/ugen/demand/drand.help.scrbl +++ b/doc/help/ugen/demand/drand.help.scrbl @@ -13,6 +13,8 @@ array - array of values or other ugens dxrand never plays the same value twice, whereas drand chooses any value in the list. + +@racketblock[ (let ((f (lambda (u) (let* ((a (u dinf (make-mce (list 1 3 2 7 8)))) (t (impulse kr (mouse-x kr 1 400 1 0.1) 0)) @@ -20,4 +22,6 @@ value in the list. (mul (sin-osc ar f 0) 0.1))))) (audition (out 0 (mce2 (f drand) (f dxrand))))) +] + diff --git a/doc/help/ugen/demand/dseq.help.scrbl b/doc/help/ugen/demand/dseq.help.scrbl index 9b634fe..5e4413c 100644 --- a/doc/help/ugen/demand/dseq.help.scrbl +++ b/doc/help/ugen/demand/dseq.help.scrbl @@ -3,18 +3,26 @@ @title{(dseq length array)} + demand rate sequence generator. array - array of values or other ugens length - number of repeats + +@racketblock[ (let* ((a (dseq 3 (make-mce (list 1 3 2 7 8)))) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let* ((a (dseq dinf (make-mce (replicate-m 32 (random 0 10))))) (t (impulse ar (mouse-x kr 1 10000 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dser.help.scrbl b/doc/help/ugen/demand/dser.help.scrbl index 85e7ae8..a6f8a69 100644 --- a/doc/help/ugen/demand/dser.help.scrbl +++ b/doc/help/ugen/demand/dser.help.scrbl @@ -3,14 +3,19 @@ @title{(dser length array)} + demand rate sequence generator. array - array of values or other ugens length - number of values to return + +@racketblock[ (let* ((a (dser dinf (make-mce (list 1 3 2 7 8)))) (x (mouse-x kr 1 40 1 0.1)) (t (impulse kr x 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dseries.help.scrbl b/doc/help/ugen/demand/dseries.help.scrbl index ed51412..43f4d64 100644 --- a/doc/help/ugen/demand/dseries.help.scrbl +++ b/doc/help/ugen/demand/dseries.help.scrbl @@ -3,6 +3,7 @@ @title{(dseries length start step)} + demand rate arithmetic series ugen. length - number of values to create @@ -11,8 +12,12 @@ step - step value The arguments can be a number or any other ugen + +@racketblock[ (let* ((a (dseries 15 0 1)) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dswitch.help.scrbl b/doc/help/ugen/demand/dswitch.help.scrbl index c4e11f7..679ba9a 100644 --- a/doc/help/ugen/demand/dswitch.help.scrbl +++ b/doc/help/ugen/demand/dswitch.help.scrbl @@ -3,6 +3,7 @@ @title{(dswitch index array)} + demand rate generator for switching between inputs index - which of the inputs to return @@ -12,6 +13,8 @@ In difference to dswitch1, dswitch embeds all items of an input demand ugen first before looking up the next index. + +@racketblock[ (let* ((a0 (dwhite 2 3 4)) (a1 (dwhite 2 0 1)) (a2 (dseq 2 (make-mce (list 1 1 1 0)))) @@ -21,9 +24,12 @@ next index. (f (mul-add (demand t 0 d) 300 400)) (o (mul (sin-osc ar f 0) 0.1))) (audition (out 0 o))) +] compare with dswitch1 + +@racketblock[ (let* ((a0 (dwhite 2 3 4)) (a1 (dwhite 2 0 1)) (a2 (dseq 2 (make-mce (list 1 1 1 0)))) @@ -33,4 +39,6 @@ compare with dswitch1 (f (mul-add (demand t 0 d) 300 400)) (o (mul (sin-osc ar f 0) 0.1))) (audition (out 0 o))) +] + diff --git a/doc/help/ugen/demand/dswitch1.help.scrbl b/doc/help/ugen/demand/dswitch1.help.scrbl index e24fade..95cce42 100644 --- a/doc/help/ugen/demand/dswitch1.help.scrbl +++ b/doc/help/ugen/demand/dswitch1.help.scrbl @@ -3,15 +3,20 @@ @title{(dswitch1 index array)} + demand rate generator for switching between inputs index - which of the inputs to return array - array of values or other ugens + +@racketblock[ (let* ((x (mouse-x kr 0 4 0 0.1)) (y (mouse-y kr 1 15 0 0.1)) (a (dswitch1 x (make-mce (list 1 3 y 2 (dwhite 2 0 3))))) (t (impulse kr 3 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/duty.help.scrbl b/doc/help/ugen/demand/duty.help.scrbl index ee00111..d09815e 100644 --- a/doc/help/ugen/demand/duty.help.scrbl +++ b/doc/help/ugen/demand/duty.help.scrbl @@ -3,6 +3,7 @@ @title{(duty rate duration reset doneAction level)} + demand results from demand rate ugens A value is demanded from each ugen in the list and output according @@ -25,6 +26,8 @@ ends. level: demand ugen providing the output values. + +@racketblock[ (let* ((f (duty kr (drand dinf (mce3 0.01 0.2 0.4)) 0 @@ -32,7 +35,10 @@ level: demand ugen providing the output values. (dseq dinf (make-mce (list 204 400 201 502 300 200))))) (o (sin-osc ar (mul f (mce2 1 1.01)) 0))) (audition (out 0 (mul o 0.1)))) +] + +@racketblock[ (let* ((f (duty kr (mouse-x kr 0.001 2 1 0.1) 0 @@ -40,4 +46,6 @@ level: demand ugen providing the output values. (dseq dinf (make-mce (list 204 400 201 502 300 200))))) (o (sin-osc ar (mul f (mce2 1 1.0)) 0))) (audition (out 0 (mul o 0.1)))) +] + diff --git a/doc/help/ugen/demand/dwhite.help.scrbl b/doc/help/ugen/demand/dwhite.help.scrbl index e20de23..a3803ba 100644 --- a/doc/help/ugen/demand/dwhite.help.scrbl +++ b/doc/help/ugen/demand/dwhite.help.scrbl @@ -15,13 +15,20 @@ dwhite returns numbers in the continuous range between lo and hi, diwhite returns integer values. The arguments can be a number or any other ugen + +@racketblock[ (let* ((a (dwhite dinf 0 15)) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let* ((a (diwhite dinf 0 15)) (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) (f (mul-add (demand t 0 a) 30 340))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/demand/dxrand.help.scrbl b/doc/help/ugen/demand/dxrand.help.scrbl index 0d3c054..607d555 100644 --- a/doc/help/ugen/demand/dxrand.help.scrbl +++ b/doc/help/ugen/demand/dxrand.help.scrbl @@ -4,3 +4,4 @@ @title{See drand} + diff --git a/doc/help/ugen/demand/t-duty.help.scrbl b/doc/help/ugen/demand/t-duty.help.scrbl index 5ddc183..ab3cf03 100644 --- a/doc/help/ugen/demand/t-duty.help.scrbl +++ b/doc/help/ugen/demand/t-duty.help.scrbl @@ -3,6 +3,7 @@ @title{(t-duty rate duration reset doneAction level gap)} + demand results as trigger from demand rate ugens. A value is demanded each ugen in the list and output as a trigger @@ -31,11 +32,16 @@ level - demand ugen providing the output values. Play a little rhythm + +@racketblock[ (let ((s (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3))))) (audition (out 0 (t-duty ar s 0 0 1 0)))) +] Amplitude changes + +@racketblock[ (let ((t (t-duty ar (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3))) 0 @@ -43,7 +49,10 @@ Amplitude changes (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0))) 0))) (audition (out 0 (ringz t 1000 0.1)))) +] + +@racketblock[ (let ((t (t-duty ar (mouse-x kr 0.001 2 1 0.1) 0 @@ -51,4 +60,6 @@ Amplitude changes (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0))) 0))) (audition (out 0 (ringz t 1000 0.1)))) +] + diff --git a/doc/help/ugen/disk-io/disk-in.help.scrbl b/doc/help/ugen/disk-io/disk-in.help.scrbl index f1b05ed..432b909 100644 --- a/doc/help/ugen/disk-io/disk-in.help.scrbl +++ b/doc/help/ugen/disk-io/disk-in.help.scrbl @@ -3,6 +3,7 @@ @title{(disk-in num-channels rate bufnum)} + Continously play a soundfile from disk. This requires a buffer to be preloaded with one buffer size of sound. The buffer size must be a multiple of twice the synth block size. The default block size @@ -12,6 +13,8 @@ Note that disk-in reads the number of outputs to create from what looks like an input, but it is not an input, and cannot be set using a control. + +@racketblock[ (let ((f "/home/rohan/audio/metal.wav") (n 1)) (with-sc3 @@ -19,11 +22,19 @@ using a control. (async fd (b-alloc 0 8192 n)) (async fd (b-read 0 f 0 -1 0 1)) (play fd (out 0 (disk-in n ar 0)))))) +] + +@racketblock[ (with-sc3 reset) +] + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-close 0)) (async fd (b-free 0)))) +] + diff --git a/doc/help/ugen/disk-io/disk-out.help.scrbl b/doc/help/ugen/disk-io/disk-out.help.scrbl index 1133553..3298c40 100644 --- a/doc/help/ugen/disk-io/disk-out.help.scrbl +++ b/doc/help/ugen/disk-io/disk-out.help.scrbl @@ -3,16 +3,22 @@ @title{(disk-out bufnum channels)} + Note: There are constraints on the size of the buffer, it must be greater than or equal to twice the size of the audio bus. There must be the same number of channels at the buffer and the disk-out ugen. + +@racketblock[ (let ((bus-size 1024) (bufferexpt 15)) (= 0 (fxand (expt 2 bufferexpt) (- (fxarithmetic-shift bus-size 1) 1)))) +] + +@racketblock[ (let ((g (letc ((bufnum 0)) (let ((z (clip2 (rlpf @@ -37,13 +43,24 @@ ugen. 0 1)) (send fd (s-new1 "disk-out-help" 1001 1 1 "bufnum" 10))))) +] + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-free1 1001)) (async fd (b-close 10)) (async fd (b-free 10)))) +] + +@racketblock[ (system "sndfile-info /tmp/test.aiff") -(system "jack.play /tmp/test.aiff") +] + +@racketblock[ +(system "jack.play /tmp/test.aiff") +] + diff --git a/doc/help/ugen/envelopes/detect-silence.help.scrbl b/doc/help/ugen/envelopes/detect-silence.help.scrbl index c0dcfed..7ad2e46 100644 --- a/doc/help/ugen/envelopes/detect-silence.help.scrbl +++ b/doc/help/ugen/envelopes/detect-silence.help.scrbl @@ -3,12 +3,20 @@ @title{(detect-silence in amp time doneAction)} + If the signal at `in' falls below `amp' for `time' seconds then `doneAction' is raised. + +@racketblock[ (let ((s (mul (sin-osc ar 440 0) (mouse-y kr 0 0.4 0 0.1)))) (audition (mrg2 (detect-silence s 0.1 0.2 remove-synth) (out 0 s)))) +] + +@racketblock[ (with-sc3 display-server-status) +] + diff --git a/doc/help/ugen/envelopes/done.help.scrbl b/doc/help/ugen/envelopes/done.help.scrbl index cf6d6c0..c1df742 100644 --- a/doc/help/ugen/envelopes/done.help.scrbl +++ b/doc/help/ugen/envelopes/done.help.scrbl @@ -3,13 +3,18 @@ @title{(done src)} + outputs a unit signal if the 'done' flag of the unit at `src' is set, else output zero. + +@racketblock[ (let* ((x (mouse-x kr -1 1 0 0.1)) (e (linen x 0.1 0.1 0.5 do-nothing)) (l (mul (sin-osc ar 880 0) 0.1)) (r (sin-osc ar 440 0))) (audition (out 0 (mce2 (mul (done e) l) (mul e r))))) +] + diff --git a/doc/help/ugen/envelopes/env-gen.help.scrbl b/doc/help/ugen/envelopes/env-gen.help.scrbl index cc01c2a..8ced683 100644 --- a/doc/help/ugen/envelopes/env-gen.help.scrbl +++ b/doc/help/ugen/envelopes/env-gen.help.scrbl @@ -3,6 +3,7 @@ @title{(env-gen rate gate levelScale levelBias timeScale doneAction envelope)} + A segment based envelope generator. Note that the SC3 language reorders the inputs to this UGen so that the envelope is the first argument. @@ -31,27 +32,43 @@ doneAction - an integer representing an action to be executed when the env is finished playing. This can be used to free the enclosing synth, etc. + +@racketblock[ (import (rhs) (rsc3)) +] Percussive envelope + +@racketblock[ (let* ((d (env-perc 0.01 1 1 (list -4 -4))) (e (env-gen kr 1 0.1 0 1 remove-synth d))) (audition (out 0 (mul e (sin-osc ar 440 0))))) +] The break-point assistant makes a static envelope from a co-ordinate list. There is a duration and amplitude scalar. + +@racketblock[ (let* ((d (env-coord (list (cons 0 0) (cons 0.75 1) (cons 1 0)) 1 1 (replicate 3 "linear"))) (e (env-gen kr 1 0.1 0 1 remove-synth d))) (audition (out 0 (mul e (sin-osc ar 440 0))))) +] Trapezoidal + +@racketblock[ (let* ((d (env-trapezoid 0 0.25 2 0.1)) (e (env-gen kr 1 0.1 0 1 remove-synth d))) (audition (out 0 (mul e (sin-osc ar 440 0))))) +] 0.0 3 -1 -1 0.1 0.5 1.0 0.0 0.1 0.0 1.0 0.0 0.0 1.5 1.0 0.0 -(env-trapezoid 0 0.25 2 0.1) + +@racketblock[ +(env-trapezoid 0 0.25 2 0.1) +] + diff --git a/doc/help/ugen/envelopes/free-self-when-done.help.scrbl b/doc/help/ugen/envelopes/free-self-when-done.help.scrbl index 3d20c5e..705770e 100644 --- a/doc/help/ugen/envelopes/free-self-when-done.help.scrbl +++ b/doc/help/ugen/envelopes/free-self-when-done.help.scrbl @@ -3,14 +3,22 @@ @title{(free-self-when-done src)} + free the synth when the 'done' flag of the unit at `src' is set. + +@racketblock[ (let* ((x (mouse-x kr -1 1 0 0.1)) (e (linen x 1 0.1 1 remove-synth))) (audition (out 0 (mul (sin-osc ar 440 0) e)))) +] + +@racketblock[ (let* ((x (mouse-x kr -1 1 0 0.1)) (e (linen x 2 0.1 2 do-nothing))) (audition (mrg2 (free-self-when-done e) (out 0 (mul (sin-osc ar 440 0) e))))) +] + diff --git a/doc/help/ugen/envelopes/free-self.help.scrbl b/doc/help/ugen/envelopes/free-self.help.scrbl index 99e37f3..6b4436b 100644 --- a/doc/help/ugen/envelopes/free-self.help.scrbl +++ b/doc/help/ugen/envelopes/free-self.help.scrbl @@ -3,10 +3,15 @@ @title{(free-self src)} + free enclosing synth when the input signal `src' crosses from non-positive to positive. + +@racketblock[ (audition (mrg2 (free-self (mouse-x kr -1 1 0 0.1)) (out 0 (mul (sin-osc ar 440 0) 0.1)))) +] + diff --git a/doc/help/ugen/envelopes/free.help.scrbl b/doc/help/ugen/envelopes/free.help.scrbl index dc66636..ff7cebb 100644 --- a/doc/help/ugen/envelopes/free.help.scrbl +++ b/doc/help/ugen/envelopes/free.help.scrbl @@ -3,11 +3,14 @@ @title{(free trig nodeID)} + When triggered frees a node. trig - when triggered, frees node nodeID - node to be freed + +@racketblock[ (with-sc3 (lambda (fd) (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1))) @@ -15,6 +18,11 @@ nodeID - node to be freed (free (dust ar 6) 1001))) (send fd (s-new0 "a" 1001 0 0)) (send fd (s-new0 "b" -1 0 0)))) +] + +@racketblock[ (with-sc3 reset) +] + diff --git a/doc/help/ugen/envelopes/line.help.scrbl b/doc/help/ugen/envelopes/line.help.scrbl index bd16f2d..95a4390 100644 --- a/doc/help/ugen/envelopes/line.help.scrbl +++ b/doc/help/ugen/envelopes/line.help.scrbl @@ -3,6 +3,7 @@ @title{(line rate start end dur doneAction)} + Generates a line from the start value to the end value. start - starting value @@ -12,6 +13,10 @@ dur - duration in seconds Note: The SC3 UGen reorders the mul and add inputs to precede the doneAction input. + +@racketblock[ (let ((f (line kr 200 17000 5 remove-synth))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/envelopes/linen.help.scrbl b/doc/help/ugen/envelopes/linen.help.scrbl index 3dbb695..87e91ed 100644 --- a/doc/help/ugen/envelopes/linen.help.scrbl +++ b/doc/help/ugen/envelopes/linen.help.scrbl @@ -3,23 +3,32 @@ @title{(linen gate attackTime susLevel releaseTime doneAction)} + A linear envelope generator. The done flag is set when the envelope reaches zero. Note that the sustain level input is consulted only at the instant when the gate is opened. + +@racketblock[ (let ((e (linen (impulse kr 2 0) 0.01 0.1 0.4 do-nothing))) (audition (out 0 (mul (sin-osc ar 440 0) e)))) +] + +@racketblock[ (let* ((y (mouse-y kr 0.1 0.5 0 0.1)) (x (mouse-x kr -1 1 0 0.1)) (e (linen x 1 y 1.0 do-nothing)) (o (sin-osc ar 440 0))) (audition (out 0 (mul o e)))) +] Open gate for a random interval. + +@racketblock[ (let* ((r (rand 0.05 0.4)) (u (letc ((gate 0)) (let ((e (linen gate 0.1 0.2 0.1 do-nothing))) @@ -34,4 +43,6 @@ Open gate for a random interval. (n-set1 1001 "gate" 0))) (sleep (* r 4)) (send fd (n-free1 1001))))) +] + diff --git a/doc/help/ugen/envelopes/pause-self-when-done.help.scrbl b/doc/help/ugen/envelopes/pause-self-when-done.help.scrbl index 4dedbbf..adbd33c 100644 --- a/doc/help/ugen/envelopes/pause-self-when-done.help.scrbl +++ b/doc/help/ugen/envelopes/pause-self-when-done.help.scrbl @@ -3,14 +3,22 @@ @title{(pause-self-when-done src)} + pause the synth when the 'done' flag of the unit at `src' is set. + +@racketblock[ (let* ((x (mouse-x kr -1 1 0 0.1)) (e (linen x 1 0.1 1 pause-synth))) (audition (out 0 (mul (sin-osc ar 440 0) e)))) +] + +@racketblock[ (let* ((x (mouse-x kr -1 1 0 0.1)) (e (linen x 2 0.1 2 do-nothing))) (audition (mrg2 (pause-self-when-done e) (out 0 (mul (sin-osc ar 440 0) e))))) +] + diff --git a/doc/help/ugen/envelopes/pause-self.help.scrbl b/doc/help/ugen/envelopes/pause-self.help.scrbl index bc03359..a58bd9d 100644 --- a/doc/help/ugen/envelopes/pause-self.help.scrbl +++ b/doc/help/ugen/envelopes/pause-self.help.scrbl @@ -3,11 +3,16 @@ @title{(pause-self src)} + pause enclosing synth when input signal crosses from non-positive to positive. If the synth is restarted and the gate reset the synthesis *not* paused a second time. + +@racketblock[ (audition (mrg2 (pause-self (mouse-x kr -1 1 0 0.1)) (out 0 (mul (sin-osc ar 440 0) 0.1)))) +] + diff --git a/doc/help/ugen/envelopes/pause.help.scrbl b/doc/help/ugen/envelopes/pause.help.scrbl index b1905dd..deddd44 100644 --- a/doc/help/ugen/envelopes/pause.help.scrbl +++ b/doc/help/ugen/envelopes/pause.help.scrbl @@ -3,11 +3,14 @@ @title{(pause gate nodeID)} + When triggered pauses a node. gate - when gate is 0, node is paused, when 1 it runs nodeID - node to be paused + +@racketblock[ (with-sc3 (lambda (fd) (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1))) @@ -22,4 +25,6 @@ nodeID - node to be paused (send fd (/n_set 1002 "g" 1)) (sleep 1) (reset fd))) +] + diff --git a/doc/help/ugen/envelopes/x-line.help.scrbl b/doc/help/ugen/envelopes/x-line.help.scrbl index 30cd9c1..9936a8c 100644 --- a/doc/help/ugen/envelopes/x-line.help.scrbl +++ b/doc/help/ugen/envelopes/x-line.help.scrbl @@ -3,6 +3,7 @@ @title{(x-line rate start end dur doneAction)} + Exponential line generator. Generates an exponential curve from the start value to the end value. Both the start and end values must be non-zero and have the same sign. @@ -13,6 +14,10 @@ dur - duration in seconds doneAction - a doneAction to be evaluated when the x-line is completed. See env-gen for details. + +@racketblock[ (let ((f (x-line kr 200 17000 10 remove-synth))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/fft/convolution.help.scrbl b/doc/help/ugen/fft/convolution.help.scrbl index 610f9fd..ec3b862 100644 --- a/doc/help/ugen/fft/convolution.help.scrbl +++ b/doc/help/ugen/fft/convolution.help.scrbl @@ -3,6 +3,7 @@ @title{(convolution in kernel framesize)} + Strict convolution of two continuously changing inputs. Also see [convolution2] for a cheaper CPU cost alternative for the case of a fixed kernel which can be changed with a trigger message. @@ -11,11 +12,16 @@ in - processing target kernel - processing kernel. framesize - size of fft frame, must be a power of two + +@racketblock[ (audition (let ((input (sound-in (mce2 0 1))) (kernel (white-noise ar))) (out 0 (mul (convolution input kernel 2048) 0.1)))) +] + +@racketblock[ (let ((a 2048) (b 0)) (with-sc3 @@ -28,4 +34,6 @@ framesize - size of fft frame, must be a power of two (play-buf 1 b (buf-rate-scale kr b) 1 0 1) (* 2 a)) 0.2)))))) +] + diff --git a/doc/help/ugen/fft/convolution2.help.scrbl b/doc/help/ugen/fft/convolution2.help.scrbl index 312a83f..d2edf80 100644 --- a/doc/help/ugen/fft/convolution2.help.scrbl +++ b/doc/help/ugen/fft/convolution2.help.scrbl @@ -1,9 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{(convolution2 in bufnum trigger framesize) +@title{(convolution2 in bufnum trigger framesize)} + + -#| Strict convolution with fixed kernel which can be updated using a trigger signal. @@ -18,8 +19,11 @@ framesize - size of fft frame, must be a power of two. convolution progressively more expensive to run for higher powers! 512, 1024, 2048, 4096 standard. -|# + + + +@racketblock[ (with-sc3 (lambda (fd) (for-each @@ -43,43 +47,90 @@ framesize - size of fft frame, must be a power of two. convolution (letc ((k 0) (t 0)) (let ((i (impulse ar 1 0))) (out 0 (mul (convolution2 i k t 2048) 0.5))))))) +] + +@racketblock[ (define send-to (lambda (m) (with-sc3 (lambda (fd) (send fd m))))) +] + +@racketblock[ (define async-to (lambda (m) (with-sc3 (lambda (fd) (async fd m))))) +] + +@racketblock[ (send-to (s-new1 "c" 1001 1 1 "k" 10)) +] + +@racketblock[ (send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) +] +@racketblock[ +(send-to (n-set1 1001 "t" 0)) +] + +@racketblock[ +(send-to (n-set1 1001 "t" 1)) +] + + +@racketblock[ (send-to (n-set1 1001 "k" 12)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 0)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 1)) +] + +@racketblock[ (async-to (b-zero 12)) +] + +@racketblock[ (for-each (lambda (n) (send-to (b-set1 12 (+ (* 20 n) 10) 1))) (enum-from-to 0 39)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))} +] + +@racketblock[ +(send-to (n-set1 1001 "t" 1)) +] With soundfile. -(async-to (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)) +@racketblock[ +(async-to (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)) +] + + +@racketblock[ (let ((i (sound-in 0))) (audition (out 0 (mul (convolution2 i 10 0 512) 0.5)))) +] + diff --git a/doc/help/ugen/fft/fft.help.scrbl b/doc/help/ugen/fft/fft.help.scrbl index ffffc8e..5dcd7e8 100644 --- a/doc/help/ugen/fft/fft.help.scrbl +++ b/doc/help/ugen/fft/fft.help.scrbl @@ -15,16 +15,26 @@ extensions, since only a single rate is valid for each UGen class. The fft and PV_ UGens must run at control rate, the ifft UGen at audio rate. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let* ((s (mul (white-noise ar) 0.05)) (c (fft* 10 s))) (audition (out 0 (ifft* c)))) +] + +@racketblock[ (let* ((f1 (Squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) (f2 (mul-add (sin-osc kr f1 0) 100 800)) (s (sin-osc ar f2 0))) (audition (out 0 (ifft* (fft* 10 s))))) +] + diff --git a/doc/help/ugen/fft/ifft.help.scrbl b/doc/help/ugen/fft/ifft.help.scrbl index 219abd7..8170ee7 100644 --- a/doc/help/ugen/fft/ifft.help.scrbl +++ b/doc/help/ugen/fft/ifft.help.scrbl @@ -8,11 +8,18 @@ inverse Fast Fourier Transform. The inverse fast fourier transform converts from frequency content to a signal. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 2048 1)))) +] + +@racketblock[ (let* ((s (mul (white-noise ar) 0.05)) (c (fft 0 s 0.5 0 1))) (audition (out 0 (Ifft c 0)))) +] + diff --git a/doc/help/ugen/fft/pack-fft.help.scrbl b/doc/help/ugen/fft/pack-fft.help.scrbl index 86fb04d..5e8fd3a 100644 --- a/doc/help/ugen/fft/pack-fft.help.scrbl +++ b/doc/help/ugen/fft/pack-fft.help.scrbl @@ -3,6 +3,7 @@ @title{(Packfft chain bufsize frombin tobin zeroothers magsphases)} + Pack separate demand-rate fft bin streams into an fft chain buffer Takes a length-prefixed array of magnitudes and phases, and packs @@ -34,10 +35,15 @@ pvcalc2. Here's an unusual example which uses Packfft without using Unpackfft first - essentially creating our fft data from scratch. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (b-alloc 10 512 1)))) +] + +@racketblock[ (let* ((n 100) (n* (enum-from-to 1 n)) (m1 (map (lambda (_) (range (f-sin-osc kr (exp-rand 0.1 1) 0) 0 1)) n*)) @@ -50,4 +56,6 @@ Unpackfft first - essentially creating our fft data from scratch. (c2 (pack-fft c1 512 0 (- n 1) 1 (packfft-data m3 p))) (s (ifft* c2))) (audition (out 0 (mce2 s s)))) +] + diff --git a/doc/help/ugen/fft/pv-add.help.scrbl b/doc/help/ugen/fft/pv-add.help.scrbl index 6d1e7b8..f71dc35 100644 --- a/doc/help/ugen/fft/pv-add.help.scrbl +++ b/doc/help/ugen/fft/pv-add.help.scrbl @@ -3,22 +3,33 @@ @title{(pv-add bufferA bufferB)} + Complex addition: RealA + RealB, ImagA + ImagB + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc 11 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (g (fft* 11 (mul (sin-osc ar 440 0) 0.2))) (h (pv-add f g))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + +@racketblock[ (audition (out 0 (mul (add (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1) (mul (sin-osc ar 440 0) 0.2)) 0.5))) +] + diff --git a/doc/help/ugen/fft/pv-bin-scramble.help.scrbl b/doc/help/ugen/fft/pv-bin-scramble.help.scrbl index 4a24ede..b41ed84 100644 --- a/doc/help/ugen/fft/pv-bin-scramble.help.scrbl +++ b/doc/help/ugen/fft/pv-bin-scramble.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-bin-scramble buffer wipe width trig)} + randomizes the order of the bins. The trigger will select a new random ordering. @@ -12,11 +13,16 @@ width - a value from zero to one, indicating the maximum randomized distance of a bin from its original location in the spectrum. trig - a trigger selects a new random ordering. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) (f (fft* 10 a)) (g (pv-bin-scramble f @@ -25,8 +31,11 @@ trig - a trigger selects a new random ordering. (impulse kr 4 0))) (h (ifft* g))) (audition (out 0 (mul 0.5 (mce2 h h))))) +] careful - reads adc! + +@racketblock[ (let* ((a (mul (sound-in (mce2 0 1)) 4.0)) (f (fft* 10 a)) (g (pv-bin-scramble f @@ -35,4 +44,6 @@ careful - reads adc! (impulse kr (mul-add (lf-noise0 kr 2) 8 10) 0))) (h (ifft* g))) (audition (out 0 (pan2 h 0 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-bin-shift.help.scrbl b/doc/help/ugen/fft/pv-bin-shift.help.scrbl index 0b9c166..6e36817 100644 --- a/doc/help/ugen/fft/pv-bin-shift.help.scrbl +++ b/doc/help/ugen/fft/pv-bin-shift.help.scrbl @@ -3,22 +3,34 @@ @title{(pv-bin-shift buffer stretch shift)} + Shift and scale the positions of the bins. Can be used as a very crude frequency shifter/scaler. Shifts the leftmost bin at `buffer' by `shift' places, the distance between subsequent bins is `stretch'. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (define snd (let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) (f2 (sin-osc kr f1 0))) (sin-osc ar (mul-add f2 100 800) 0))) +] + +@racketblock[ (audition (out 0 snd)) +] + +@racketblock[ (audition (out 0 (mul (ifft* @@ -27,4 +39,6 @@ crude frequency shifter/scaler. Shifts the leftmost bin at (mouse-y kr 1 4 0 0.1) (mouse-x kr -10 100 0 0.1))) 1/2))) +] + diff --git a/doc/help/ugen/fft/pv-bin-wipe.help.scrbl b/doc/help/ugen/fft/pv-bin-wipe.help.scrbl index d71d6a1..c4db6a5 100644 --- a/doc/help/ugen/fft/pv-bin-wipe.help.scrbl +++ b/doc/help/ugen/fft/pv-bin-wipe.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-bin-wipe bufferA bufferB wipe)} + Combine low and high bins from two inputs Copies low bins from one input and the high bins of the other. @@ -15,23 +16,33 @@ if wipe == 0 then the output is the same as inA. if wipe > 0 then it begins replacing with bins from inB from the bottom up. if wipe < 0 then it begins replacing with bins from inB from the top down. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc 11 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (mul (white-noise ar) 0.2)) (b (mul (sin-osc ar 100 0) 0.2)) (f (fft* 10 a)) (g (fft* 11 b)) (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1)))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + +@racketblock[ (let* ((a (mul (white-noise ar) 0.2)) (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (g (fft* 11 b)) (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1)))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-brick-wall.help.scrbl b/doc/help/ugen/fft/pv-brick-wall.help.scrbl index 991b32a..853f4be 100644 --- a/doc/help/ugen/fft/pv-brick-wall.help.scrbl +++ b/doc/help/ugen/fft/pv-brick-wall.help.scrbl @@ -3,15 +3,23 @@ @title{(pv-brick-wall buffer wipe)} + Clears bins above or below a cutoff point. `wipe' = a unit signal, from -1 to 0 the UGen acts as a low-pass filter, from 0 to 1 it acts as a high pass filter. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let ((x (mouse-x kr -1 1 0 0.1)) (c (fft* 10 (mul (white-noise ar) 0.2)))) (audition (out 0 (ifft* (pv-brick-wall c x))))) +] + diff --git a/doc/help/ugen/fft/pv-conformal-map.help.scrbl b/doc/help/ugen/fft/pv-conformal-map.help.scrbl index b9daf47..0fe1425 100644 --- a/doc/help/ugen/fft/pv-conformal-map.help.scrbl +++ b/doc/help/ugen/fft/pv-conformal-map.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-conformal-map buffer real imag)} + Applies the conformal mapping z send (z-a)/(1-za*) to the phase vocoder bins z with a given by the real and imag imputs to the UGen. @@ -13,11 +14,16 @@ buffer - buffer number of buffer to act on, passed in through a chain real - real part of a. imag - imaginary part of a. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 1024 1)) (async fd (b-alloc 0 2048 1)))) +] + +@racketblock[ (audition (out 0 (pan2 (ifft* @@ -26,7 +32,10 @@ imag - imaginary part of a. (mouse-y kr -1 1 0 0.1))) 0 1))) +] + +@racketblock[ (let* ((signal (lambda (n) (let* ((o (sin-osc kr (mix-fill n (lambda (_) (rand 0.1 0.5))) 0)) (a (mul (make-mce (list 1 1.1 1.5 1.78 2.45 6.7)) 220)) @@ -41,4 +50,6 @@ imag - imaginary part of a. (s (mapped 3)) (t (mul-add (comb-n s 0.1 0.1 10) 0.5 s))) (audition (out 0 (pan2 t 0 1)))) +] + diff --git a/doc/help/ugen/fft/pv-copy-phase.help.scrbl b/doc/help/ugen/fft/pv-copy-phase.help.scrbl index e8e8d6b..277e42f 100644 --- a/doc/help/ugen/fft/pv-copy-phase.help.scrbl +++ b/doc/help/ugen/fft/pv-copy-phase.help.scrbl @@ -3,25 +3,36 @@ @title{(pv-copyPhase bufferA bufferB)} + Combines magnitudes of first input and phases of the second input. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc 11 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (mul (white-noise ar) 0.2)) (b (mul (sin-osc ar 100 0) 0.2)) (f (fft* 10 a)) (g (fft* 11 b)) (h (pv-copy-phase f g))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + +@racketblock[ (let* ((a (mul (white-noise ar) 0.2)) (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (g (fft* 11 b)) (h (pv-copy-phase f g))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-copy.help.scrbl b/doc/help/ugen/fft/pv-copy.help.scrbl index 5f6e1f9..76e7c35 100644 --- a/doc/help/ugen/fft/pv-copy.help.scrbl +++ b/doc/help/ugen/fft/pv-copy.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-copy bufferA bufferB)} + Copies the spectral frame in bufferA to bufferB at that point in the chain of PV UGens. This allows for parallel processing of spectral data without the need for multiple fft UGens, and to copy @@ -12,15 +13,22 @@ bufferB must be the same size. bufferA - source buffer. bufferB - destination buffer. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 2048 1)) (async fd (b-alloc 1 2048 1)))) +] Proof of concept, silence + +@racketblock[ (let* ((in (lfclip-noise ar 100)) (c0 (fft* 0 in)) (c1 (pv-copy c0 1))) (audition (out 0 (sub (ifft* c0) (ifft* c1))))) +] + diff --git a/doc/help/ugen/fft/pv-diffuser.help.scrbl b/doc/help/ugen/fft/pv-diffuser.help.scrbl index 7c74bab..9e3849e 100644 --- a/doc/help/ugen/fft/pv-diffuser.help.scrbl +++ b/doc/help/ugen/fft/pv-diffuser.help.scrbl @@ -3,19 +3,27 @@ @title{(pv-diffuser buffer trig)} + adds a different constant random phase shift to each bin. The trigger will select a new set of random phases. buffer - fft buffer. trig - a trigger selects a new set of random values. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (h (pv-diffuser f (gt (mouse-x kr 0 1 0 0.1) 0.5)))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-hainsworth-foote.help.scrbl b/doc/help/ugen/fft/pv-hainsworth-foote.help.scrbl index abe3311..a0c1029 100644 --- a/doc/help/ugen/fft/pv-hainsworth-foote.help.scrbl +++ b/doc/help/ugen/fft/pv-hainsworth-foote.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-hainsworth-foote buffer proph propf threshold waittime)} + fft onset detector based on work described in Hainsworth, S. (2003) Techniques for the Automated Analysis of @@ -38,10 +39,15 @@ waittime=0.04. Just Hainsworth metric with low threshold + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 2048 1)))) +] + +@racketblock[ (let* ((source (sound-in 0)) (detect (pv-hainsworth-foote (fft* 0 source) 1.0 @@ -52,9 +58,12 @@ Just Hainsworth metric with low threshold (out 0 (mul3 (sin-osc ar (mce2 440 445) 0) (decay (mul 0.1 detect) 0.1) 0.1)))) +] Just Hainsworth metric, spot note transitions. + +@racketblock[ (let* ((src (mul (lf-saw ar (mul-add (lf-noise0 kr 1) 90 400) 0) 0.5)) (dtc (pv-hainsworth-foote (fft* 0 src) 1.0 @@ -65,10 +74,13 @@ Just Hainsworth metric, spot note transitions. (decay (mul 0.1 dtc) 0.1)))) (audition (out 0 (mul (mce2 src cmp) 0.1)))) +] Just Foote metric. Foote never triggers with threshold over 1.0, threshold under mouse control. + +@racketblock[ (let* ((src (sound-in 0)) (dtc (pv-hainsworth-foote (fft* 0 src) 0.0 @@ -79,5 +91,7 @@ threshold under mouse control. (decay (mul 0.1 dtc) 0.1)))) (audition (out 0 (mul (mce2 src cmp) 0.1)))) +] + diff --git a/doc/help/ugen/fft/pv-jensen-anderson.help.scrbl b/doc/help/ugen/fft/pv-jensen-anderson.help.scrbl index 9dde8a4..77bd80a 100644 --- a/doc/help/ugen/fft/pv-jensen-anderson.help.scrbl +++ b/doc/help/ugen/fft/pv-jensen-anderson.help.scrbl @@ -1,9 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{(pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) +@title{(pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)} + + -#| fft feature detector for onset detection based on work described in Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using @@ -27,12 +28,18 @@ waittime - If triggered, minimum wait until a further frame can Default values in sclang are: propsc=0.25, prophfe=0.25, prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. -|# + + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 2048 1)))) +] + +@racketblock[ (let* ((source (sound-in 0)) (detect (pv-jensen-andersen (fft* 0 source) 0.25 0.25 0.25 0.25 @@ -40,6 +47,7 @@ prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. 0.04))) (audition (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))} + (decay (mul 0.1 detect) 0.1))))) +] diff --git a/doc/help/ugen/fft/pv-local-max.help.scrbl b/doc/help/ugen/fft/pv-local-max.help.scrbl index 9c747d0..8f9257a 100644 --- a/doc/help/ugen/fft/pv-local-max.help.scrbl +++ b/doc/help/ugen/fft/pv-local-max.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-local-max buffer threshold)} + Pass bins which are a local maximum Passes only bins whose magnitude is above a threshold and above @@ -11,13 +12,20 @@ their nearest neighbors. buffer - fft buffer. threshold - magnitude threshold. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (h (pv-local-max f (mouse-x kr 0 100 0 0.1)))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-mag-above.help.scrbl b/doc/help/ugen/fft/pv-mag-above.help.scrbl index 9f8b00b..c293ba3 100644 --- a/doc/help/ugen/fft/pv-mag-above.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-above.help.scrbl @@ -3,16 +3,22 @@ @title{(pv-mag-above buffer threshold)} + Pass only bands where the magnitude is above `threshold'. This value is not normalized and is therefore dependant on the buffer size. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc 11 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (x (mouse-x kr 1 100 0 0.1)) (y (mouse-y kr 0 1 0 0.1)) @@ -21,7 +27,10 @@ size. (c3 (pv-mag-below c1 x)) (c4 (pv-mag-above c2 x))) (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y)))))) +] + +@racketblock[ (let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) (f2 (mul-add (sin-osc kr f1 0) 100 800)) (s (sin-osc ar f2 0)) @@ -32,4 +41,6 @@ size. (c3 (pv-mag-below c1 x)) (c4 (pv-mag-above c2 x))) (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y)))))) +] + diff --git a/doc/help/ugen/fft/pv-mag-below.help.scrbl b/doc/help/ugen/fft/pv-mag-below.help.scrbl index 0fced27..0e770f7 100644 --- a/doc/help/ugen/fft/pv-mag-below.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-below.help.scrbl @@ -3,9 +3,11 @@ @title{(pv-mag-below buffer threshold)} + Pass bins below a threshold. Pass only bands where the magnitude is below `threshold'. This value is not normalized and is therefore dependant on the buffer size. See pv-mag-above + diff --git a/doc/help/ugen/fft/pv-mag-clip.help.scrbl b/doc/help/ugen/fft/pv-mag-clip.help.scrbl index 9ab416a..6192baf 100644 --- a/doc/help/ugen/fft/pv-mag-clip.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-clip.help.scrbl @@ -3,19 +3,27 @@ @title{(PV_Magclip buffer threshold)} + clip bins to a threshold. clips bin magnitudes to a maximum threshold. buffer - fft buffer. threshold - magnitude threshold. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (h (pv-mag-clip f (mouse-x kr 0 5 0 0.1)))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-mag-freeze.help.scrbl b/doc/help/ugen/fft/pv-mag-freeze.help.scrbl index e6d1fb4..daed634 100644 --- a/doc/help/ugen/fft/pv-mag-freeze.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-freeze.help.scrbl @@ -3,24 +3,35 @@ @title{(PV_Magfreeze buffer freeze)} + freeze magnitudes. freezes magnitudes at current levels when freeze > 0. buffer - fft buffer. freeze - if > 0 then magnitudes are frozen at current levels. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let ((dup (lambda (a) (mce2 a a))) (s (sin-osc ar (mul-add (lf-noise1 kr 5.2) 250 400) 0)) (f (sin-osc kr 0.2 0))) (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f))))))) +] + +@racketblock[ (let ((dup (lambda (a) (mce2 a a))) (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) (f (gt (mouse-y kr 0 1 0 0.1) 0.5))) (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f))))))) +] + diff --git a/doc/help/ugen/fft/pv-mag-mul.help.scrbl b/doc/help/ugen/fft/pv-mag-mul.help.scrbl index eb11a2c..dbaf95c 100644 --- a/doc/help/ugen/fft/pv-mag-mul.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-mul.help.scrbl @@ -4,3 +4,5 @@ @title{(pv-mag-mul bufferA bufferB)} + + diff --git a/doc/help/ugen/fft/pv-mag-noise.help.scrbl b/doc/help/ugen/fft/pv-mag-noise.help.scrbl index 6777127..88664db 100644 --- a/doc/help/ugen/fft/pv-mag-noise.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-noise.help.scrbl @@ -3,17 +3,25 @@ @title{(pv-mag-noise buffer)} + Magnitudes are multiplied with noise. buffer - fft buffer. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) (f (fft* 10 a)) (h (pv-mag-noise f))) (audition (out 0 (mul (ifft* h) 0.5)))) +] + diff --git a/doc/help/ugen/fft/pv-mag-shift.help.scrbl b/doc/help/ugen/fft/pv-mag-shift.help.scrbl index 6e23a15..4619a60 100644 --- a/doc/help/ugen/fft/pv-mag-shift.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-shift.help.scrbl @@ -4,3 +4,5 @@ @title{(pv-mag-shift buffer stretch shift)} + + diff --git a/doc/help/ugen/fft/pv-mag-smear.help.scrbl b/doc/help/ugen/fft/pv-mag-smear.help.scrbl index 218dedc..86ff677 100644 --- a/doc/help/ugen/fft/pv-mag-smear.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-smear.help.scrbl @@ -3,6 +3,7 @@ @title{(pv-mag-smear buffer bins)} + Average a bin's magnitude with its neighbors. buffer - fft buffer. @@ -10,19 +11,29 @@ buffer - fft buffer. bins - number of bins to average on each side of bin. As this number rises, so will CPU usage. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((dup (lambda (a) (mce2 a a))) (in (mul (lf-saw ar 500 0) (decay2 (mul (impulse ar 2 0) 0.2) 0.01 2))) (c0 (fft* 10 in)) (c1 (pv-mag-smear c0 (mouse-x kr 0 100 0 0.1)))) (audition (out 0 (mul 0.5 (dup (ifft* c1)))))) +] + +@racketblock[ (let* ((dup (lambda (a) (mce2 a a))) (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) (x (mouse-x kr 0 100 0 0.1))) (audition (out 0 (mul 0.5 (dup (ifft* (pv-mag-smear (fft* 10 s) x))))))) +] + diff --git a/doc/help/ugen/fft/pv-mag-squared.help.scrbl b/doc/help/ugen/fft/pv-mag-squared.help.scrbl index ca3056d..b3de22b 100644 --- a/doc/help/ugen/fft/pv-mag-squared.help.scrbl +++ b/doc/help/ugen/fft/pv-mag-squared.help.scrbl @@ -4,3 +4,4 @@ @title{(pv-mag-squared buffer)} + diff --git a/doc/help/ugen/fft/pv-max.help.scrbl b/doc/help/ugen/fft/pv-max.help.scrbl index c9087e8..4205bb5 100644 --- a/doc/help/ugen/fft/pv-max.help.scrbl +++ b/doc/help/ugen/fft/pv-max.help.scrbl @@ -4,3 +4,4 @@ @title{(pv-max bufferA bufferB)} + diff --git a/doc/help/ugen/fft/pv-min.help.scrbl b/doc/help/ugen/fft/pv-min.help.scrbl index dee81c1..9776c9a 100644 --- a/doc/help/ugen/fft/pv-min.help.scrbl +++ b/doc/help/ugen/fft/pv-min.help.scrbl @@ -4,3 +4,4 @@ @title{(pv-min bufferA bufferB)} + diff --git a/doc/help/ugen/fft/pv-mul.help.scrbl b/doc/help/ugen/fft/pv-mul.help.scrbl index 80ab6ac..6de07aa 100644 --- a/doc/help/ugen/fft/pv-mul.help.scrbl +++ b/doc/help/ugen/fft/pv-mul.help.scrbl @@ -4,3 +4,4 @@ @title{(pv-mul bufferA bufferB)} + diff --git a/doc/help/ugen/fft/pv-phase-shift.help.scrbl b/doc/help/ugen/fft/pv-phase-shift.help.scrbl index 05ad625..cab4a64 100644 --- a/doc/help/ugen/fft/pv-phase-shift.help.scrbl +++ b/doc/help/ugen/fft/pv-phase-shift.help.scrbl @@ -3,13 +3,21 @@ @title{(pv-phase-shift buffer shift)} + add `shift' to the phase component of every bin at `buffer'. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let ((n (mul (white-noise ar) 0.1)) (x (mouse-x kr 0 1 0 0.1))) (audition (out 0 (ifft* (pv-phase-shift (fft* 10 n) x))))) +] + diff --git a/doc/help/ugen/fft/pv-phase-shift270.help.scrbl b/doc/help/ugen/fft/pv-phase-shift270.help.scrbl index 66bf8fd..f0fd991 100644 --- a/doc/help/ugen/fft/pv-phase-shift270.help.scrbl +++ b/doc/help/ugen/fft/pv-phase-shift270.help.scrbl @@ -3,13 +3,21 @@ @title{(pv-phase-shift270 buffer)} + Swap the real and imaginary components of every bin at `buffer' and swap the sign of the real components. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let ((n (mul (white-noise ar) 0.1))) (audition (out 0 (ifft* (pv-phase-shift270 (fft* 10 n)))))) +] + diff --git a/doc/help/ugen/fft/pv-phase-shift90.help.scrbl b/doc/help/ugen/fft/pv-phase-shift90.help.scrbl index 8428ca3..a92ff28 100644 --- a/doc/help/ugen/fft/pv-phase-shift90.help.scrbl +++ b/doc/help/ugen/fft/pv-phase-shift90.help.scrbl @@ -3,13 +3,21 @@ @title{(pv-phase-shift90 buffer)} + Swap the real and imaginary components of every bin at `buffer' and swap the of the imaginary components. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let ((n (mul (white-noise ar) 0.1))) (audition (out 0 (ifft* (pv-phase-shift90 (fft* 10 n)))))) +] + diff --git a/doc/help/ugen/fft/pv-rand-comb.help.scrbl b/doc/help/ugen/fft/pv-rand-comb.help.scrbl index 9e37648..25f76c5 100644 --- a/doc/help/ugen/fft/pv-rand-comb.help.scrbl +++ b/doc/help/ugen/fft/pv-rand-comb.help.scrbl @@ -3,18 +3,26 @@ @title{(pv-rand-comb buffer wipe trig)} + randomly clear bins. buffer = fft buffer. wipe = clear bins from input in a random order (0, 1). trig = select new random ordering. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let ((dup (lambda (a) (mce2 a a))) (n (mul (white-noise ar) 0.5)) (x (mouse-x kr 0.6 0.95 0 0.1)) (t (impulse kr 0.4 0))) (audition (out 0 (dup (ifft* (pv-rand-comb (fft* 10 n) x t)))))) +] + diff --git a/doc/help/ugen/fft/pv-rand-wipe.help.scrbl b/doc/help/ugen/fft/pv-rand-wipe.help.scrbl index a02f095..3313846 100644 --- a/doc/help/ugen/fft/pv-rand-wipe.help.scrbl +++ b/doc/help/ugen/fft/pv-rand-wipe.help.scrbl @@ -3,21 +3,30 @@ @title{(pv-rand-wipe bufferA bufferB wipe trig)} + Cross fades between two sounds by copying bins in a random order. bufferA = fft buffer A. bufferB = fft buffer B. wipe = copies bins from bufferB in a random order (0, 1). trig = select new random ordering. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)) (async fd (b-alloc 11 2048 1)))) +] + +@racketblock[ (define-syntax n-of (syntax-rules () ((_ n f) (mix-fill n (lambda (_) f))))) +] + +@racketblock[ (let* ((n 6) (a (n-of n (mul (lf-saw ar (exp-rand 400.0 1000.0) 0.0) 0.1))) (b (n-of n (mul (lf-pulse ar (exp-rand 80.0 400.0) 0.0 0.2) @@ -29,4 +38,6 @@ random ordering. (h (pv-rand-wipe f g x (gt y 0.5))) (i (ifft* h))) (audition (out 0 (mul 0.5 (mce2 i i))))) +] + diff --git a/doc/help/ugen/fft/pv-rect-comb.help.scrbl b/doc/help/ugen/fft/pv-rect-comb.help.scrbl index e81f5eb..d1468fa 100644 --- a/doc/help/ugen/fft/pv-rect-comb.help.scrbl +++ b/doc/help/ugen/fft/pv-rect-comb.help.scrbl @@ -1,24 +1,34 @@ #lang scribble/manual @(require (for-label racket)) -@title{(pv-rect-comb buffer numTeeth phase width) +@title{(pv-rect-comb buffer numTeeth phase width)} + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 2048 1)))) +] + +@racketblock[ (let* ((dup (lambda (a) (mce2 a a))) (x (mouse-x kr 0 0.5 0 0.1)) (y (mouse-y kr 0 0.5 0 0.1)) (n (dup (mul (white-noise ar) 0.3))) (c (pv-rect-comb (fft* 10 n) 8 x y))) (audition (out 0 (ifft* c)))) +] + +@racketblock[ (let* ((dup (lambda (a) (mce2 a a))) (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) (n (dup (mul (white-noise ar) 0.3))) (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))} + (audition (out 0 (ifft* c)))) +] diff --git a/doc/help/ugen/fft/pv-rect-comb2.help.scrbl b/doc/help/ugen/fft/pv-rect-comb2.help.scrbl index 178f953..54c898b 100644 --- a/doc/help/ugen/fft/pv-rect-comb2.help.scrbl +++ b/doc/help/ugen/fft/pv-rect-comb2.help.scrbl @@ -4,3 +4,4 @@ @title{(pv-rect-comb2 bufferA bufferB numTeeth phase width)} + diff --git a/doc/help/ugen/fft/pvcollect.help.scrbl b/doc/help/ugen/fft/pvcollect.help.scrbl index a7780db..d0a962e 100644 --- a/doc/help/ugen/fft/pvcollect.help.scrbl +++ b/doc/help/ugen/fft/pvcollect.help.scrbl @@ -3,6 +3,7 @@ @title{(pvcollect chain numframes func frombin tobin zeroothers)} + Process each bin of an fft chain separately. pvcollect applies function func to each bin of an fft chain. func @@ -22,44 +23,72 @@ processed are silenced. Note that this procedure can be relatively CPU-heavy, depending on how you use it. + +@racketblock[ (define no-op (lambda (m p _) (list m p))) +] + +@racketblock[ (define rand-phase (lambda (m p _) (list m (rand 0 3.14)))) +] + +@racketblock[ (define noise-phase (lambda (m p _) (list m (lin-lin (lf-noise0 kr 3) -1 1 0 3.14)))) +] + +@racketblock[ (define combf (lambda (m p i) (list (if (= (modulo i 7) 0) m 0) p))) +] + +@racketblock[ (define noise-mag (lambda (m p _) (list (mul (gt (lf-noise0 kr 10) 0) m) p))) +] + +@racketblock[ (define spectral-delay (lambda (m p _) (let ((v (lin-lin (lf-par kr 0.5 0) -1 1 0.1 1))) (list (add m (delay-n m 1 v)) p)))) +] + +@racketblock[ (define (bpf-sweep nf) (lambda (m p i) (let ((e (u:abs (sub i (lin-lin (lf-par kr 0.1 0) -1 1 2 (/ nf 20)))))) (list (mul (lt e 10) m) p)))) +] + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 1024 1)) (async fd (b-alloc-read 11 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((nf 1024) (i (play-buf 1 11 (buf-rate-scale kr 11) 1 0 1)) (c1 (fft* 10 i)) (c2 (pvcollect c1 nf spectral-delay 0 250 0))) (audition (out 0 (mul 0.1 (ifft* c2))))) +] + diff --git a/doc/help/ugen/filters/amp-comp-a.help.scrbl b/doc/help/ugen/filters/amp-comp-a.help.scrbl index ae460e0..fceafb6 100644 --- a/doc/help/ugen/filters/amp-comp-a.help.scrbl +++ b/doc/help/ugen/filters/amp-comp-a.help.scrbl @@ -3,6 +3,7 @@ @title{(amp-compA freq root minAmp rootAmp)} + ANSI A-weighting curve. Basic psychoacoustic amplitude compensation @@ -28,28 +29,38 @@ rootAmp - amplitude at the root frequency. (default 1) apart from compare a sine without compensation with one that uses amplitude compensation + +@racketblock[ (let* ((x (mouse-x kr 300 15000 1 0.1)) (y (mouse-y kr 0 1 0 0.1)) (o (mul (sin-osc ar x 0) 0.1)) (c (amp-comp-a x 300 (db-amp -10) 1))) (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c))))) +] adjust the minimum and root amp (in this way one can flatten out the curve for higher amplitudes) + +@racketblock[ (let* ((x (mouse-x kr 300 18000 1 0.1)) (y (mouse-y kr 0 1 0 0.1)) (o (mul (formant ar 300 x 20) 0.1)) (c (amp-comp-a x 300 0.6 0.3))) (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c))))) +] amplitude compensation in frequency modulation (using Fletscher-Munson curve) + +@racketblock[ (let* ((x (mouse-x kr 300 15000 1 0.1)) (y (mouse-y kr 3 200 1 0.1)) (m (mul x (mul-add (sin-osc ar y 0) 0.5 1))) (a (amp-comp-a m 300 (db-amp -10) 1)) (c (mul3 (sin-osc ar m 0) 0.1 a))) (audition (out 0 c))) +] + diff --git a/doc/help/ugen/filters/amp-comp.help.scrbl b/doc/help/ugen/filters/amp-comp.help.scrbl index ac1bec9..dfdf5bb 100644 --- a/doc/help/ugen/filters/amp-comp.help.scrbl +++ b/doc/help/ugen/filters/amp-comp.help.scrbl @@ -3,6 +3,7 @@ @title{(amp-comp freq root exp)} + Basic psychoacoustic amplitude compensation. Implements the (optimized) formula: compensationFactor = (root / @@ -26,26 +27,36 @@ freq.max(minval), or use amp-compA. compare a sine without compensation with one that uses amplitude compensation + +@racketblock[ (let* ((x (mouse-x kr 300 15000 1 0.1)) (y (mouse-y kr 0 1 0 0.1)) (o (mul (sin-osc ar x 0) 0.1)) (c (amp-comp x 300 0.333))) (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c))))) +] different sounds cause quite different loudness perception, and the desired musical behavior can vary, so the exponent can be tuned: + +@racketblock[ (let* ((x (mouse-x kr 300 15000 1 0.1)) (o (mul (pulse ar x 0.5) 0.1)) (c (amp-comp x 300 1.3))) (audition (out 0 (mul o c)))) +] amplitude compensation in frequency modulation + +@racketblock[ (let* ((x (mouse-x kr 300 15000 1 0.1)) (y (mouse-y kr 3 200 1 0.1)) (m (mul x (mul-add (sin-osc ar y 0) 0.5 1))) (a (amp-comp m 300 0.333)) (c (mul3 (sin-osc ar m 0) 0.1 a))) (audition (out 0 c))) +] + diff --git a/doc/help/ugen/filters/bpf.help.scrbl b/doc/help/ugen/filters/bpf.help.scrbl index 55c395c..30fbe36 100644 --- a/doc/help/ugen/filters/bpf.help.scrbl +++ b/doc/help/ugen/filters/bpf.help.scrbl @@ -3,18 +3,26 @@ @title{(bpf in freq rq)} + Second order Butterworth bandpass filter in - input signal to be processed freq - cutoff frequency in Hertz. rq - the reciprocal of Q. bandwidth / cutoffFreq. + +@racketblock[ (let* ((f1 (x-line kr 0.7 300 20 remove-synth)) (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) (audition (out 0 (bpf (mul (saw ar 200) 0.25) f2 0.3)))) +] + +@racketblock[ (let* ((f1 (mouse-x kr 220 440 0 0.1)) (f2 (mce2 f1 (sub 550 f1))) (rq (mouse-y kr 0 0.01 0 0.1))) (audition (out 0 (bpf (white-noise ar) f2 rq)))) +] + diff --git a/doc/help/ugen/filters/bpz2.help.scrbl b/doc/help/ugen/filters/bpz2.help.scrbl index 4000360..5f14dc5 100644 --- a/doc/help/ugen/filters/bpz2.help.scrbl +++ b/doc/help/ugen/filters/bpz2.help.scrbl @@ -3,9 +3,14 @@ @title{(bpz2 in)} + Two zero fixed midpass. This filter cuts out 0 Hz and the Nyquist frequency. + +@racketblock[ (audition (out 0 (bpz2 (mul (white-noise ar) 0.25)))) +] + diff --git a/doc/help/ugen/filters/brf.help.scrbl b/doc/help/ugen/filters/brf.help.scrbl index 2af6d4e..e766a63 100644 --- a/doc/help/ugen/filters/brf.help.scrbl +++ b/doc/help/ugen/filters/brf.help.scrbl @@ -3,9 +3,14 @@ @title{(brf in freq rq)} + Second order Butterworth band reject filter. + +@racketblock[ (let* ((f1 (x-line kr 0.7 300 20 remove-synth)) (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) (audition (out 0 (brf (mul (saw ar 200) 0.1) f2 0.3)))) +] + diff --git a/doc/help/ugen/filters/brz2.help.scrbl b/doc/help/ugen/filters/brz2.help.scrbl index 19186be..d931861 100644 --- a/doc/help/ugen/filters/brz2.help.scrbl +++ b/doc/help/ugen/filters/brz2.help.scrbl @@ -3,6 +3,7 @@ @title{(brz2 in)} + A two zero fixed midcut filter. A special case fixed filter. Implements the formula: @@ -13,7 +14,14 @@ frequency. Compare: + +@racketblock[ (audition (out 0 (mul (white-noise ar) 0.15))) +] + +@racketblock[ (audition (out 0 (brz2 (mul (white-noise ar) 0.15)))) +] + diff --git a/doc/help/ugen/filters/clip.help.scrbl b/doc/help/ugen/filters/clip.help.scrbl index 9264d23..09262bd 100644 --- a/doc/help/ugen/filters/clip.help.scrbl +++ b/doc/help/ugen/filters/clip.help.scrbl @@ -3,7 +3,12 @@ @title{(clip in lo hi)} + clip `in' to lie between `lo' and `hi', which are i-rate inputs. -(audition (out 0 (clip (mul (sin-osc ar 440 0) 0.4) -0.25 0.25))) + +@racketblock[ +(audition (out 0 (clip (mul (sin-osc ar 440 0) 0.4) -0.25 0.25))) +] + diff --git a/doc/help/ugen/filters/dyn-klank.help.scrbl b/doc/help/ugen/filters/dyn-klank.help.scrbl index 1d5dfc8..d942c1a 100644 --- a/doc/help/ugen/filters/dyn-klank.help.scrbl +++ b/doc/help/ugen/filters/dyn-klank.help.scrbl @@ -1,9 +1,8 @@ #lang scribble/manual @(require (for-label racket)) -@title{dyn-klank} +@title{(dyn-klank in freqScale freqOffset decayScale spec)} -@index{(dyn-klank in freqScale freqOffset decayScale spec)} Dynklank is a bank of frequency resonators which can be used to simulate the resonant modes of an object. Each mode is given a ring @@ -12,36 +11,47 @@ time, which is the time for the mode to decay by 60 dB. Unlike klank, the parameters in specificationsArrayRef can be changed after it has been started. + +@racketblock[ (let ((i (mul (impulse ar 2 0) 0.1)) - (d (klank-data '(800 1071 1153 1723) - (replicate 4 1) - (replicate 4 1)))) + (d (klank-data '(800 1071 1153 1723) + (replicate 4 1) + (replicate 4 1)))) (audition (out 0 (dyn-klank i 1 0 1 d)))) +] + +@racketblock[ (let ((i (mul (dust ar 8) 0.1)) - (d (klank-data '(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) + (d (klank-data '(800 1071 1353 1723) + (replicate 4 1) + (replicate 4 1)))) (audition (out 0 (dyn-klank i 1 0 1 d)))) +] + +@racketblock[ (let* ((i (mul (impulse ar 3 0) 0.1)) (f (list 800 1071 1153 1723)) (r (list 1 1 1 1)) (x (mouse-x kr 0.5 2 1 0.1)) (y (mouse-y kr 0.1 10 1 0.1)) (d (klank-data (map (lambda (e) (mul e x)) f) - (replicate 4 1) - (map (lambda (e) (mul e y)) r)))) + (replicate 4 1) + (map (lambda (e) (mul e y)) r)))) (audition (out 0 (dyn-klank i 1 0 1 d)))) +] -(let* ((i (lambda (f) - (mul (impulse ar (lin-lin (lf-noise0 kr f) -1 1 3 12) 0) 0.1))) - (t (lambda (i d l r) - (map (lambda (e) (mul e (t-rand l r i))) d))) - (d (lambda (i f r) - (klank-data (t i f 0.5 2) - (replicate 4 1) - (t i r 0.1 10)))) + +@racketblock[ +(let* ((i (lambda (f) + (mul (impulse ar (lin-lin (lf-noise0 kr f) -1 1 3 12) 0) 0.1))) + (t (lambda (i d l r) + (map (lambda (e) (mul e (t-rand l r i))) d))) + (d (lambda (i f r) + (klank-data (t i f 0.5 2) + (replicate 4 1) + (t i r 0.1 10)))) (f1 (list 800 1071 1153 1723)) (f2 (list 786 1083 1169 1715)) (r1 (list 1 0.95 0.75 1.25)) @@ -49,4 +59,7 @@ changed after it has been started. (i1 (i 1.5)) (i2 (i 1.25))) (audition (out 0 (mce2 (dyn-klank i1 1 0 1 (d i1 f1 r1)) - (dyn-klank i2 1 0 1 (d i2 f2 r2)))))) + (dyn-klank i2 1 0 1 (d i2 f2 r2)))))) +] + + diff --git a/doc/help/ugen/filters/fold.help.scrbl b/doc/help/ugen/filters/fold.help.scrbl index d131ec4..181bed0 100644 --- a/doc/help/ugen/filters/fold.help.scrbl +++ b/doc/help/ugen/filters/fold.help.scrbl @@ -3,6 +3,7 @@ @title{(fold in lo hi)} + fold a signal outside given thresholds. This differs from the BinaryOpUGen fold2 in that it allows one to @@ -12,15 +13,22 @@ in - signal to be foldped lo - low threshold of foldping hi - high threshold of foldping + +@racketblock[ (let ((o (mul (sin-osc ar 440 0) 0.2)) (l (rand -0.175 -0.025)) (r (rand 0.025 0.175))) (audition (out 0 (fold o l r)))) +] lo and hi are i-rate only. + +@racketblock[ (let ((o (mul (sin-osc ar 440 0) 0.2)) (x (mouse-x kr -0.175 -0.025 1 0.1)) (y (mouse-y kr 0.025 0.175 1 0.1))) (audition (out 0 (fold o x y)))) +] + diff --git a/doc/help/ugen/filters/formlet.help.scrbl b/doc/help/ugen/filters/formlet.help.scrbl index b752fda..e719e0d 100644 --- a/doc/help/ugen/filters/formlet.help.scrbl +++ b/doc/help/ugen/filters/formlet.help.scrbl @@ -3,18 +3,29 @@ @title{(formlet in freq attackTime decayTime)} + FOF-like filter + +@racketblock[ (let ((i (impulse ar 20 0.5))) (audition (out 0 (formlet i 1000 0.01 0.1)))) +] + +@racketblock[ (let* ((f (x-line kr 10 400 8 remove-synth)) (i (mul (blip ar f 1000) 0.1))) (audition (out 0 (formlet i 1000 0.01 0.1)))) +] Modulating formant frequency. + +@racketblock[ (let ((i (mul (blip ar (mul-add (sin-osc kr 5 0) 20 300) 1000) 0.1)) (f (x-line kr 1500 700 8 remove-synth))) (audition (out 0 (formlet i f 0.005 0.04)))) +] + diff --git a/doc/help/ugen/filters/fos.help.scrbl b/doc/help/ugen/filters/fos.help.scrbl index 0bc2637..67b4325 100644 --- a/doc/help/ugen/filters/fos.help.scrbl +++ b/doc/help/ugen/filters/fos.help.scrbl @@ -3,17 +3,25 @@ @title{(fos in a0 a1 b1)} + First order filter section. Same as one-pole. + +@racketblock[ (let ((x (mul (lf-tri ar 0.4 0) 0.99)) (i (mul (lf-saw ar 200 0) 0.2))) (audition (out 0 (fos i (sub 1 (u:abs x)) 0 x)))) +] Same as one-zero + +@racketblock[ (let ((x (mul (lf-tri ar 0.4 0) 0.99)) (i (mul (lf-saw ar 200 0) 0.2))) (audition (out 0 (fos i (sub 1 (u:abs x)) x 0)))) +] + diff --git a/doc/help/ugen/filters/freq-shift.help.scrbl b/doc/help/ugen/filters/freq-shift.help.scrbl index e0494b1..056d25e 100644 --- a/doc/help/ugen/filters/freq-shift.help.scrbl +++ b/doc/help/ugen/filters/freq-shift.help.scrbl @@ -3,6 +3,7 @@ @title{(freq-shift input shift phase)} + freq-shift implements single sideband amplitude modulation, also known as frequency shifting, but not to be confused with pitch shifting. Frequency shifting moves all the components of a signal @@ -15,28 +16,41 @@ phase - phase of the frequency shift (0 - 2pi) shifting a 100Hz tone by 1 Hz rising to 500Hz + +@racketblock[ (let ((i (sin-osc ar 100 0)) (s (x-line kr 1 500 5 remove-synth))) (audition (out 0 (mul (freq-shift i s 0) 0.1)))) +] shifting a complex tone by 1 Hz rising to 500Hz + +@racketblock[ (let ((i (klang ar 1 0 (klang-data (list 101 303 606 808) (replicate 4 1) (replicate 4 1)))) (s (x-line kr 1 500 5 remove-synth))) (audition (out 0 (mul (freq-shift i s 0) 0.1)))) +] modulating shift and phase + +@racketblock[ (let ((i (sin-osc ar 10 0)) (s (mul (lf-noise2 ar 0.3) 1500)) (p (lin-lin (sin-osc ar 500 0) -1 1 0 (* 2 pi)))) (audition (out 0 (mul (freq-shift i s p) 0.1)))) +] shifting bandpassed noise + +@racketblock[ (let ((i (bpf (white-noise ar) 1000 0.001)) (s (mul (lf-noise0 ar 5.5) 1000))) (audition (out 0 (mul (freq-shift i s 0) 32)))) +] + diff --git a/doc/help/ugen/filters/hpf.help.scrbl b/doc/help/ugen/filters/hpf.help.scrbl index d7796a5..cf2a61b 100644 --- a/doc/help/ugen/filters/hpf.help.scrbl +++ b/doc/help/ugen/filters/hpf.help.scrbl @@ -3,10 +3,15 @@ @title{(hpf in freq)} + Second order Butterworth highpass filter. + +@racketblock[ (let* ((i (mul (saw ar 200) 0.1)) (f1 (x-line kr 0.7 300 20 do-nothing)) (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) (audition (out 0 (mul (hpf i f2) 5)))) +] + diff --git a/doc/help/ugen/filters/hpz1.help.scrbl b/doc/help/ugen/filters/hpz1.help.scrbl index cfa8b99..d83438b 100644 --- a/doc/help/ugen/filters/hpz1.help.scrbl +++ b/doc/help/ugen/filters/hpz1.help.scrbl @@ -3,7 +3,12 @@ @title{(hpz1 in)} + Two point difference filter. -(audition (out 0 (hpz1 (mul (white-noise ar) 0.25)))) + +@racketblock[ +(audition (out 0 (hpz1 (mul (white-noise ar) 0.25)))) +] + diff --git a/doc/help/ugen/filters/hpz2.help.scrbl b/doc/help/ugen/filters/hpz2.help.scrbl index 1495828..2a41b50 100644 --- a/doc/help/ugen/filters/hpz2.help.scrbl +++ b/doc/help/ugen/filters/hpz2.help.scrbl @@ -3,7 +3,12 @@ @title{(hpz2 in)} + Two zero fixed highpass filter. -(audition (out 0 (hpz2 (mul (white-noise ar) 0.25)))) + +@racketblock[ +(audition (out 0 (hpz2 (mul (white-noise ar) 0.25)))) +] + diff --git a/doc/help/ugen/filters/klank.help.scrbl b/doc/help/ugen/filters/klank.help.scrbl index f8cb4f3..4714aba 100644 --- a/doc/help/ugen/filters/klank.help.scrbl +++ b/doc/help/ugen/filters/klank.help.scrbl @@ -1,9 +1,8 @@ #lang scribble/manual @(require (for-label racket)) -@title{klank} +@title{(klank in freqScale freqOffset decayScale spec)} -@italic{(klank in freqScale freqOffset decayScale spec)} klank is a bank of fixed frequency resonators which can be used to simulate the resonant modes of an object. Each mode is given a ring @@ -24,32 +23,49 @@ freqoffset - an offset added to all frequencies at initialization decayscale - a scale factor multiplied by all ring times at initialization time. + +@racketblock[ (let ((i (mul (impulse ar 2 0) 0.1)) - (d (klank-data '(800 1071 1153 1723) - (replicate 5 1) - (replicate 5 1)))) + (d (klank-data '(800 1071 1153 1723) + (replicate 5 1) + (replicate 5 1)))) (audition (out 0 (klank i 1 0 1 d)))) +] + +@racketblock[ (let ((i (mul (dust ar 8) 0.1)) - (d (klank-data '(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) + (d (klank-data '(800 1071 1353 1723) + (replicate 4 1) + (replicate 4 1)))) (audition (out 0 (klank i 1 0 1 d)))) +] + +@racketblock[ (let ((i (mul (pink-noise ar) 0.007)) - (d (klank-data '(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) + (d (klank-data '(800 1071 1353 1723) + (replicate 4 1) + (replicate 4 1)))) (audition (out 0 (klank i 1 0 1 d)))) +] + +@racketblock[ (let ((i (mul (pink-noise ar) (mce2 0.007 0.007))) (d (klank-data '(200 671 1153 1723) - (replicate 4 1) - (replicate 4 1)))) + (replicate 4 1) + (replicate 4 1)))) (audition (out 0 (klank i 1 0 1 d)))) +] + +@racketblock[ (let ((i (mul (decay (impulse ar 4 0) 0.03) (mul (clip-noise ar) 0.01))) (d (klank-data (replicate-m 12 (rand 800 4000)) - (replicate 12 1) - (replicate-m 12 (rand 0.1 2))))) + (replicate 12 1) + (replicate-m 12 (rand 0.1 2))))) (audition (out 0 (klank i 1 0 1 d)))) +] + + diff --git a/doc/help/ugen/filters/lag.help.scrbl b/doc/help/ugen/filters/lag.help.scrbl index 9c5064b..1b427fc 100644 --- a/doc/help/ugen/filters/lag.help.scrbl +++ b/doc/help/ugen/filters/lag.help.scrbl @@ -3,9 +3,14 @@ @title{(lag in lagTime)} + A simple averaging filter. + +@racketblock[ (let* ((x (mouse-x kr 220 440 0 0.1)) (f (mce2 x (lag x 1)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/filters/lag2.help.scrbl b/doc/help/ugen/filters/lag2.help.scrbl index 0fd40a3..133d8b9 100644 --- a/doc/help/ugen/filters/lag2.help.scrbl +++ b/doc/help/ugen/filters/lag2.help.scrbl @@ -3,9 +3,14 @@ @title{(lag2 in lagTime)} + lag2 is the same as (lag kr (Lag kr in time) time). + +@racketblock[ (let* ((x (mouse-x kr 220 440 0 0.1)) (f (mce2 x (lag2 x 1)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/filters/lag3.help.scrbl b/doc/help/ugen/filters/lag3.help.scrbl index 24ffbb9..bb1a737 100644 --- a/doc/help/ugen/filters/lag3.help.scrbl +++ b/doc/help/ugen/filters/lag3.help.scrbl @@ -3,9 +3,14 @@ @title{(lag3 in lagTime)} + lag3 is the same as (lag (Lag (Lag in time) time) time). + +@racketblock[ (let* ((x (mouse-x kr 220 440 0 0.1)) (f (mce2 x (lag3 x 1)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/filters/leak-dc.help.scrbl b/doc/help/ugen/filters/leak-dc.help.scrbl index 9c66df3..cb14550 100644 --- a/doc/help/ugen/filters/leak-dc.help.scrbl +++ b/doc/help/ugen/filters/leak-dc.help.scrbl @@ -3,11 +3,16 @@ @title{(leak-dc in coef)} + Remove DC. This filter removes a DC offset from a signal. in - input signal coef - leak coefficient + +@racketblock[ (let ((a (mul (lf-pulse ar 800 0.5 0.5) 0.1))) (audition (out 0 (mce2 a (leak-dc a 0.995))))) +] + diff --git a/doc/help/ugen/filters/limiter.help.scrbl b/doc/help/ugen/filters/limiter.help.scrbl index 36892db..92f484c 100644 --- a/doc/help/ugen/filters/limiter.help.scrbl +++ b/doc/help/ugen/filters/limiter.help.scrbl @@ -3,13 +3,18 @@ @title{(limiter input level lookAheadTime)} + peak limiter. Limits the input amplitude to the given level. limiter will not overshoot like compander will, but it needs to look ahead in the audio. Thus there is a delay equal to twice the lookAheadTime. limiter, unlike compander, is completely transparent for an in range signal. + +@racketblock[ (let* ((t (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7))) (i (mul (decay2 t 0.001 0.3) (f-sin-osc ar 500 0)))) (audition (out 0 (mce2 (mul i 0.1) (limiter i 0.2 0.01))))) +] + diff --git a/doc/help/ugen/filters/lin-exp.help.scrbl b/doc/help/ugen/filters/lin-exp.help.scrbl index 8093f50..599f4f2 100644 --- a/doc/help/ugen/filters/lin-exp.help.scrbl +++ b/doc/help/ugen/filters/lin-exp.help.scrbl @@ -3,6 +3,7 @@ @title{(lin-exp in srclo srchi dstlo dsthi)} + Map a linear range to an exponential range. in - input to convert - kr, ar @@ -11,7 +12,11 @@ srchi - upper limit of input range - ir dstlo - lower limit of output range - ir dsthi - upper limit of output range - ir + +@racketblock[ (audition (out 0 (mul (sin-osc ar (lin-exp (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0) (lin-exp (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25)))) +] + diff --git a/doc/help/ugen/filters/lin-lin.help.scrbl b/doc/help/ugen/filters/lin-lin.help.scrbl index 4f0b249..1f63383 100644 --- a/doc/help/ugen/filters/lin-lin.help.scrbl +++ b/doc/help/ugen/filters/lin-lin.help.scrbl @@ -3,6 +3,7 @@ @title{(lin-lin in srclo srchi dstlo dsthi)} + Map a linear range to another linear range. in - input to convert - kr, ar @@ -11,7 +12,11 @@ srchi - upper limit of input range - ir dstlo - lower limit of output range - ir dsthi - upper limit of output range - ir + +@racketblock[ (audition (out 0 (mul (sin-osc ar (lin-lin (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0) (lin-lin (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25)))) +] + diff --git a/doc/help/ugen/filters/lpf.help.scrbl b/doc/help/ugen/filters/lpf.help.scrbl index ebf1008..5856412 100644 --- a/doc/help/ugen/filters/lpf.help.scrbl +++ b/doc/help/ugen/filters/lpf.help.scrbl @@ -3,10 +3,15 @@ @title{(lpf in freq)} + Second order Butterworth lowpass filter. + +@racketblock[ (audition (let ((f (x-line kr 0.7 300 20 remove-synth))) (out 0 (lpf (mul (saw ar 200) 0.1) (mul-add (f-sin-osc kr f 0) 3600 4000))))) +] + diff --git a/doc/help/ugen/filters/lpz1.help.scrbl b/doc/help/ugen/filters/lpz1.help.scrbl index 565798d..2d81ab7 100644 --- a/doc/help/ugen/filters/lpz1.help.scrbl +++ b/doc/help/ugen/filters/lpz1.help.scrbl @@ -3,8 +3,13 @@ @title{(lpz1 ar in)} + Two point average filter + +@racketblock[ (audition (out 0 (lpz1 (mul (white-noise ar) 0.25)))) +] + diff --git a/doc/help/ugen/filters/lpz2.help.scrbl b/doc/help/ugen/filters/lpz2.help.scrbl index e42631d..f3e661c 100644 --- a/doc/help/ugen/filters/lpz2.help.scrbl +++ b/doc/help/ugen/filters/lpz2.help.scrbl @@ -3,8 +3,13 @@ @title{(lpz2 ar in)} + Two zero fixed lowpass filter + +@racketblock[ (audition (out 0 (lpz2 (mul (white-noise ar) 0.25)))) +] + diff --git a/doc/help/ugen/filters/median.help.scrbl b/doc/help/ugen/filters/median.help.scrbl index 7d79512..69c775b 100644 --- a/doc/help/ugen/filters/median.help.scrbl +++ b/doc/help/ugen/filters/median.help.scrbl @@ -3,29 +3,43 @@ @title{(median length in)} + median filter. Signal with impulse noise. + +@racketblock[ (audition (out 0 (median 3 (add (mul (saw ar 500) 0.1) (mul (dust2 ar 100) 0.9))))) +] The median length can be increased for longer duration noise. + +@racketblock[ (audition (out 0 (median 5 (add (mul (saw ar 500) 0.1) (lpz1 (mul (dust2 ar 100) 0.9)))))) +] Long median filters begin chopping off the peaks of the waveform + +@racketblock[ (audition (out 0 (let ((x (mul (sin-osc ar 1000 0) 0.2))) (mce2 x (median 31 x))))) +] Another noise reduction application. Use median filter for high frequency noise. Use leak-dc for low frequency noise. + +@racketblock[ (audition (out 0 (let* ((s0 (mul-add (white-noise ar) 0.1 (mul (sin-osc ar 800 0) 0.1))) (s1 (median 31 s0))) (leak-dc s1 0.9)))) +] + diff --git a/doc/help/ugen/filters/moog-ff.help.scrbl b/doc/help/ugen/filters/moog-ff.help.scrbl index a17bb7f..c8570e5 100644 --- a/doc/help/ugen/filters/moog-ff.help.scrbl +++ b/doc/help/ugen/filters/moog-ff.help.scrbl @@ -3,6 +3,7 @@ @title{(moog-ff in freq gain reset)} + Moog VCF implementation, designed by Federico Fontana. A digital implementation of the Moog VCF (filter). @@ -17,14 +18,21 @@ The design of this filter is described in the conference paper Fontana, F. (2007) Preserving the Digital Structure of the Moog VCF. in Proc. ICMC07, Copenhagen, 25-31 August 2007 + +@racketblock[ (let ((n (mul (white-noise ar) 0.1)) (y (mouse-y kr 100 10000 1 0.1)) (x (mouse-x kr 0 4 0 0.1))) (audition (out 0 (moog-ff n y x 0)))) +] + +@racketblock[ (let* ((p (pulse ar (mce2 40 121) (mce2 0.3 0.7))) (f0 (lin-lin (lf-noise0 kr 0.43) -1 1 0.001 2.2)) (f1 (lin-lin (sin-osc kr f0 0) -1 1 30 4200)) (y (mouse-y kr 1 4 0 0.1))) (audition (out 0 (moog-ff p f1 (mul 0.83 y) 0)))) +] + diff --git a/doc/help/ugen/filters/normalizer.help.scrbl b/doc/help/ugen/filters/normalizer.help.scrbl index 6556ed2..de85d98 100644 --- a/doc/help/ugen/filters/normalizer.help.scrbl +++ b/doc/help/ugen/filters/normalizer.help.scrbl @@ -3,11 +3,16 @@ @title{(normalizer in level dur)} + Flattens dynamics. + +@racketblock[ (let ((z (mul (decay2 (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7)) 0.001 0.3) (f-sin-osc ar 500 0)))) (audition (out 0 (mce2 z (normalizer z 0.4 0.01))))) +] + diff --git a/doc/help/ugen/filters/one-pole.help.scrbl b/doc/help/ugen/filters/one-pole.help.scrbl index 063ca62..9868c0f 100644 --- a/doc/help/ugen/filters/one-pole.help.scrbl +++ b/doc/help/ugen/filters/one-pole.help.scrbl @@ -3,21 +3,32 @@ @title{(one-pole in coef)} + A one pole filter. Implements the formula: out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1)). in - input signal to be processed coef - feedback coefficient. Should be between -1 and +1 + +@racketblock[ (audition (out 0 (one-pole (mul (white-noise ar) 0.5) 0.95))) +] + +@racketblock[ (audition (out 0 (one-pole (mul (white-noise ar) 0.5) -0.95))) +] + +@racketblock[ (audition (out 0 (one-pole (mul (white-noise ar) 0.5) (line kr -0.99 0.99 10 remove-synth)))) +] + diff --git a/doc/help/ugen/filters/one-zero.help.scrbl b/doc/help/ugen/filters/one-zero.help.scrbl index 9b58187..1f153da 100644 --- a/doc/help/ugen/filters/one-zero.help.scrbl +++ b/doc/help/ugen/filters/one-zero.help.scrbl @@ -3,15 +3,26 @@ @title{(one-zero in coef)} + One zero filter + +@racketblock[ (audition (out 0 (one-zero (mul (white-noise ar) 0.5) 0.5))) +] + +@racketblock[ (audition (out 0 (one-zero (mul (white-noise ar) 0.5) -0.5))) +] + +@racketblock[ (audition (out 0 (one-zero (mul (white-noise ar) 0.5) (line kr -0.5 0.5 10 remove-synth)))) +] + diff --git a/doc/help/ugen/filters/resonz.help.scrbl b/doc/help/ugen/filters/resonz.help.scrbl index 5432d5c..47e8440 100644 --- a/doc/help/ugen/filters/resonz.help.scrbl +++ b/doc/help/ugen/filters/resonz.help.scrbl @@ -3,6 +3,7 @@ @title{(resonz in freq bwr)} + Resonant filter. A two pole resonant filter with zeroes at z = +/- 1. Based on @@ -15,29 +16,45 @@ in - input signal to be processed freq - resonant frequency in Hertz rq - bandwidth ratio (reciprocal of Q). rq = bandwidth / centerFreq + +@racketblock[ (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 0.1))) +] Modulate frequency + +@racketblock[ (let ((f (x-line kr 1000 8000 10 remove-synth))) (audition (out 0 (resonz (mul (white-noise ar) 0.5) f 0.05)))) +] Modulate bandwidth + +@racketblock[ (let ((rq (x-line kr 1 0.001 8 remove-synth))) (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq)))) +] Modulate bandwidth opposite direction + +@racketblock[ (let ((rq (x-line kr 0.001 1 8 remove-synth))) (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq)))) +] random resonator at a random location, run as often as you like... + +@racketblock[ (let ((freq (choose (map (lambda (z) (* z 120)) (enum-from-to 1 16)))) (bw 1/4) (gain 8)) (audition (out 0 (pan2 (resonz (white-noise ar) freq (/ bw freq)) (rand -1 1) gain)))) +] + diff --git a/doc/help/ugen/filters/rhpf.help.scrbl b/doc/help/ugen/filters/rhpf.help.scrbl index 4507ff2..a9d16ce 100644 --- a/doc/help/ugen/filters/rhpf.help.scrbl +++ b/doc/help/ugen/filters/rhpf.help.scrbl @@ -3,12 +3,17 @@ @title{(Rhpf in freq rq)} + A resonant high pass filter. + +@racketblock[ (audition (out 0 (rhpf (mul (saw ar 200) 0.1) (mul-add (f-sin-osc kr (x-line kr 0.7 300 20 remove-synth) 0) 3600 4000) 0.2))) +] + diff --git a/doc/help/ugen/filters/ringz.help.scrbl b/doc/help/ugen/filters/ringz.help.scrbl index 9386455..bf2eba1 100644 --- a/doc/help/ugen/filters/ringz.help.scrbl +++ b/doc/help/ugen/filters/ringz.help.scrbl @@ -3,43 +3,64 @@ @title{(ringz in freq decayTime)} + Ringing filter. This is the same as resonz, except that instead of a resonance parameter, the bandwidth is specified in a 60dB ring decay time. One ringz is equivalent to one component of the klank UGen. + +@racketblock[ (audition (out 0 (ringz (mul (dust ar 3) 0.3) 2000 2))) +] + +@racketblock[ (audition (out 0 (ringz (mul (white-noise ar) 0.005) 2000 0.5))) +] Modulate frequency + +@racketblock[ (audition (out 0 (ringz (mul (white-noise ar) 0.005) (x-line kr 100 3000 10 do-nothing) 0.5))) +] + +@racketblock[ (audition (out 0 (ringz (mul (impulse ar 6 0) 0.3) (x-line kr 100 3000 10 do-nothing) 0.5))) +] Modulate ring time + +@racketblock[ (audition (out 0 (ringz (mul (impulse ar 6 0) 0.3) 2000 (x-line kr 4 0.04 8 do-nothing)))) +] Modulate ring time opposite direction + +@racketblock[ (audition (out 0 (ringz (mul (impulse ar 6 0) 0.3) 2000 (x-line kr 0.04 4 8 do-nothing)))) +] + +@racketblock[ (audition (out 0 (let ((n (mul (white-noise ar) 0.001))) (mix-fill @@ -47,4 +68,6 @@ Modulate ring time opposite direction (lambda (_) (let ((f (x-line kr (rand 100 5000) (rand 100 5000) 20 do-nothing))) (ringz n f 0.5))))))) +] + diff --git a/doc/help/ugen/filters/rlpf.help.scrbl b/doc/help/ugen/filters/rlpf.help.scrbl index 0b9d3e8..cb49255 100644 --- a/doc/help/ugen/filters/rlpf.help.scrbl +++ b/doc/help/ugen/filters/rlpf.help.scrbl @@ -3,10 +3,15 @@ @title{(Rlpf in freq rq)} + A resonant low pass filter. + +@racketblock[ (let* ((f1 (x-line kr 0.7 300 20 remove-synth)) (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) (audition (out 0 (rlpf (mul (saw ar 200) 0.1) f2 0.2)))) +] + diff --git a/doc/help/ugen/filters/sos.help.scrbl b/doc/help/ugen/filters/sos.help.scrbl index 099ba08..486c2fb 100644 --- a/doc/help/ugen/filters/sos.help.scrbl +++ b/doc/help/ugen/filters/sos.help.scrbl @@ -3,15 +3,20 @@ @title{(sos in a0 a1 a2 b1 b2)} + Second order filter section (biquad). A standard second order filter section. Filter coefficients are given directly rather than calculated for you. Same as two-pole + +@racketblock[ (let* ((theta (line kr (* 0.2 pi) pi 5 remove-synth)) (rho (line kr 0.6 0.99 5 remove-synth)) (b1 (mul 2 (mul rho (u:cos theta)))) (b2 (neg (squared rho)))) (audition (out 0 (sos (lf-saw ar 200 0.1) 1 0 0 b1 b2)))) +] + diff --git a/doc/help/ugen/filters/two-pole.help.scrbl b/doc/help/ugen/filters/two-pole.help.scrbl index 2170c8d..da99c7b 100644 --- a/doc/help/ugen/filters/two-pole.help.scrbl +++ b/doc/help/ugen/filters/two-pole.help.scrbl @@ -3,14 +3,22 @@ @title{(two-pole in freq radius)} + Two pole filter. This provides lower level access to setting of pole location. For general purposes resonz is better. + +@racketblock[ (audition (out 0 (two-pole (mul (white-noise ar) 0.005) 2000 0.95))) +] + +@racketblock[ (audition (out 0 (two-pole (mul (white-noise ar) 0.005) (x-line kr 800 8000 8 remove-synth) 0.95))) +] + diff --git a/doc/help/ugen/filters/two-zero.help.scrbl b/doc/help/ugen/filters/two-zero.help.scrbl index 40a39fc..f4af669 100644 --- a/doc/help/ugen/filters/two-zero.help.scrbl +++ b/doc/help/ugen/filters/two-zero.help.scrbl @@ -3,10 +3,15 @@ @title{(two-zero in freq radius)} + Two zero filter + +@racketblock[ (audition (out 0 (two-zero (mul (white-noise ar) 0.125) (x-line kr 20 20000 8 remove-synth) 1))) +] + diff --git a/doc/help/ugen/filters/wrap.help.scrbl b/doc/help/ugen/filters/wrap.help.scrbl index 3e7cb18..df834a5 100644 --- a/doc/help/ugen/filters/wrap.help.scrbl +++ b/doc/help/ugen/filters/wrap.help.scrbl @@ -3,6 +3,7 @@ @title{(wrap in lo hi)} + wrap a signal outside given thresholds. This differs from the BinaryOpUGen wrap2 in that it allows one to @@ -12,15 +13,22 @@ in - signal to be wrapped lo - low threshold of wrapping hi - high threshold of wrapping + +@racketblock[ (let ((o (mul (sin-osc ar 440 0) 0.2)) (l (rand -0.175 -0.025)) (r (rand 0.025 0.175))) (audition (out 0 (wrap o l r)))) +] lo and hi are i-rate only. + +@racketblock[ (let ((o (mul (sin-osc ar 440 0) 0.2)) (x (mouse-x kr -0.175 -0.025 1 0.1)) (y (mouse-y kr 0.025 0.175 1 0.1))) (audition (out 0 (wrap o x y)))) +] + diff --git a/doc/help/ugen/granular/grain-buf.help.scrbl b/doc/help/ugen/granular/grain-buf.help.scrbl index fbb1dbe..063bc48 100644 --- a/doc/help/ugen/granular/grain-buf.help.scrbl +++ b/doc/help/ugen/granular/grain-buf.help.scrbl @@ -1,10 +1,9 @@ #lang scribble/manual @(require (for-label racket)) -@title{grain-buf} - @title{(grain-buf nc tr dur sndbuf rate pos interp pan envbuf)} + Granular synthesis with sound stored in a buffer nc - the number of channels to output. If 1, mono is returned and @@ -34,6 +33,8 @@ pan - a value from -1 to 1. Determines where to pan the output in envb - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)) @@ -49,4 +50,6 @@ envb - the buffer number containing a singal to use for the (out 0 (grain-buf 2 i 0.1 sndbuf r p 2 x envbuf)))))) (send-synth fd "g" g) (send fd (s-new2 "g" -1 add-to-tail 1 "sndbuf" 10 "envbuf" -1))))) +] + diff --git a/doc/help/ugen/granular/grain-fm.help.scrbl b/doc/help/ugen/granular/grain-fm.help.scrbl index a4e5921..e82f694 100644 --- a/doc/help/ugen/granular/grain-fm.help.scrbl +++ b/doc/help/ugen/granular/grain-fm.help.scrbl @@ -3,6 +3,7 @@ @title{(grain-fm nc tr dur carfreq modfreq index pan envbuf)} + Granular synthesis with frequency modulated sine tones nc - the number of channels to output. If 1, mono is returned and @@ -29,6 +30,8 @@ pan - a value from -1 to 1. Determines where to pan the output in envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. + +@racketblock[ (let* ((x (mouse-x kr -0.5 0.5 0 0.1)) (y (mouse-y kr 0 400 0 0.1)) (n (white-noise kr)) @@ -36,4 +39,6 @@ envbuf - the buffer number containing a singal to use for the grain (t (impulse kr 10 0)) (i (lin-lin (lf-noise1 kr 500) -1 1 1 10))) (audition (out 0 (mul (grain-fm 2 t 0.1 fd 200 i x -1) 0.1)))) +] + diff --git a/doc/help/ugen/granular/grain-in.help.scrbl b/doc/help/ugen/granular/grain-in.help.scrbl index cf90936..cff1ae8 100644 --- a/doc/help/ugen/granular/grain-in.help.scrbl +++ b/doc/help/ugen/granular/grain-in.help.scrbl @@ -3,6 +3,7 @@ @title{(Grainin nc tr dur in pan envbuf)} + Granulate an input signal nc - the number of channels to output. If 1, mono is @@ -23,9 +24,13 @@ pan - a value from -1 to 1. Determines where to pan the output in envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. + +@racketblock[ (let* ((x (mouse-x kr -0.5 0.5 0 0.1)) (y (mouse-y kr 5 25 0 0.1)) (n (pink-noise ar)) (t (impulse kr y 0))) (audition (out 0 (mul (grain-in 2 t 0.1 n x -1) 0.1)))) +] + diff --git a/doc/help/ugen/granular/grain-sin.help.scrbl b/doc/help/ugen/granular/grain-sin.help.scrbl index 585e7bc..2a6dc1a 100644 --- a/doc/help/ugen/granular/grain-sin.help.scrbl +++ b/doc/help/ugen/granular/grain-sin.help.scrbl @@ -3,6 +3,7 @@ @title{(grain-sin nc tr dur freq pan envbuf)} + Granular synthesis with sine tones nc - the number of channels to output. If 1, mono is returned and @@ -23,10 +24,14 @@ pan - a value from -1 to 1. Determines where to pan the output in envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. + +@racketblock[ (let* ((x (mouse-x kr -0.5 0.5 0 0.1)) (y (mouse-y kr 0 400 0 0.1)) (n (white-noise kr)) (f (add 440 (mul n y))) (t (impulse kr 10 0))) (audition (out 0 (mul (grain-sin 2 t 0.1 f x -1) 0.1)))) +] + diff --git a/doc/help/ugen/granular/warp1.help.scrbl b/doc/help/ugen/granular/warp1.help.scrbl index b4c189b..b4edd48 100644 --- a/doc/help/ugen/granular/warp1.help.scrbl +++ b/doc/help/ugen/granular/warp1.help.scrbl @@ -3,6 +3,7 @@ @title{(warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)} + Warp a buffer with a time pointer inspired by Chad Kirby's SuperCollider2 warp1 class, which was @@ -36,12 +37,19 @@ interp - the interpolation method used for pitchshifting grains. 1 = no interpolation. 2 = linear. 4 = cubic interpolation (more computationally intensive). + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((p (lin-lin (lf-saw kr 0.05 0) -1 1 0 1)) (x (mouse-x kr 0.5 2 0 0.1)) (w (warp1 1 10 p x 0.1 -1 8 0.1 2))) (audition (out 0 w))) +] + diff --git a/doc/help/ugen/information/buf-channels.help.scrbl b/doc/help/ugen/information/buf-channels.help.scrbl index 962b355..b9a5883 100644 --- a/doc/help/ugen/information/buf-channels.help.scrbl +++ b/doc/help/ugen/information/buf-channels.help.scrbl @@ -3,7 +3,9 @@ @title{(buf-channels rate bufnum)} + Current number of channels of buffer. Using at .ir is not the safest choice. Since a buffer can be reallocated at any time, using ir will not track the changes. + diff --git a/doc/help/ugen/information/buf-dur.help.scrbl b/doc/help/ugen/information/buf-dur.help.scrbl index 3f5b462..dc36370 100644 --- a/doc/help/ugen/information/buf-dur.help.scrbl +++ b/doc/help/ugen/information/buf-dur.help.scrbl @@ -3,14 +3,22 @@ @title{(buf-dur rate bufnum)} + Current duration of buffer. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((t (impulse ar (recip (buf-dur kr 0)) 0)) (p (sweep t (buf-sample-rate kr 0)))) (audition (out 0 (buf-rd 1 ar 0 p 0 2)))) +] + diff --git a/doc/help/ugen/information/buf-frames.help.scrbl b/doc/help/ugen/information/buf-frames.help.scrbl index 50caf2d..fa4fcf6 100644 --- a/doc/help/ugen/information/buf-frames.help.scrbl +++ b/doc/help/ugen/information/buf-frames.help.scrbl @@ -3,15 +3,26 @@ @title{(buf-frames rate bufnum)} + Current duration of buffer. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let ((p (phasor ar 0 (buf-rate-scale kr 0) 0 (buf-frames kr 0) 0))) (audition (out 0 (buf-rd 1 ar 0 p 0 2)))) +] + +@racketblock[ (let ((p (k2a (mouse-x kr 0 (buf-frames kr 0) 0 0.1)))) (audition (out 0 (buf-rd 1 ar 0 p 0 2)))) +] + diff --git a/doc/help/ugen/information/buf-rate-scale.help.scrbl b/doc/help/ugen/information/buf-rate-scale.help.scrbl index 226bfbc..85d025c 100644 --- a/doc/help/ugen/information/buf-rate-scale.help.scrbl +++ b/doc/help/ugen/information/buf-rate-scale.help.scrbl @@ -3,14 +3,22 @@ @title{(buf-rate-scale rate bufnum)} + Buffer rate scaling in respect to server samplerate. Returns a ratio by which the playback of a soundfile is to be scaled. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((r (mul (rand 0.5 2) (buf-rate-scale kr 0))) (p (phasor ar 0 r 0 (buf-frames kr 0) 0))) (audition (out 0 (buf-rd 1 ar 0 p 0 2)))) +] + diff --git a/doc/help/ugen/information/buf-sample-rate.help.scrbl b/doc/help/ugen/information/buf-sample-rate.help.scrbl index b784afd..d5d4a12 100644 --- a/doc/help/ugen/information/buf-sample-rate.help.scrbl +++ b/doc/help/ugen/information/buf-sample-rate.help.scrbl @@ -3,15 +3,23 @@ @title{(buf-sample-rate rate bufnum)} + Buffer sample rate. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] Compare a sine tone derived from sample rate of a buffer with a 440Hz tone. + +@racketblock[ (let ((freq (mce2 (mul (buf-sample-rate ir 0) 0.01) 440))) (audition (out 0 (mul (sin-osc ar freq 0) 0.1)))) +] + diff --git a/doc/help/ugen/information/num-audio-buses.help.scrbl b/doc/help/ugen/information/num-audio-buses.help.scrbl index aa9e24e..867c28b 100644 --- a/doc/help/ugen/information/num-audio-buses.help.scrbl +++ b/doc/help/ugen/information/num-audio-buses.help.scrbl @@ -4,3 +4,5 @@ @title{num-audio-buses} + + diff --git a/doc/help/ugen/information/num-buffers.help.scrbl b/doc/help/ugen/information/num-buffers.help.scrbl index a1fb439..ac5d010 100644 --- a/doc/help/ugen/information/num-buffers.help.scrbl +++ b/doc/help/ugen/information/num-buffers.help.scrbl @@ -4,3 +4,4 @@ @title{num-buffers} + diff --git a/doc/help/ugen/information/num-control-buses.help.scrbl b/doc/help/ugen/information/num-control-buses.help.scrbl index 569844a..c3b825d 100644 --- a/doc/help/ugen/information/num-control-buses.help.scrbl +++ b/doc/help/ugen/information/num-control-buses.help.scrbl @@ -4,3 +4,4 @@ @title{num-control-buses} + diff --git a/doc/help/ugen/information/num-input-buses.help.scrbl b/doc/help/ugen/information/num-input-buses.help.scrbl index fbaf7ab..ebdf478 100644 --- a/doc/help/ugen/information/num-input-buses.help.scrbl +++ b/doc/help/ugen/information/num-input-buses.help.scrbl @@ -3,10 +3,15 @@ @title{num-input-buses} + The number of audio buses allocated to input. input buses follow output buses which begin at zero. + +@racketblock[ (let ((bus (add num-output-buses num-input-buses))) (audition (mrg2 (out 0 (in 1 ar bus)) (out bus (mul (sin-osc ar 440 0) 0.1))))) +] + diff --git a/doc/help/ugen/information/num-output-buses.help.scrbl b/doc/help/ugen/information/num-output-buses.help.scrbl index 9164fef..c6201bf 100644 --- a/doc/help/ugen/information/num-output-buses.help.scrbl +++ b/doc/help/ugen/information/num-output-buses.help.scrbl @@ -3,9 +3,14 @@ @title{num-output-buses} + The number of audio buses allocated to output. + +@racketblock[ (let ((bus num-output-buses)) (audition (out 0 (mul (pulse ar 90 0.3) (amplitude kr (lag (in 1 ar bus) 0.1) 0.01 0.01))))) +] + diff --git a/doc/help/ugen/information/num-running-synths.help.scrbl b/doc/help/ugen/information/num-running-synths.help.scrbl index e98f2f8..276872b 100644 --- a/doc/help/ugen/information/num-running-synths.help.scrbl +++ b/doc/help/ugen/information/num-running-synths.help.scrbl @@ -3,9 +3,14 @@ @title{num-running-synths} + Number of currently running synths. + +@racketblock[ (audition (out 0 (mul (sin-osc ar (mul-add num-running-synths 200 400) 0) 0.1))) +] + diff --git a/doc/help/ugen/information/radians-per-sample.help.scrbl b/doc/help/ugen/information/radians-per-sample.help.scrbl index 9590c7c..b40e7c4 100644 --- a/doc/help/ugen/information/radians-per-sample.help.scrbl +++ b/doc/help/ugen/information/radians-per-sample.help.scrbl @@ -4,3 +4,4 @@ @title{radians-per-sample} + diff --git a/doc/help/ugen/information/sample-dur.help.scrbl b/doc/help/ugen/information/sample-dur.help.scrbl index add0828..381c7ed 100644 --- a/doc/help/ugen/information/sample-dur.help.scrbl +++ b/doc/help/ugen/information/sample-dur.help.scrbl @@ -3,10 +3,15 @@ @title{sample-dur} + Duration of one sample. Equivalent to 1 / sample-rate. Compare a sine tone derived from sample rate with a 440Hz tone. + +@racketblock[ (let ((freq (mce2 (mul (recip sample-dur) 0.01) 440))) (audition (out 0 (mul (sin-osc ar freq 0) 0.1)))) +] + diff --git a/doc/help/ugen/information/sample-rate.help.scrbl b/doc/help/ugen/information/sample-rate.help.scrbl index 442240b..2650059 100644 --- a/doc/help/ugen/information/sample-rate.help.scrbl +++ b/doc/help/ugen/information/sample-rate.help.scrbl @@ -3,10 +3,15 @@ @title{sample-rate} + Server sample rate. Compare a sine tone derived from sample rate with a 440Hz tone. + +@racketblock[ (let ((freq (mce2 (mul sample-rate 0.01) 440))) (audition (out 0 (mul (sin-osc ar freq 0) 0.1)))) +] + diff --git a/doc/help/ugen/information/subsample-offset.help.scrbl b/doc/help/ugen/information/subsample-offset.help.scrbl index b2d5175..478783b 100644 --- a/doc/help/ugen/information/subsample-offset.help.scrbl +++ b/doc/help/ugen/information/subsample-offset.help.scrbl @@ -3,6 +3,7 @@ @title{subsample-offset} + Offset from synth start within one sample. When a synth is created from a time stamped osc-bundle, it starts @@ -18,6 +19,8 @@ See also offset-out. Demonstrate cubic subsample interpolation. An impulse train that can be moved between samples. + +@racketblock[ (with-sc3 (lambda (fd) (send-synth @@ -32,12 +35,15 @@ can be moved between samples. (mouse-x kr 0 add-offset 0 0.1))) (r (delay-c i (mul d (add 1 x)) (mul d (add o x))))) (offset-out out r)))))) +] Create two pulse trains one sample apart, move one relative to the other. When cursor is at the left, the impulses are adjacent, on the right, they are exactly 1 sample apart. View this with an oscilloscope. + +@racketblock[ (with-sc3 (lambda (fd) (let ((t (utc)) @@ -46,4 +52,6 @@ oscilloscope. (list (s-new1 "s" -1 1 1 "addOffset" 3)))) (send fd (bundle (+ t 0.2 dt) (list (s-new1 "s" -1 1 1 "addOffset" 0))))))) +] + diff --git a/doc/help/ugen/io/in-feedback.help.scrbl b/doc/help/ugen/io/in-feedback.help.scrbl index ceb0e91..dde3793 100644 --- a/doc/help/ugen/io/in-feedback.help.scrbl +++ b/doc/help/ugen/io/in-feedback.help.scrbl @@ -3,6 +3,7 @@ @title{(in-feedback num-channels bus)} + Read signal from a bus without erasing it, audio rate. The output (out) ugens overwrite data on the bus, giving this bus a @@ -28,25 +29,39 @@ at the default block size and sample rate. Audio feedback modulation. + +@racketblock[ (let ((f (mul-add (in-feedback 1 0) 1300 300))) (audition (out 0 (mul (sin-osc ar f 0) 0.4)))) +] Evaluate these in either order and hear both tones. + +@racketblock[ (let ((b (add num-input-buses num-output-buses))) (audition (out 0 (in-feedback 1 b)))) +] + +@racketblock[ (let ((b (add num-input-buses num-output-buses))) (audition (mrg2 (out b (mul (sin-osc ar 440 0) 0.1)) (out 0 (mul (sin-osc ar 660 0) 0.1))))) +] Doubters consult this. + +@racketblock[ (let ((b (add num-input-buses num-output-buses))) (audition (out 0 (in 1 ar b)))) +] Resonator, see localout for variant. + +@racketblock[ (let* ((b (add num-input-buses num-output-buses)) (p (in-feedback 1 b)) (i (impulse ar 1 0)) @@ -54,8 +69,13 @@ Resonator, see localout for variant. 1 (sub (recip 440) (recip control-rate))))) (audition (mrg2 (offset-out b d) (offset-out 0 p)))) +] Compare with oscillator. -(audition (out 1 (mul (sin-osc ar 440 0) 0.2))) + +@racketblock[ +(audition (out 1 (mul (sin-osc ar 440 0) 0.2))) +] + diff --git a/doc/help/ugen/io/in-trig.help.scrbl b/doc/help/ugen/io/in-trig.help.scrbl index 0fe767b..6bb5457 100644 --- a/doc/help/ugen/io/in-trig.help.scrbl +++ b/doc/help/ugen/io/in-trig.help.scrbl @@ -3,6 +3,7 @@ @title{(in-trig num-channels bus)} + Generate a trigger anytime a bus is set. Any time the bus is "touched" ie. has its value set (using "/c_set" @@ -11,15 +12,22 @@ is the value that the bus was set to. Run an oscillator with the trigger at bus 10. + +@racketblock[ (let* ((t (in-trig 1 10)) (p (env-perc 0.01 1 1 (list -4 -4))) (e (env-gen kr t t 0 1 do-nothing p)) (f (mul-add (latch t t) 440 880))) (audition (out 0 (mul (sin-osc ar f 0) e)))) +] Set bus 10. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (c-set1 10 0.5)))) +] + diff --git a/doc/help/ugen/io/in.help.scrbl b/doc/help/ugen/io/in.help.scrbl index 975e247..86473e6 100644 --- a/doc/help/ugen/io/in.help.scrbl +++ b/doc/help/ugen/io/in.help.scrbl @@ -3,27 +3,44 @@ @title{(in num-channels rate bus)} + Read signal from an audio or control bus. Patching input to output. + +@racketblock[ (audition (out 0 (in 2 ar num-output-buses))) +] Patching input to output, with summed delay. + +@racketblock[ (let ((i (in 2 ar num-input-buses))) (audition (out 0 (add i (delay-n i 0.5 0.5))))) +] Write noise to bus 10, then read it out. The Mrg is ordered. + +@racketblock[ (audition (mrg2 (out 0 (in 1 ar 10)) (out 10 (mul (pink-noise ar) 0.3)))) +] Reading a control bus. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (c-set1 0 (random 200 5000))))) +] + +@racketblock[ (audition (out 0 (mul (sin-osc ar (in 1 kr 0) 0) 0.1))) +] + diff --git a/doc/help/ugen/io/lag-in.help.scrbl b/doc/help/ugen/io/lag-in.help.scrbl index 07956e1..4e2aef2 100644 --- a/doc/help/ugen/io/lag-in.help.scrbl +++ b/doc/help/ugen/io/lag-in.help.scrbl @@ -3,13 +3,21 @@ @title{(lag-in num-channels bus lag)} + Set bus 10. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (c-set1 10 (random 200 8000))))) +] Smooth a control rate input signal. -(audition (out 0 (mul (sin-osc ar (lag-in 1 10 1) 0) 0.1))) + +@racketblock[ +(audition (out 0 (mul (sin-osc ar (lag-in 1 10 1) 0) 0.1))) +] + diff --git a/doc/help/ugen/io/local-in.help.scrbl b/doc/help/ugen/io/local-in.help.scrbl index 05ba0a8..0acb82e 100644 --- a/doc/help/ugen/io/local-in.help.scrbl +++ b/doc/help/ugen/io/local-in.help.scrbl @@ -3,6 +3,7 @@ @title{(local-in num-channels rate)} + Define and read from buses local to a SynthDef num-channels - the number of channels of local buses. @@ -14,9 +15,13 @@ loop. There can only be one audio rate and one control rate Localin per SynthDef. The audio can be written to the bus using local-out. + +@racketblock[ (let* ((a0 (mul (decay (impulse ar 0.3 0) 0.1) (mul (white-noise ar) 0.2))) (a1 (add (local-in 2 ar) (mce2 a0 0))) (a2 (delay-n a1 0.2 0.2))) (audition (mrg2 (local-out (mul (mce-reverse a2) 0.8)) (out 0 a2)))) +] + diff --git a/doc/help/ugen/io/offset-out.help.scrbl b/doc/help/ugen/io/offset-out.help.scrbl index 8732dd3..3788e1b 100644 --- a/doc/help/ugen/io/offset-out.help.scrbl +++ b/doc/help/ugen/io/offset-out.help.scrbl @@ -3,14 +3,22 @@ @title{(offset-out bufferindex inputs)} + output signal to a bus, the sample offset within the bus is kept exactly. This ugen is used where sample accurate output is needed. + +@racketblock[ (audition (mrg2 (offset-out 0 (impulse ar 5 0)) (out 0 (mul (sin-osc ar 60 0) 0.1)))) +] + +@racketblock[ (audition (mrg2 (out 0 (impulse ar 5 0)) (out 0 (mul (sin-osc ar 60 0) 0.1)))) +] + diff --git a/doc/help/ugen/io/out.help.scrbl b/doc/help/ugen/io/out.help.scrbl index 4f9eb94..6f15ca0 100644 --- a/doc/help/ugen/io/out.help.scrbl +++ b/doc/help/ugen/io/out.help.scrbl @@ -3,9 +3,14 @@ @title{(out bufferindex inputs)} + Send signal to an audio or control buss, mix with existing signal. The user is responsible for making sure that the number of channels match and that there are no conflicts. -(audition (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1))) + +@racketblock[ +(audition (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1))) +] + diff --git a/doc/help/ugen/io/replace-out.help.scrbl b/doc/help/ugen/io/replace-out.help.scrbl index dbc9a79..9c72012 100644 --- a/doc/help/ugen/io/replace-out.help.scrbl +++ b/doc/help/ugen/io/replace-out.help.scrbl @@ -3,17 +3,25 @@ @title{(replace-out bufferindex inputs)} + Send signal to a bus, overwrite existing signal. + +@racketblock[ (audition (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)) (replace-out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1)) (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1)))) +] Compare to: + +@racketblock[ (audition (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)) (out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1)) (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1)))) +] + diff --git a/doc/help/ugen/io/sound-in.help.scrbl b/doc/help/ugen/io/sound-in.help.scrbl index d987724..4f3bccf 100644 --- a/doc/help/ugen/io/sound-in.help.scrbl +++ b/doc/help/ugen/io/sound-in.help.scrbl @@ -3,14 +3,25 @@ @title{(sound-in channel)} + Read audio from the sound input hardware. channel - input channel number to read, indexed from zero, can be mce. + +@racketblock[ (audition (out 0 (sound-in 0))) +] + +@racketblock[ (audition (out 0 (sound-in (mce2 0 1)))) +] + +@racketblock[ (audition (out 0 (sound-in (mce4 0 2 1 3)))) +] + diff --git a/doc/help/ugen/io/x-out.help.scrbl b/doc/help/ugen/io/x-out.help.scrbl index 15c2940..d8f123b 100644 --- a/doc/help/ugen/io/x-out.help.scrbl +++ b/doc/help/ugen/io/x-out.help.scrbl @@ -3,12 +3,17 @@ @title{(x-out buffer-index xfade inputs)} + Send signal to a bus, crossfading with existing contents. + +@racketblock[ (let ((pair (lambda (a b) (mul (sin-osc ar (mce2 a b) 0) 0.1)))) (audition (mrg4 (out 0 (pair 220 221)) (x-out 0 (mouse-x kr 0 1 0 0.1) (pair 330 331)) (x-out 0 (mouse-y kr 0 1 0 0.1) (pair 440 441)) (out 0 (pair 120 121))))) +] + diff --git a/doc/help/ugen/noise/brown-noise.help.scrbl b/doc/help/ugen/noise/brown-noise.help.scrbl index 6446dde..4d79582 100644 --- a/doc/help/ugen/noise/brown-noise.help.scrbl +++ b/doc/help/ugen/noise/brown-noise.help.scrbl @@ -3,8 +3,13 @@ @title{(brown-noise rate)} + Generates noise whose spectrum falls off in power by 6 dB per octave. -(audition (out 0 (mul (brown-noise ar) 0.1))) + +@racketblock[ +(audition (out 0 (mul (brown-noise ar) 0.1))) +] + diff --git a/doc/help/ugen/noise/clip-noise.help.scrbl b/doc/help/ugen/noise/clip-noise.help.scrbl index 703931a..1696d47 100644 --- a/doc/help/ugen/noise/clip-noise.help.scrbl +++ b/doc/help/ugen/noise/clip-noise.help.scrbl @@ -3,8 +3,13 @@ @title{(clip-noise rate)} + Generates noise whose values are either -1 or 1. This produces the maximum energy for the least peak to peak amplitude. -(audition (out 0 (mul (clip-noise ar) 0.2))) + +@racketblock[ +(audition (out 0 (mul (clip-noise ar) 0.2))) +] + diff --git a/doc/help/ugen/noise/coin-gate.help.scrbl b/doc/help/ugen/noise/coin-gate.help.scrbl index 2d99dcf..9ad41bf 100644 --- a/doc/help/ugen/noise/coin-gate.help.scrbl +++ b/doc/help/ugen/noise/coin-gate.help.scrbl @@ -3,12 +3,18 @@ @title{(coin-gate prob in)} + When it receives a trigger, it tosses a coin, and either passes the trigger or doesn't. + +@racketblock[ (let ((f (t-rand 300 400 (Coingate 0.8 (impulse kr 10 0))))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + +@racketblock[ (let* ((p 0.2) (t (mul (impulse ar 20 0) (add (sin-osc kr 0.5 0) 1))) (t* (t-exp-rand (Mce 1000 1000) 12000 t)) @@ -16,4 +22,6 @@ trigger or doesn't. (s (lambda () (ringz (i) t* 0.01))) (ignore (lambda (f) (lambda (_) (f))))) (audition (out 0 (mix/fill 3 (ignore s))))) +] + diff --git a/doc/help/ugen/noise/dust.help.scrbl b/doc/help/ugen/noise/dust.help.scrbl index c711b5b..532167a 100644 --- a/doc/help/ugen/noise/dust.help.scrbl +++ b/doc/help/ugen/noise/dust.help.scrbl @@ -3,11 +3,19 @@ @title{(dust rate density)} + Generates random impulses from 0 to +1 at a rate determined by the density argument. -(audition (out 0 (mul (dust ar 200) 0.5))) +@racketblock[ +(audition (out 0 (mul (dust ar 200) 0.5))) +] + + +@racketblock[ (let ((r (x-line kr 20000 2 10 remove-synth))) (audition (out 0 (mul (dust ar r) 0.5)))) +] + diff --git a/doc/help/ugen/noise/dust2.help.scrbl b/doc/help/ugen/noise/dust2.help.scrbl index af485d7..42937ac 100644 --- a/doc/help/ugen/noise/dust2.help.scrbl +++ b/doc/help/ugen/noise/dust2.help.scrbl @@ -3,11 +3,19 @@ @title{(dust2 rate density)} + Generates random impulses from -1 to +1. The `density' is in impulses per second. -(audition (out 0 (mul (dust2 ar 200) 0.5))) +@racketblock[ +(audition (out 0 (mul (dust2 ar 200) 0.5))) +] + + +@racketblock[ (let ((r (x-line kr 20000 2 10 remove-synth))) (audition (out 0 (mul (dust2 ar r) 0.5)))) +] + diff --git a/doc/help/ugen/noise/exp-rand.help.scrbl b/doc/help/ugen/noise/exp-rand.help.scrbl index 3c5ec2d..8be126d 100644 --- a/doc/help/ugen/noise/exp-rand.help.scrbl +++ b/doc/help/ugen/noise/exp-rand.help.scrbl @@ -3,10 +3,15 @@ @title{(exp-rand lo hi)} + Generates a single random float value in an exponential distributions from `lo' to `hi'. + +@racketblock[ (let ((f (exp-rand 100 8000)) (a (line kr 0.5 0 0.01 remove-synth))) (audition (out 0 (mul (f-sin-osc ar f 0) a)))) +] + diff --git a/doc/help/ugen/noise/gray-noise.help.scrbl b/doc/help/ugen/noise/gray-noise.help.scrbl index ea0218d..6bba83a 100644 --- a/doc/help/ugen/noise/gray-noise.help.scrbl +++ b/doc/help/ugen/noise/gray-noise.help.scrbl @@ -3,9 +3,14 @@ @title{(gray-noise rate)} + Generates noise which results from flipping random bits in a word. This type of noise has a high RMS level relative to its peak to peak level. The spectrum is emphasized towards lower frequencies. -(audition (out 0 (mul (gray-noise ar) 0.1))) + +@racketblock[ +(audition (out 0 (mul (gray-noise ar) 0.1))) +] + diff --git a/doc/help/ugen/noise/hasher.help.scrbl b/doc/help/ugen/noise/hasher.help.scrbl index c0d7a1c..7142e55 100644 --- a/doc/help/ugen/noise/hasher.help.scrbl +++ b/doc/help/ugen/noise/hasher.help.scrbl @@ -3,10 +3,15 @@ @title{(hasher in)} + Returns a unique output value from zero to one for each input value according to a hash function. The same input value will always produce the same output value. The input need not be from zero to one. -(audition (out 0 (mul (hasher (line ar 0 1 1 2)) 0.2))) + +@racketblock[ +(audition (out 0 (mul (hasher (line ar 0 1 1 2)) 0.2))) +] + diff --git a/doc/help/ugen/noise/i-rand.help.scrbl b/doc/help/ugen/noise/i-rand.help.scrbl index ef4c121..10937ba 100644 --- a/doc/help/ugen/noise/i-rand.help.scrbl +++ b/doc/help/ugen/noise/i-rand.help.scrbl @@ -3,10 +3,15 @@ @title{(i-rand lo hi)} + Generates a single random integer value in uniform distribution from `lo' to `hi'. + +@racketblock[ (let ((f (i-rand 200 1200)) (a (line kr 0.2 0 0.1 remove-synth))) (audition (out 0 (mul (f-sin-osc ar f 0) a)))) +] + diff --git a/doc/help/ugen/noise/lf-clip-noise.help.scrbl b/doc/help/ugen/noise/lf-clip-noise.help.scrbl index 489a449..5c47294 100644 --- a/doc/help/ugen/noise/lf-clip-noise.help.scrbl +++ b/doc/help/ugen/noise/lf-clip-noise.help.scrbl @@ -3,20 +3,31 @@ @title{(lfclip-noise rate freq)} + randomly generates the values -1 or +1 at a rate given by the nearest integer division of the sample rate by the freq argument. It is probably pretty hard on your speakers. The freq argument is the approximate rate at which to generate random values. + +@racketblock[ (audition (out 0 (mul (lfclip-noise ar 1000) 0.1))) +] Modulate frequency + +@racketblock[ (let ((f (x-line kr 1000 10000 10 remove-synth))) (audition (out 0 (mul (lfclip-noise ar f) 0.1)))) +] Use as frequency control + +@racketblock[ (let ((f (mul-add (lfclip-noise kr 4) 200 600))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/noise/lf-noise0.help.scrbl b/doc/help/ugen/noise/lf-noise0.help.scrbl index 5c75404..bc189ed 100644 --- a/doc/help/ugen/noise/lf-noise0.help.scrbl +++ b/doc/help/ugen/noise/lf-noise0.help.scrbl @@ -18,19 +18,47 @@ lf-noise2 is quadratic noise. Generates quadratically interpolated random values at a rate given by the nearest integer division of the sample rate by the freq argument. + +@racketblock[ (audition (out 0 (mul (lf-noise0 ar 1000) 0.25))) +] + +@racketblock[ (audition (out 0 (mul (lf-noise1 ar 1000) 0.25))) +] + +@racketblock[ (audition (out 0 (mul (lf-noise2 ar 1000) 0.25))) +] Modulate frequency. + +@racketblock[ (audition (out 0 (mul (lf-noise0 ar (x-line kr 1000 10000 10 remove-synth)) 0.25))) +] + +@racketblock[ (audition (out 0 (mul (lf-noise1 ar (x-line kr 1000 10000 10 remove-synth)) 0.25))) +] + +@racketblock[ (audition (out 0 (mul (lf-noise2 ar (x-line kr 1000 10000 10 remove-synth)) 0.25))) +] Use as frequency control. -(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise0 kr 4) 400 450) 0) 0.2))) -(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise1 kr 4) 400 450) 0) 0.2))) -(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise2 kr 4) 400 450) 0) 0.2))) + +@racketblock[ +(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise0 kr 4) 400 450) 0) 0.2))) +] + +@racketblock[ +(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise1 kr 4) 400 450) 0) 0.2))) +] + +@racketblock[ +(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise2 kr 4) 400 450) 0) 0.2))) +] + diff --git a/doc/help/ugen/noise/lf-noise1.help.scrbl b/doc/help/ugen/noise/lf-noise1.help.scrbl index 25959b3..f2d034f 100644 --- a/doc/help/ugen/noise/lf-noise1.help.scrbl +++ b/doc/help/ugen/noise/lf-noise1.help.scrbl @@ -4,3 +4,4 @@ @title{See lf-noise0} + diff --git a/doc/help/ugen/noise/lf-noise2.help.scrbl b/doc/help/ugen/noise/lf-noise2.help.scrbl index 25959b3..f2d034f 100644 --- a/doc/help/ugen/noise/lf-noise2.help.scrbl +++ b/doc/help/ugen/noise/lf-noise2.help.scrbl @@ -4,3 +4,4 @@ @title{See lf-noise0} + diff --git a/doc/help/ugen/noise/lfd-clip-noise.help.scrbl b/doc/help/ugen/noise/lfd-clip-noise.help.scrbl index f0a8679..451051c 100644 --- a/doc/help/ugen/noise/lfd-clip-noise.help.scrbl +++ b/doc/help/ugen/noise/lfd-clip-noise.help.scrbl @@ -3,6 +3,7 @@ @title{(lfdclip-noise rate freq)} + Like lfclip-noise, it generates the values -1 or +1 at a rate given by the freq argument, with two differences: no time quantization, and fast recovery from low freq values. @@ -15,20 +16,33 @@ low). If you don't need very high or very low freqs, or use fixed freqs, lfclip-noise is more efficient. -Try wiggling mouse quicklyLFNoise frequently seems stuck, +Try wiggling mouse quickly; LFNoise frequently seems stuck, LFDNoise changes smoothly. + +@racketblock[ (let ((f (mul-add (lfclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + +@racketblock[ (let ((f (mul-add (lfdclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] LFNoise quantizes time steps at high freqs, LFDNoise does not: + +@racketblock[ (let ((f (x-line kr 1000 20000 10 remove-synth))) (audition (out 0 (mul (lfclip-noise ar f) 0.1)))) +] + +@racketblock[ (let ((f (x-line kr 1000 20000 10 remove-synth))) (audition (out 0 (mul (lfdclip-noise ar f) 0.1)))) +] + diff --git a/doc/help/ugen/noise/lfd-noise0.help.scrbl b/doc/help/ugen/noise/lfd-noise0.help.scrbl index 3c86205..2fc54c0 100644 --- a/doc/help/ugen/noise/lfd-noise0.help.scrbl +++ b/doc/help/ugen/noise/lfd-noise0.help.scrbl @@ -27,28 +27,47 @@ and thus seem to hang when freqs get very low). If you don't need very high or very low freqs, or use fixed freqs, lf-noise0,1,3 is more efficient. -Try wiggling mouse quicklyLf-Noise frequently seems stuck, +Try wiggling mouse quickly; Lf-Noise frequently seems stuck, LFDNoise changes smoothly. + +@racketblock[ (audition (out 0 (mul (lf-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1))) +] + +@racketblock[ (audition (out 0 (mul (lfd-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1))) +] silent for 2 secs before going up in freq + +@racketblock[ (audition (out 0 (mul (lf-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1))) +] + +@racketblock[ (audition (out 0 (mul (lfd-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1))) +] lf-noise quantizes time steps at high freqs, lfd-noise does not: + +@racketblock[ (audition (out 0 (mul (lf-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1))) +] + +@racketblock[ (audition (out 0 (mul (lfd-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1))) +] + diff --git a/doc/help/ugen/noise/lfd-noise1.help.scrbl b/doc/help/ugen/noise/lfd-noise1.help.scrbl index 20f93aa..7153a24 100644 --- a/doc/help/ugen/noise/lfd-noise1.help.scrbl +++ b/doc/help/ugen/noise/lfd-noise1.help.scrbl @@ -4,3 +4,5 @@ @title{See lfd-noise0} + + diff --git a/doc/help/ugen/noise/lfd-noise3.help.scrbl b/doc/help/ugen/noise/lfd-noise3.help.scrbl index 20f93aa..acd2799 100644 --- a/doc/help/ugen/noise/lfd-noise3.help.scrbl +++ b/doc/help/ugen/noise/lfd-noise3.help.scrbl @@ -4,3 +4,4 @@ @title{See lfd-noise0} + diff --git a/doc/help/ugen/noise/lin-rand.help.scrbl b/doc/help/ugen/noise/lin-rand.help.scrbl index 35edb32..ce988e1 100644 --- a/doc/help/ugen/noise/lin-rand.help.scrbl +++ b/doc/help/ugen/noise/lin-rand.help.scrbl @@ -3,11 +3,16 @@ @title{(lin-rand lo hi minmax)} + Generates a single random float value in linear distribution from lo to hi, skewed towards lo if minmax < 0, otherwise skewed towards hi. + +@racketblock[ (let ((f (lin-rand 200 10000 (mce2 -1 1))) (a (line kr 0.4 0 0.01 remove-synth))) (audition (out 0 (mul (f-sin-osc ar f 0) a)))) +] + diff --git a/doc/help/ugen/noise/mantissa-mask.help.scrbl b/doc/help/ugen/noise/mantissa-mask.help.scrbl index 1234725..ee1fd1f 100644 --- a/doc/help/ugen/noise/mantissa-mask.help.scrbl +++ b/doc/help/ugen/noise/mantissa-mask.help.scrbl @@ -3,6 +3,7 @@ @title{(mantissa-mask in bits)} + Masks off bits in the mantissa of the floating point sample value. This introduces a quantization noise, but is less severe than linearly quantizing the signal. @@ -10,6 +11,10 @@ than linearly quantizing the signal. in - input signal bits - the number of mantissa bits to preserve. a number from 0 to 23. + +@racketblock[ (let ((s (mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 500) 0) 0.4))) (audition (out 0 (mantissa-mask s 3)))) +] + diff --git a/doc/help/ugen/noise/n-rand.help.scrbl b/doc/help/ugen/noise/n-rand.help.scrbl index 8fb1b4f..fd1ad7d 100644 --- a/doc/help/ugen/noise/n-rand.help.scrbl +++ b/doc/help/ugen/noise/n-rand.help.scrbl @@ -3,6 +3,7 @@ @title{(n-rand lo hi n)} + Generates a single random float value in a sum of `n' uniform distributions from `lo' to `hi'. @@ -11,7 +12,11 @@ n = 2 : triangular distribution n = 3 : smooth hump as n increases, distribution converges towards gaussian + +@racketblock[ (let ((f (mul (n-rand 1200 4000 2) (mce2 2 5))) (a (line kr 0.2 0 0.01 remove-synth))) (audition (out 0 (mul (f-sin-osc ar f 0) a)))) +] + diff --git a/doc/help/ugen/noise/pink-noise.help.scrbl b/doc/help/ugen/noise/pink-noise.help.scrbl index 2fdd928..e878f7d 100644 --- a/doc/help/ugen/noise/pink-noise.help.scrbl +++ b/doc/help/ugen/noise/pink-noise.help.scrbl @@ -3,9 +3,14 @@ @title{(pink-noise rate)} + Generates noise whose spectrum falls off in power by 3 dB per octave. This gives equal power over the span of each octave. This version gives 8 octaves of pink noise. -(audition (out 0 (mul (pink-noise ar) 0.25))) + +@racketblock[ +(audition (out 0 (mul (pink-noise ar) 0.25))) +] + diff --git a/doc/help/ugen/noise/rand-id.help.scrbl b/doc/help/ugen/noise/rand-id.help.scrbl index e07439c..e1d4745 100644 --- a/doc/help/ugen/noise/rand-id.help.scrbl +++ b/doc/help/ugen/noise/rand-id.help.scrbl @@ -3,6 +3,7 @@ @title{(rand-id rate id)} + Choose which random number generator to use for this synth. All synths that use the same generator reproduce the same sequence of numbers when the same seed is set again. @@ -12,6 +13,8 @@ See also: rand-seed. Graphs to generate noise in the context of a given RNG and to reset a specified RNG. + +@racketblock[ (with-sc3 (lambda (fd) (send-synth @@ -28,27 +31,41 @@ a specified RNG. (rand-seed kr (impulse kr (mul-add (f-sin-osc kr 0.2 0) 10 11) 0) seed)))))) +] Start two noise synths on left and right channel with a different randgen id + +@racketblock[ (with-sc3 (lambda (fd) (send fd (s-new2 "r" 1001 1 1 "bus" 0 "id" 1)) (send fd (s-new2 "r" 1002 1 1 "bus" 1 "id" 2)))) +] Reset the seed of randgen 1 + +@racketblock[ (with-sc3 (lambda (fd) (send fd (s-new1 "s" 1003 1 1 "id" 1)))) +] Change the target RNG with ID 2, ie. effect right channel. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-set1 1003 "id" 2)))) +] free noise nodes. + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-free1 1001)) (send fd (n-free1 1002)) (send fd (n-free1 1003)))) +] + diff --git a/doc/help/ugen/noise/rand-seed.help.scrbl b/doc/help/ugen/noise/rand-seed.help.scrbl index 668f168..c0a9ac4 100644 --- a/doc/help/ugen/noise/rand-seed.help.scrbl +++ b/doc/help/ugen/noise/rand-seed.help.scrbl @@ -3,6 +3,7 @@ @title{(rand-seed rate trig seed)} + When the trigger signal changes from nonpositive to positve, the synth's random generator seed is reset to the given value. All other synths that use the same random number generator reproduce @@ -12,12 +13,19 @@ See also: randID. Start a noise patch + +@racketblock[ (let ((n (add (mul (white-noise ar) (mce2 0.05 0.05)) (dust2 ar (mce2 70 70)))) (f (mul-add (lf-noise1 kr 3) 5500 6000))) (audition (out 0 (add (resonz (mul n 5) f 0.5) (mul n 0.5))))) +] Reset the seed at a variable rate. + +@racketblock[ (audition (mrg2 (rand-seed kr (impulse kr (mouse-x kr 0.1 100 0 0.1) 0) 1956) 0)) +] + diff --git a/doc/help/ugen/noise/rand.help.scrbl b/doc/help/ugen/noise/rand.help.scrbl index 2d1cb00..3e987b3 100644 --- a/doc/help/ugen/noise/rand.help.scrbl +++ b/doc/help/ugen/noise/rand.help.scrbl @@ -3,12 +3,17 @@ @title{(rand lo hi)} + Generates a single random value in uniform distribution from lo to hi. It generates this when the SynthDef first starts playing, and remains fixed for the duration of the synth's existence. + +@racketblock[ (let* ((a (line kr 0.2 0 0.1 2)) (p (rand -1 1)) (s (mul (f-sin-osc ar (rand 200 1200) 0) a))) (audition (out 0 (pan2 s p 1)))) +] + diff --git a/doc/help/ugen/noise/t-exp-rand.help.scrbl b/doc/help/ugen/noise/t-exp-rand.help.scrbl index 661c542..9396f88 100644 --- a/doc/help/ugen/noise/t-exp-rand.help.scrbl +++ b/doc/help/ugen/noise/t-exp-rand.help.scrbl @@ -3,12 +3,17 @@ @title{(t-exp-rand lo hi trig)} + Generates a random float value in exponential distribution from lo to hi each time the trig signal changes from nonpositive to positive values lo and hi must both have the same sign and be non-zero. + +@racketblock[ (let* ((t (dust kr 10)) (f (t-exp-rand 300 3000 t))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/noise/t-rand.help.scrbl b/doc/help/ugen/noise/t-rand.help.scrbl index 0f2a557..82e80df 100644 --- a/doc/help/ugen/noise/t-rand.help.scrbl +++ b/doc/help/ugen/noise/t-rand.help.scrbl @@ -3,10 +3,15 @@ @title{(t-rand lo hi trig)} + Generates a random float value in uniform distribution from lo each time the trig signal changes from nonpositive to positive values + +@racketblock[ (let* ((t (dust kr (mce2 5 12))) (f (t-rand (mce2 200 1600) (mce2 500 3000) t))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/noise/ti-rand.help.scrbl b/doc/help/ugen/noise/ti-rand.help.scrbl index 6959253..e56bfd0 100644 --- a/doc/help/ugen/noise/ti-rand.help.scrbl +++ b/doc/help/ugen/noise/ti-rand.help.scrbl @@ -3,13 +3,21 @@ @title{(ti-rand lo hi trig)} + Generates a random integer value in uniform distribution from lo to hi each time the trig signal changes from nonpositive to positive values + +@racketblock[ (let ((p (ti-rand -1 1 (dust kr 10)))) (audition (out 0 (pan2 (pink-noise ar) p 0.2)))) +] + +@racketblock[ (let ((f (mul-add (ti-rand 4 12 (dust kr 10)) 150 (mce2 0 1)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/noise/white-noise.help.scrbl b/doc/help/ugen/noise/white-noise.help.scrbl index e244b4f..bd746d7 100644 --- a/doc/help/ugen/noise/white-noise.help.scrbl +++ b/doc/help/ugen/noise/white-noise.help.scrbl @@ -3,15 +3,26 @@ @title{(white-noise rate)} + Generates noise whose spectrum has equal power at all frequencies. + +@racketblock[ (audition (out 0 (mul (white-noise ar) 0.15))) +] Noise generators constructors are unique, to share noise UGens values must be explictly stored and reused. -(audition (out 0 (mul (sub (white-noise ar) (white-noise ar)) 0.15))) +@racketblock[ +(audition (out 0 (mul (sub (white-noise ar) (white-noise ar)) 0.15))) +] + + +@racketblock[ (let ((n (white-noise ar))) (audition (out 0 (sub n n)))) +] + diff --git a/doc/help/ugen/oscillators/blip.help.scm b/doc/help/ugen/oscillators/blip.help.scm index 272db61..5e50af1 100644 --- a/doc/help/ugen/oscillators/blip.help.scm +++ b/doc/help/ugen/oscillators/blip.help.scm @@ -1,3 +1,4 @@ +;; blip (import (rsc3)) (audition (out 0 (mul (blip ar 440 200) 0.15))) diff --git a/doc/help/ugen/oscillators/blip.help.scrbl b/doc/help/ugen/oscillators/blip.help.scrbl index eba03c9..8a59e70 100644 --- a/doc/help/ugen/oscillators/blip.help.scrbl +++ b/doc/help/ugen/oscillators/blip.help.scrbl @@ -1,15 +1,30 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (rsc3)) +@title{blip} -(audition (out 0 (mul (blip ar 440 200) 0.15)))} + +@racketblock[ +(import (rsc3)) +] + + +@racketblock[ +(audition (out 0 (mul (blip ar 440 200) 0.15))) +] Modulate frequency + +@racketblock[ (let ((f (x-line kr 20000 200 6 remove-synth))) (audition (out 0 (mul (blip ar f 100) 0.2)))) +] Modulate number of harmonics. + +@racketblock[ (let ((h (line kr 1 100 20 remove-synth))) (audition (out 0 (mul (blip ar 200 h) 0.2)))) +] + diff --git a/doc/help/ugen/oscillators/buf-wr.help.scm b/doc/help/ugen/oscillators/buf-wr.help.scm index 02490bf..a5e3b7c 100644 --- a/doc/help/ugen/oscillators/buf-wr.help.scm +++ b/doc/help/ugen/oscillators/buf-wr.help.scm @@ -1,4 +1,4 @@ -(import (sosc) (rsc3)) +;; buf-wr (let ((a (letc ((r 1)) (let* ((r* (mul (buf-rate-scale kr 0) r)) diff --git a/doc/help/ugen/oscillators/buf-wr.help.scrbl b/doc/help/ugen/oscillators/buf-wr.help.scrbl index 7a6c548..d362cde 100644 --- a/doc/help/ugen/oscillators/buf-wr.help.scrbl +++ b/doc/help/ugen/oscillators/buf-wr.help.scrbl @@ -1,8 +1,11 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (sosc) (rsc3)) +@title{buf-wr} + + +@racketblock[ (let ((a (letc ((r 1)) (let* ((r* (mul (buf-rate-scale kr 0) r)) (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) @@ -21,14 +24,27 @@ (send-synth fd "b" b) (send fd (s-new0 "a" 1001 1 0)) (send fd (s-new0 "b" 1002 1 0))))) +] + +@racketblock[ (define (do-send m) (with-sc3 (lambda (fd) (send fd m)))) +] + +@racketblock[ (do-send (n-set1 1002 "r" 5)) +] + +@racketblock[ (do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))} +] + + +@racketblock[ +(do-send (n-set1 1002 "r" 2)) +] diff --git a/doc/help/ugen/oscillators/c-osc.help.scm b/doc/help/ugen/oscillators/c-osc.help.scm index 3c2a00b..15b6548 100644 --- a/doc/help/ugen/oscillators/c-osc.help.scm +++ b/doc/help/ugen/oscillators/c-osc.help.scm @@ -1,3 +1,4 @@ +;; c-osc (import (rsc3)) (with-sc3 diff --git a/doc/help/ugen/oscillators/c-osc.help.scrbl b/doc/help/ugen/oscillators/c-osc.help.scrbl index e82b600..d79980e 100644 --- a/doc/help/ugen/oscillators/c-osc.help.scrbl +++ b/doc/help/ugen/oscillators/c-osc.help.scrbl @@ -1,17 +1,35 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (rsc3)) +@title{c-osc} + +@racketblock[ +(import (rsc3)) +] + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 512 1)) (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) +] + +@racketblock[ (audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) +] -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))} + +@racketblock[ +(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25))) +] Compare with: -(audition (out 0 (mul (osc ar 10 200 0.0) 0.25))) + +@racketblock[ +(audition (out 0 (mul (osc ar 10 200 0.0) 0.25))) +] + diff --git a/doc/help/ugen/oscillators/f-sin-osc.help.scrbl b/doc/help/ugen/oscillators/f-sin-osc.help.scrbl index 0980fa8..6d915c0 100644 --- a/doc/help/ugen/oscillators/f-sin-osc.help.scrbl +++ b/doc/help/ugen/oscillators/f-sin-osc.help.scrbl @@ -1,18 +1,32 @@ #lang scribble/manual @(require (for-label racket)) -@title{SC2: Note extra iphase argument. +@title{SC2: Note extra iphase argument.} + + +@racketblock[ (import (rsc3)) +] + +@racketblock[ (audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) +] + +@racketblock[ (let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))} + (audition (out 0 (mul (f-sin-osc ar f 0) 0.25)))) +] Loses amplitude towards the end + +@racketblock[ (let ((f (mul-add (f-sin-osc ar (x-line kr 4 401 8 remove-synth) 0) 200 800))) (audition (out 0 (mul (f-sin-osc ar f 0) 0.25)))) +] + diff --git a/doc/help/ugen/oscillators/formant.help.scm b/doc/help/ugen/oscillators/formant.help.scm index ca80e40..1b87759 100644 --- a/doc/help/ugen/oscillators/formant.help.scm +++ b/doc/help/ugen/oscillators/formant.help.scm @@ -1,3 +1,4 @@ +;; formant (import (rsc3)) ;; Modulate fundamental frequency, formant frequency stays constant. diff --git a/doc/help/ugen/oscillators/formant.help.scrbl b/doc/help/ugen/oscillators/formant.help.scrbl index 5c9cf28..c7e4dec 100644 --- a/doc/help/ugen/oscillators/formant.help.scrbl +++ b/doc/help/ugen/oscillators/formant.help.scrbl @@ -1,20 +1,35 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (rsc3))} +@title{formant} + + +@racketblock[ +(import (rsc3)) +] Modulate fundamental frequency, formant frequency stays constant. + +@racketblock[ (audition (let ((f (x-line kr 400 1000 8 remove-synth))) (out 0 (mul (formant ar f 2000 800) 0.125)))) +] Modulate formant frequency, fundamental frequency stays constant. + +@racketblock[ (audition (let ((f (x-line kr 400 4000 8 remove-synth))) (out 0 (mul (formant ar (mce2 200 300) f 200) 0.125)))) +] Modulate width frequency, other frequencies stay constant. + +@racketblock[ (audition (let ((w (x-line kr 800 8000 8 remove-synth))) (out 0 (mul (formant ar 400 2000 w) 0.125)))) +] + diff --git a/doc/help/ugen/oscillators/gendy1.help.scm b/doc/help/ugen/oscillators/gendy1.help.scm index 7dd0ebf..f0fd9d7 100644 --- a/doc/help/ugen/oscillators/gendy1.help.scm +++ b/doc/help/ugen/oscillators/gendy1.help.scm @@ -1,4 +1,4 @@ -(import (rsc3)) +;; gendy1 ;; sclang defaults (audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 12) 0 0.15))) diff --git a/doc/help/ugen/oscillators/gendy1.help.scrbl b/doc/help/ugen/oscillators/gendy1.help.scrbl index 2919984..e748eb6 100644 --- a/doc/help/ugen/oscillators/gendy1.help.scrbl +++ b/doc/help/ugen/oscillators/gendy1.help.scrbl @@ -1,77 +1,119 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (rsc3))} +@title{gendy1} + sclang defaults + +@racketblock[ (audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 12) 0 0.15))) +] Wandering bass + +@racketblock[ (audition (out 0 (pan2 (gendy1 ar 1 1 1.0 1.0 30 100 0.3 0.05 5 5) 0 0.15))) +] Play me + +@racketblock[ (let* ((x (mouse-x* kr 100 1000 1 0.1)) (g (gendy1 ar 2 3 1 1 20 x 0.5 0.0 40 40))) (audition (out 0 (pan2 (mul (rlpf g 500 0.3) 0.2) 0.0 0.25)))) +] Scream! + +@racketblock[ (let ((x (mouse-x kr 220 440 1 0.1)) (y (mouse-y kr 0.0 1.0 0 0.1))) (audition (out 0 (pan2 (gendy1 ar 2 3 1 1 x (mul 8 x) y y 7 7) 0.0 0.3)))) +] 1 CP = random noise + +@racketblock[ (audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 1 1) 0 0.15))) +] 2 CPs = an oscillator + +@racketblock[ (audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 2 2) 0 0.15))) +] Used as an LFO + +@racketblock[ (let* ((ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51)) (dd (mul-add (sin-osc kr 0.13 0) 0.49 0.51)) (as (mul-add (sin-osc kr 0.17 0) 0.49 0.51)) (ds (mul-add (sin-osc kr 0.19 0) 0.49 0.51)) (g (gendy1 kr 2 4 ad dd 3.4 3.5 as ds 10 10))) (audition (out 0 (pan2 (sin-osc ar (mul-add g 50 350) 0) 0.0 0.3)))) +] Wasp + +@racketblock[ (let ((ad (mul-add (sin-osc kr 0.1 0) 0.1 0.9))) (audition (out 0 (pan2 (gendy1 ar 0 0 ad 1.0 50 1000 1 0.005 12 12) 0.0 0.2)))) +] Modulate distributions. Change of pitch as distributions change the duration structure and spectrum + +@racketblock[ (let* ((x (mouse-x* kr 0 7 0 0.1)) (y (mouse-y* kr 0 7 0 0.1)) (g (gendy1 ar x y 1 1 440 660 0.5 0.5 12 12))) (audition (out 0 (pan2 g 0 0.2)))) +] Modulate number of CPs. + +@racketblock[ (let* ((x (mouse-x* kr 1 13 0 0.1)) (g (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 x))) (audition (out 0 (pan2 g 0 0.2)))) +] Self modulation. + +@racketblock[ (let* ((x (mouse-x* kr 1 13 0 0.1)) (y (mouse-y* kr 0.1 10 0 0.1)) (g0 (gendy1 kr 5 4 0.3 0.7 0.1 y 1.0 1.0 5 5)) (g1 (gendy1 ar 1 1 1 1 440 (mul-add g0 500 600) 0.5 0.5 12 x))) (audition (out 0 (pan2 g1 0.0 0.2)))) +] Use SINUS to track any oscillator and take CP positions from it use adparam and ddparam as the inputs to sample. + +@racketblock[ (let* ((p (lf-pulse kr 100 0 0.4)) (s (mul (sin-osc kr 30 0) 0.5)) (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12))) (audition (out 0 (pan2 g 0.0 0.2)))) +] Near the corners are interesting. + +@racketblock[ (let* ((x (mouse-x* kr 0 200 0 0.1)) (y (mouse-y* kr 0 200 0 0.1)) (p (lf-pulse kr x 0 0.4)) (s (mul (sin-osc kr y 0) 0.5)) (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12))) (audition (out 0 (pan2 g 0.0 0.2)))) +] Texture + +@racketblock[ (let* ((o (let* ((f (rand 130.0 160.3)) (ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51)) @@ -84,14 +126,20 @@ Texture 0.1))) (x (mix-fill 10 (lambda (_) o)))) (audition (out 0 x))) +] Try durscale 10.0 and 0.0 too. + +@racketblock[ (let* ((x (mouse-x* kr 10 700 0 0.1)) (y (mouse-y* kr 50 1000 0 0.1)) (g (gendy1 ar 2 3 1 1 1 x 0.5 0.1 10 10))) (audition (out 0 (pan2 (comb-n (resonz g y 0.1) 0.1 0.1 5) 0.0 0.6)))) +] Overkill + +@racketblock[ (define (overkill i) (mix-fill i @@ -105,11 +153,19 @@ Overkill (rand 0 6) (rand 0 6) (rand 0 1) (rand 0 1) f f (rand 0 1) (rand 0 1) n k))) (pan2 g (rand -1 1) (fdiv 0.5 (sqrt i))))))) +] + +@racketblock[ (audition (out 0 (overkill 10))) +] Another traffic moment + +@racketblock[ (let ((x (mouse-x* kr 100 2000 0 0.1)) (y (mouse-y* kr 0.01 1.0 0 0.1))) (audition (out 0 (resonz (overkill 10) x y)))) +] + diff --git a/doc/help/ugen/oscillators/impulse.help.scm b/doc/help/ugen/oscillators/impulse.help.scm index 2cf1627..f54a864 100644 --- a/doc/help/ugen/oscillators/impulse.help.scm +++ b/doc/help/ugen/oscillators/impulse.help.scm @@ -1,3 +1,4 @@ +;; impulse (import (rsc3)) (audition (out 0 (mul (impulse ar 800 0) 0.1))) diff --git a/doc/help/ugen/oscillators/impulse.help.scrbl b/doc/help/ugen/oscillators/impulse.help.scrbl index fd14ab5..bab3749 100644 --- a/doc/help/ugen/oscillators/impulse.help.scrbl +++ b/doc/help/ugen/oscillators/impulse.help.scrbl @@ -1,15 +1,29 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (rsc3)) +@title{impulse} + +@racketblock[ +(import (rsc3)) +] + + +@racketblock[ (audition (out 0 (mul (impulse ar 800 0) 0.1))) +] + +@racketblock[ (let ((f (x-line kr 800 10 5 remove-synth))) (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) +] + +@racketblock[ (let ((f (mouse-y* kr 4 8 0 0.1)) (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))} + (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2)))) +] diff --git a/doc/help/ugen/oscillators/index.help.scm b/doc/help/ugen/oscillators/index.help.scm index 4ecf3b9..0efd352 100644 --- a/doc/help/ugen/oscillators/index.help.scm +++ b/doc/help/ugen/oscillators/index.help.scm @@ -1,3 +1,4 @@ +;; index (import (sosc) (rsc3)) ;; Allocate and set values at buffer 10. diff --git a/doc/help/ugen/oscillators/index.help.scrbl b/doc/help/ugen/oscillators/index.help.scrbl index 77668b7..ae10152 100644 --- a/doc/help/ugen/oscillators/index.help.scrbl +++ b/doc/help/ugen/oscillators/index.help.scrbl @@ -1,20 +1,35 @@ #lang scribble/manual @(require (for-label racket)) -@title{(import (sosc) (rsc3))} +@title{index} + + +@racketblock[ +(import (sosc) (rsc3)) +] Allocate and set values at buffer 10. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 6 1)) (send fd (b-setn1 10 0 (list 50 100 200 400 800 1600))))) +] Index into the above buffer for frequency values. + +@racketblock[ (let ((f (mul (index 10 (mul (lf-saw kr 2 3) 4)) (mce2 1 9)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] Free buffer + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-free 10)))) +] + diff --git a/doc/help/ugen/oscillators/klang.help.scrbl b/doc/help/ugen/oscillators/klang.help.scrbl index b198bb6..7a2d3f1 100644 --- a/doc/help/ugen/oscillators/klang.help.scrbl +++ b/doc/help/ugen/oscillators/klang.help.scrbl @@ -3,12 +3,17 @@ @title{(klang rate freqScale freqOffset spec)} + Bank of fixed oscillators. The UGen assistant klang.spec can help create the 'spec' entry. Note that the SC3 language reorders the inputs, the rsc3 client does not. + +@racketblock[ (let ((d (klang-data '(440 550 660 770 880 990 1000) '(0.05 0.02 0.07 0.04 0.05 0.02 0.03) (replicate 7 0)))) (audition (out 0 (klang ar 1 0 d)))) +] + diff --git a/doc/help/ugen/oscillators/lf-cub.help.scrbl b/doc/help/ugen/oscillators/lf-cub.help.scrbl index 9b173cd..ed0a493 100644 --- a/doc/help/ugen/oscillators/lf-cub.help.scrbl +++ b/doc/help/ugen/oscillators/lf-cub.help.scrbl @@ -3,39 +3,89 @@ @title{(lf-cub rate freq iphase)} + a sine like shape made of two cubic pieces. smoother than lf-par. + +@racketblock[ (let ((f (mul-add (lf-cub kr (mul-add (lf-cub kr 0.2 0) 8 10) 0) 400 800))) (mul (lf-cub ar f 0) 0.1)) +] + +@racketblock[ (mul (lf-cub ar (mul-add (lf-cub kr 0.2 0) 400 800) 0) 0.1) +] + +@racketblock[ (mul (lf-cub ar 800 0) 0.1) +] + +@racketblock[ (mul (lf-cub ar (x-line kr 100 8000 30 do-nothing) 0) 0.1) +] compare: + +@racketblock[ (let ((f (mul-add (lf-par kr (mul-add (lf-par kr 0.2 0) 8 10) 0) 400 800))) (mul (lf-par ar f 0) 0.1)) +] + +@racketblock[ (mul (lf-par ar (mul-add (lf-par kr 0.2 0) 400 800) 0) 0.1) +] + +@racketblock[ (mul (lf-par ar 800 0) 0.1) +] + +@racketblock[ (mul (lf-par ar (x-line kr 100 8000 30 do-nothing) 0) 0.1) +] compare: + +@racketblock[ (let ((f (mul-add (sin-osc kr (mul-add (sin-osc kr 0.2 0) 8 10) 0) 400 800))) (mul (sin-osc ar f 0) 0.1)) +] + +@racketblock[ (mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 800) 0) 0.1) +] + +@racketblock[ (mul (sin-osc ar 800 0) 0.1) +] + +@racketblock[ (mul (sin-osc ar (x-line kr 100 8000 30 do-nothing) 0) 0.1) +] compare: + +@racketblock[ (let ((f (mul-add (lf-tri kr (mul-add (lf-tri kr 0.2 0) 8 10) 0) 400 800))) (mul (lf-tri ar f 0) 0.1)) +] + +@racketblock[ (mul (lf-tri ar (mul-add (lf-tri kr 0.2 0) 400 800) 0) 0.1) -(mul (lf-tri ar 800 0) 0.1) -(mul (lf-tri ar (x-line kr 100 8000 30 do-nothing) 0) 0.1) +] + +@racketblock[ +(mul (lf-tri ar 800 0) 0.1) +] + +@racketblock[ +(mul (lf-tri ar (x-line kr 100 8000 30 do-nothing) 0) 0.1) +] + diff --git a/doc/help/ugen/oscillators/lf-par.help.scrbl b/doc/help/ugen/oscillators/lf-par.help.scrbl index e6d014a..8da82eb 100644 --- a/doc/help/ugen/oscillators/lf-par.help.scrbl +++ b/doc/help/ugen/oscillators/lf-par.help.scrbl @@ -3,5 +3,7 @@ @title{See lf-cub.} + A sine-like shape made of two parabolas. Has audible odd harmonics. + diff --git a/doc/help/ugen/oscillators/lf-pulse.help.scrbl b/doc/help/ugen/oscillators/lf-pulse.help.scrbl index e0c7f93..315a748 100644 --- a/doc/help/ugen/oscillators/lf-pulse.help.scrbl +++ b/doc/help/ugen/oscillators/lf-pulse.help.scrbl @@ -3,6 +3,7 @@ @title{(lf-pulse rate freq iphase width)} + A non-band-limited pulse oscillator. outputs a high value of one and a low value of zero. Note that the iphase argument was not present in SC2. @@ -11,6 +12,10 @@ freq - frequency in Hertz iphase - initial phase offset in cycles ( 0..1 ) width - pulse width duty cycle from zero to one. + +@racketblock[ (let ((f (mul-add (lf-pulse kr 3 0 0.3) 200 200))) (audition (out 0 (mul (lf-pulse ar f 0 0.2) 0.1)))) +] + diff --git a/doc/help/ugen/oscillators/lf-saw.help.scrbl b/doc/help/ugen/oscillators/lf-saw.help.scrbl index 1be3387..0820654 100644 --- a/doc/help/ugen/oscillators/lf-saw.help.scrbl +++ b/doc/help/ugen/oscillators/lf-saw.help.scrbl @@ -3,16 +3,24 @@ @title{(lf-saw rate freq iphase)} + sawtooth oscillator. A non-band-limited sawtooth oscillator. output ranges from -1 to +1. freq - frequency in Hertz iphase - phase in radians + +@racketblock[ (audition (out 0 (mul (lf-saw ar 500 1) 0.1))) +] Used as both oscillator and LFO. + +@racketblock[ (let ((f (mul-add (lf-saw kr 4 0) 400 400))) (audition (out 0 (mul (lf-saw ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/oscillators/lf-tri.help.scrbl b/doc/help/ugen/oscillators/lf-tri.help.scrbl index 4fb1575..4c8730f 100644 --- a/doc/help/ugen/oscillators/lf-tri.help.scrbl +++ b/doc/help/ugen/oscillators/lf-tri.help.scrbl @@ -3,13 +3,21 @@ @title{(lf-tri rate freq iphase)} + A non-band-limited triangular waveform oscillator. output ranges from -1 to +1. + +@racketblock[ (audition (out 0 (mul (lf-tri ar 500 1) 0.1))) +] Used as both oscillator and LFO. + +@racketblock[ (let ((f (mul-add (lf-tri kr 4 0) 400 400))) (audition (out 0 (mul (lf-tri ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/oscillators/osc-n.help.scrbl b/doc/help/ugen/oscillators/osc-n.help.scrbl index 5663b3c..43638be 100644 --- a/doc/help/ugen/oscillators/osc-n.help.scrbl +++ b/doc/help/ugen/oscillators/osc-n.help.scrbl @@ -3,6 +3,7 @@ @title{(osc-n rate bufnum freq phase)} + Noninterpolating wavetable lookup oscillator with frequency and phase modulation inputs. It is usually better to use the interpolating oscillator. @@ -12,3 +13,4 @@ filled using Wavetable format (b_gen commands should set wavetable flag to false. + diff --git a/doc/help/ugen/oscillators/osc.help.scrbl b/doc/help/ugen/oscillators/osc.help.scrbl index 8386cc3..38a11c0 100644 --- a/doc/help/ugen/oscillators/osc.help.scrbl +++ b/doc/help/ugen/oscillators/osc.help.scrbl @@ -3,6 +3,7 @@ @title{(osc rate bufnum freq phase)} + linear interpolating wavetable lookup oscillator with frequency and phase modulation inputs. @@ -18,35 +19,57 @@ flag set to true. Note about wavetables: oscN requires the b_gen sine1 wavetable flag to be OFF. osc requires the b_gen sine1 wavetable flag to be ON. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 512 1)) (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5))))) +] + +@racketblock[ (audition (out 0 (mul (osc ar 10 220 0) 0.1))) +] Modulate freq + +@racketblock[ (let ((f (x-line kr 2000 200 1 remove-synth))) (audition (out 0 (mul (osc ar 10 f 0) 0.5)))) +] Modulate freq + +@racketblock[ (let* ((f1 (x-line kr 1 1000 9 remove-synth)) (f2 (mul-add (osc ar 10 f1 0) 200 800))) (audition (out 0 (mul (osc ar 10 f2 0) 0.25)))) +] Modulate phase + +@racketblock[ (let* ((f (x-line kr 20 8000 10 remove-synth)) (p (mul (osc ar 10 f 0) (* 2 pi)))) (audition (out 0 (mul (osc ar 10 800 p) 0.25)))) +] Change the buffer while its playing -(audition (out 0 (mul (osc ar 10 220 0) 0.1))) +@racketblock[ +(audition (out 0 (mul (osc ar 10 220 0) 0.1))) +] + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 (random 0 1) 1/4))))) +] + diff --git a/doc/help/ugen/oscillators/pm-osc.help.scrbl b/doc/help/ugen/oscillators/pm-osc.help.scrbl index c98fdd4..8974f44 100644 --- a/doc/help/ugen/oscillators/pm-osc.help.scrbl +++ b/doc/help/ugen/oscillators/pm-osc.help.scrbl @@ -3,6 +3,7 @@ @title{(pm-osc rate carfreq modfreq index modphase)} + Phase modulation oscillator pair. carfreq - carrier frequency in cycles per second. @@ -10,15 +11,25 @@ modfreq - modulator frequency in cycles per second. index - modulation index in radians. modphase - a modulation input for the modulator's phase in radians + +@racketblock[ (let* ((f (line kr 600 900 5 remove-synth)) (o (mul (pm-osc ar f 600 3 0) 0.1))) (audition (out 0 o))) +] + +@racketblock[ (let* ((mf (line kr 600 900 5 remove-synth)) (o (mul (pm-osc ar 300 mf 3 0) 0.1))) (audition (out 0 o))) +] + +@racketblock[ (let* ((i (line kr 0 20 8 remove-synth)) (o (mul (pm-osc ar 300 550 i 0) 0.1))) (audition (out 0 o))) +] + diff --git a/doc/help/ugen/oscillators/pulse.help.scrbl b/doc/help/ugen/oscillators/pulse.help.scrbl index 457d887..ffc3e38 100644 --- a/doc/help/ugen/oscillators/pulse.help.scrbl +++ b/doc/help/ugen/oscillators/pulse.help.scrbl @@ -3,24 +3,35 @@ @title{(pulse rate freq width)} + Bandlimited pulse wave generator. Modulate frequency + +@racketblock[ (audition (let ((f (x-line kr 40 4000 6 remove-synth))) (out 0 (mul (pulse ar f 0.1) 0.2)))) +] modulate pulse width + +@racketblock[ (audition (let ((w (line kr 0.01 0.99 8 remove-synth))) (out 0 (mul (pulse ar 200 w) 0.2)))) +] two band limited square waves thru a resonant low pass filter + +@racketblock[ (audition (out 0 (rlpf (mul (pulse ar (mce2 100 250) 0.5) 0.1) (x-line kr 8000 400 5 remove-synth) 0.05))) +] + diff --git a/doc/help/ugen/oscillators/saw.help.scrbl b/doc/help/ugen/oscillators/saw.help.scrbl index e72f0b2..12077ba 100644 --- a/doc/help/ugen/oscillators/saw.help.scrbl +++ b/doc/help/ugen/oscillators/saw.help.scrbl @@ -3,13 +3,21 @@ @title{(saw rate freq)} + Band limited sawtooth wave generator. + +@racketblock[ (let ((f (x-line kr 40 4000 6 do-nothing))) (audition (out 0 (mul (saw ar f) 0.2)))) +] Two band limited sawtooth waves thru a resonant low pass filter + +@racketblock[ (let ((f (x-line kr 8000 400 5 do-nothing))) (audition (out 0 (rlpf (mul (saw ar (mce2 100 250)) 0.1) f 0.05)))) +] + diff --git a/doc/help/ugen/oscillators/select.help.scrbl b/doc/help/ugen/oscillators/select.help.scrbl index ff886d1..11f307d 100644 --- a/doc/help/ugen/oscillators/select.help.scrbl +++ b/doc/help/ugen/oscillators/select.help.scrbl @@ -3,19 +3,25 @@ @title{(select which array)} + The output is selected from an array of inputs. + +@racketblock[ (audition (let* ((a (mce3 (sin-osc ar 440 0) (saw ar 440) (pulse ar 440 0.1))) (cycle 3/2) (w (mul-add (lf-saw kr 1 0) cycle cycle))) (out 0 (mul (select w a) 0.2)))) +] Note: all the ugens are continously running. This may not be the most efficient way if each input is cpu-expensive. Here used as a sequencer: + +@racketblock[ (audition (let* ((n 32) (a (make-mce (map (compose midi-cps u:floor) @@ -23,4 +29,6 @@ Here used as a sequencer: (cycle (/ n 2)) (w (mul-add (lf-saw kr 1/2 0) cycle cycle))) (out 0 (mul (saw ar (select w a)) 0.2)))) +] + diff --git a/doc/help/ugen/oscillators/shaper.help.scrbl b/doc/help/ugen/oscillators/shaper.help.scrbl index effbb02..3394909 100644 --- a/doc/help/ugen/oscillators/shaper.help.scrbl +++ b/doc/help/ugen/oscillators/shaper.help.scrbl @@ -3,6 +3,7 @@ @title{(shaper bufnum in)} + Wave shaper. Performs waveshaping on the input signal by indexing into the table. @@ -10,13 +11,20 @@ bufnum - the number of a buffer filled in wavetable format containing the transfer function. in - the input signal. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 512 1)) (async fd (b-gen1 10 "cheby" (list 0 1 0 1 1 0 1))))) +] + +@racketblock[ (audition (let* ((a (line kr 0 1 6 remove-synth)) (s (mul (sin-osc ar 300 0) a))) (out 0 (mul (shaper 10 s) 0.5)))) +] + diff --git a/doc/help/ugen/oscillators/sin-osc.help.scrbl b/doc/help/ugen/oscillators/sin-osc.help.scrbl index ed1eeeb..3388cbd 100644 --- a/doc/help/ugen/oscillators/sin-osc.help.scrbl +++ b/doc/help/ugen/oscillators/sin-osc.help.scrbl @@ -3,28 +3,42 @@ @title{(sin-osc rate freq phase)} + interpolating sine wavetable oscillator. This is the same as osc except that the table is a sine table of 8192 entries. freq - frequency in Hertz phase - phase offset or modulator in radians + +@racketblock[ (audition (out 0 (mul (sin-osc ar 440 0) (mce2 0.15 0.25)))) +] Modulate freq + +@racketblock[ (let ((f (x-line kr 2000 200 1 remove-synth))) (audition (out 0 (mul (sin-osc ar f 0) 0.5)))) +] Modulate freq + +@racketblock[ (let* ((f1 (x-line kr 1 1000 9 remove-synth)) (f2 (mul-add (sin-osc ar f1 0) 200 800))) (audition (out 0 (mul (sin-osc ar f2 0) 0.25)))) +] Modulate phase + +@racketblock[ (let* ((f (x-line kr 20 8000 10 remove-synth)) (p (mul (sin-osc ar f 0) (* pi 2)))) (audition (out 0 (mul (sin-osc ar 800 p) 0.25)))) +] + diff --git a/doc/help/ugen/oscillators/sync-saw.help.scrbl b/doc/help/ugen/oscillators/sync-saw.help.scrbl index 068dabd..9701b1e 100644 --- a/doc/help/ugen/oscillators/sync-saw.help.scrbl +++ b/doc/help/ugen/oscillators/sync-saw.help.scrbl @@ -3,6 +3,7 @@ @title{(sync-saw rate syncFreq sawFreq)} + A sawtooth wave that is hard synched to a fundamental pitch. This produces an effect similar to moving formants or pulse width modulation. The sawtooth oscillator has its phase reset when the @@ -12,7 +13,11 @@ waveform, so it may alias. The frequency of the slave synched sawtooth wave should always be greater than the syncFreq. + +@racketblock[ (audition (let ((f (line kr 100 800 12 remove-synth))) (out 0 (mul (sync-saw ar 100 f) 0.1)))) +] + diff --git a/doc/help/ugen/oscillators/t-choose.help.scrbl b/doc/help/ugen/oscillators/t-choose.help.scrbl index 0ba59bb..feb6ae7 100644 --- a/doc/help/ugen/oscillators/t-choose.help.scrbl +++ b/doc/help/ugen/oscillators/t-choose.help.scrbl @@ -3,9 +3,12 @@ @title{(t-choose trig array)} + The output is selected randomly on recieving a trigger from an array of inputs. t-choose is a composite of ti-rand and select. + +@racketblock[ (audition (let* ((t (dust ar (mouse-x kr 1 1000 1 0.1))) (f (midi-cps (ti-rand 48 60 t))) @@ -13,7 +16,9 @@ array of inputs. t-choose is a composite of ti-rand and select. (saw ar (mul f 2)) (pulse ar (mul f 0.5) 0.1)))) (out 0 (mul (t-choose t a) 0.1)))) +] Note: all the ugens are continously running. This may not be the most efficient way if each input is cpu-expensive. + diff --git a/doc/help/ugen/oscillators/t-grains.help.scrbl b/doc/help/ugen/oscillators/t-grains.help.scrbl index 12d9e92..5feee98 100644 --- a/doc/help/ugen/oscillators/t-grains.help.scrbl +++ b/doc/help/ugen/oscillators/t-grains.help.scrbl @@ -3,6 +3,7 @@ @title{(t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)} + Buffer granulator. triggers generate grains from a buffer. Each grain has a Hanning envelope (sin^2(x) for x from 0 to pi) and is panned between two channels of multiple outputs. @@ -37,10 +38,15 @@ interp - 1, 2, or 4. Determines whether the grain uses (1) no interpolation, (2) linear interpolation, or (4) cubic interpolation. + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (audition (let* ((b 10) (trate (mouse-y kr 2 200 1 0.1)) @@ -48,7 +54,10 @@ interp - 1, 2, or 4. Determines whether the grain uses (1) no (t (impulse ar trate 0)) (i (mouse-x kr 0 (buf-dur kr b) 0 0.1))) (out 0 (t-grains 2 t b 1 i dur 0 0.1 2)))) +] + +@racketblock[ (audition (let* ((b 10) (trate (mouse-y kr 8 120 1 0.1)) @@ -58,7 +67,10 @@ interp - 1, 2, or 4. Determines whether the grain uses (1) no (pos (add x (t-rand 0 0.01 clk))) (pan (mul (white-noise kr) 0.6))) (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2)))) +] + +@racketblock[ (audition (let* ((b 10) (trate (mouse-y kr 8 120 1 0.1)) @@ -68,9 +80,12 @@ interp - 1, 2, or 4. Determines whether the grain uses (1) no (pos (add x (t-rand 0 0.01 clk))) (pan (mul (white-noise kr) 0.6))) (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2)))) +] The SC3 ** operator is the ShiftLeft binary UGen. + +@racketblock[ (audition (let* ((b 10) (trate (mouse-y kr 2 120 1 0.1)) @@ -80,4 +95,6 @@ The SC3 ** operator is the ShiftLeft binary UGen. (pan (mul (white-noise kr) 0.6)) (rate (shift-left 1.2 (u:round (mul (white-noise kr) 3) 1)))) (out 0 (t-grains 2 clk b rate pos dur pan 0.1 2)))) +] + diff --git a/doc/help/ugen/oscillators/tw-choose.help.scrbl b/doc/help/ugen/oscillators/tw-choose.help.scrbl index 044ea93..de385c1 100644 --- a/doc/help/ugen/oscillators/tw-choose.help.scrbl +++ b/doc/help/ugen/oscillators/tw-choose.help.scrbl @@ -3,6 +3,7 @@ @title{(tw-choose trig array weights normalize)} + The output is selected randomly on recieving a trigger from an array of inputs. The weights of this choice are determined from the weights array. If normalize is set to 1 the weights are @@ -11,13 +12,17 @@ When using fixed values the normalizeSum method can be used to normalize the values. TWChoose is a composite of TWindex and select + +@racketblock[ (let ((a (mce3 (sin-osc ar 220 0) (saw ar 440) (pulse ar 110 0.1))) (t (dust ar (mouse-x kr 1 1000 1 0.1))) (w (mce3 0.6 0.15 0.05))) (audition (out 0 (mul (tw-choose t a w 1) 0.1)))) +] Note: all the ugens are continously running. This may not be the most efficient way if each input is cpu-expensive. + diff --git a/doc/help/ugen/oscillators/tw-index.help.scrbl b/doc/help/ugen/oscillators/tw-index.help.scrbl index 7219cef..5496541 100644 --- a/doc/help/ugen/oscillators/tw-index.help.scrbl +++ b/doc/help/ugen/oscillators/tw-index.help.scrbl @@ -3,6 +3,7 @@ @title{(tw-index in normalize array)} + triggered windex. When triggered, returns a random index value based on array as a list of probabilities. By default the list of probabilities should sum to 1.0, when the normalize flag is set to @@ -10,17 +11,24 @@ probabilities should sum to 1.0, when the normalize flag is set to Assuming normalized values + +@racketblock[ (audition (let* ((prob (mce3 1/5 2/5 2/5)) (freq (mce3 400 500 600)) (f (select (tw-index (impulse kr 6 0) 0.0 prob) freq))) (out 0 (mul (sin-osc ar f 0) 0.2)))) +] Modulating probability values + +@racketblock[ (audition (let* ((t (impulse kr 6 0)) (a (mce3 1/4 1/2 (mul-add (sin-osc kr 0.3 0) 0.5 0.5))) (f (select (tw-index t 1.0 a) (mce3 400 500 600)))) (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/oscillators/v-osc.help.scrbl b/doc/help/ugen/oscillators/v-osc.help.scrbl index 8425ace..b4c1a72 100644 --- a/doc/help/ugen/oscillators/v-osc.help.scrbl +++ b/doc/help/ugen/oscillators/v-osc.help.scrbl @@ -3,6 +3,7 @@ @title{(v-osc rate bufpos freq phase)} + Variable wavetable oscillator. A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will @@ -26,6 +27,8 @@ to be ON. Allocate and fill tables 0 to 7 [see also Vosc3] + +@racketblock[ (with-sc3 (lambda (fd) (let* ((square @@ -38,19 +41,27 @@ Allocate and fill tables 0 to 7 [see also Vosc3] (enum-from-to 0 (- n 1))))) (async fd (b-gen1 i "sine1" (cons 7 a))))))) (for-each nth (enum-from-to 0 7))))) +] oscillator at buffers 0 through 7. + +@racketblock[ (let ((b (mouse-x kr 0 7 0 0.1)) (f (mce2 120 121))) (audition (out 0 (mul (v-osc ar b f 0) 0.3)))) +] Reallocate buffers while oscillator is running. + +@racketblock[ (with-sc3 (lambda (fd) (for-each (lambda (i) (async fd (b-gen1 i "sine1" (cons 7 (replicate-m 16 (random 0 1)))))) (enum-from-to 0 7)))) +] + diff --git a/doc/help/ugen/oscillators/v-osc3.help.scrbl b/doc/help/ugen/oscillators/v-osc3.help.scrbl index f7b4e49..5adcb33 100644 --- a/doc/help/ugen/oscillators/v-osc3.help.scrbl +++ b/doc/help/ugen/oscillators/v-osc3.help.scrbl @@ -3,6 +3,7 @@ @title{(v-osc3 rate bufpos freq1 freq2 freq3)} + Three variable wavetable oscillators. A wavetable lookup oscillator which can be swept smoothly across @@ -26,6 +27,8 @@ flag to be ON. Allocate and fill tables 0 to 7 with a generated list of harmonic amplitudes. + +@racketblock[ (with-sc3 (lambda (fd) (let* ((square @@ -39,21 +42,29 @@ amplitudes. (enum-from-to 0 (- n 1))))) (async fd (b-gen1 i "sine1" (cons 7 a))))))) (for-each nth (enum-from-to 0 7))))) +] oscillator at buffers 0 through 7. + +@racketblock[ (let ((p (mouse-x kr 0 7 0 0.1)) (f1 (mce2 240 241)) (f2 (mce2 240.27 241.1)) (f3 (mce2 240.43 239.71))) (audition (out 0 (mul (v-osc3 ar p f1 f2 f3) 0.2)))) +] Reallocate buffers while oscillator is running. + +@racketblock[ (with-sc3 (lambda (fd) (for-each (lambda (i) (async fd (b-gen1 i "sine1" (cons 7 (replicate-m 16 (random 0 1)))))) (enum-from-to 0 7)))) +] + diff --git a/doc/help/ugen/oscillators/var-saw.help.scrbl b/doc/help/ugen/oscillators/var-saw.help.scrbl index 6ee9551..006352e 100644 --- a/doc/help/ugen/oscillators/var-saw.help.scrbl +++ b/doc/help/ugen/oscillators/var-saw.help.scrbl @@ -3,13 +3,18 @@ @title{(var-saw rate freq iphasewidth)} + Variable duty saw freq - frequency in Hertz iphase - initial phase offset in cycles ( 0..1 ) width - duty cycle from zero to one. + +@racketblock[ (let ((f (mul-add (lf-pulse kr (mce2 3 3.03) 0 0.3) 200 200)) (w (lin-lin (lf-tri kr 1 0) -1 1 0 1))) (audition (out 0 (mul (var-saw ar f 0 w) 0.1)))) +] + diff --git a/doc/help/ugen/panners/decode-b2.help.scrbl b/doc/help/ugen/panners/decode-b2.help.scrbl index 51f8b9c..9553495 100644 --- a/doc/help/ugen/panners/decode-b2.help.scrbl +++ b/doc/help/ugen/panners/decode-b2.help.scrbl @@ -3,6 +3,7 @@ @title{(decode-b2 numChannels w x y orientation)} + 2D Ambisonic B-format decoder. Decode a two dimensional ambisonic B-format signal to a set of @@ -20,6 +21,8 @@ front. Should be 0.5 if the front bisects a side of the polygon. Then the first speaker will be the one left of center. Default is 0.5. + +@racketblock[ (let* ((p (pink-noise ar)) (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1)) (decoded (decode-b2 4 @@ -28,4 +31,6 @@ center. Default is 0.5. (mce-channel encoded 2) 0))) (audition (out 0 decoded))) +] + diff --git a/doc/help/ugen/panners/lin-pan2.help.scrbl b/doc/help/ugen/panners/lin-pan2.help.scrbl index 5d83f99..7eafcfa 100644 --- a/doc/help/ugen/panners/lin-pan2.help.scrbl +++ b/doc/help/ugen/panners/lin-pan2.help.scrbl @@ -3,9 +3,17 @@ @title{(lin-pan2 in pos level)} + Two channel linear pan. See pan2. + +@racketblock[ (audition (out 0 (lin-pan2 (pink-noise ar) (f-sin-osc kr 2 0) 0.1))) +] + +@racketblock[ (audition (out 0 (lin-pan2 (f-sin-osc ar 800 0.1) (f-sin-osc kr 3 0) 0.1))) +] + diff --git a/doc/help/ugen/panners/pan-b2.help.scrbl b/doc/help/ugen/panners/pan-b2.help.scrbl index cbf8c7e..518fd5d 100644 --- a/doc/help/ugen/panners/pan-b2.help.scrbl +++ b/doc/help/ugen/panners/pan-b2.help.scrbl @@ -3,11 +3,14 @@ @title{(pan-b2 in azimuth gain)} + 2D Ambisonic B-format panner. Encode a mono signal to two dimensional ambisonic B-format. The azimuth parameter is the position around the circle from -1 to +1. -1 is behind, -0.5 is left, 0 is forward, +0.5 is right, +1 is behind. + +@racketblock[ (let* ((p (pink-noise ar)) (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1)) (decoded (decode-b2 4 @@ -16,4 +19,6 @@ left, 0 is forward, +0.5 is right, +1 is behind. (mce-channel encoded 2) 0.5))) (audition (out 0 decoded))) +] + diff --git a/doc/help/ugen/panners/pan2.help.scrbl b/doc/help/ugen/panners/pan2.help.scrbl index 0359f8c..eedd336 100644 --- a/doc/help/ugen/panners/pan2.help.scrbl +++ b/doc/help/ugen/panners/pan2.help.scrbl @@ -3,13 +3,21 @@ @title{(pan2 in pos level)} + Two channel equal power panner. The pan position is bipolar, -1 is left, +1 is right. The level is a control rate input. + +@racketblock[ (let ((p (f-sin-osc kr 2 0))) (audition (out 0 (pan2 (pink-noise ar) p 0.3)))) +] + +@racketblock[ (let ((x (mouse-x kr -1 1 0 0.1)) (y (mouse-y kr 0 1 0 0.1))) (audition (out 0 (pan2 (pink-noise ar) x y)))) +] + diff --git a/doc/help/ugen/panners/rotate2.help.scrbl b/doc/help/ugen/panners/rotate2.help.scrbl index 5758a39..7a61ec1 100644 --- a/doc/help/ugen/panners/rotate2.help.scrbl +++ b/doc/help/ugen/panners/rotate2.help.scrbl @@ -3,6 +3,7 @@ @title{(rotate2 x y pos)} + Rotate a sound field. rotate2 can be used for rotating an ambisonic B-format sound field around an axis. rotate2 does an equal power rotation so it also works well on stereo sounds. It @@ -11,8 +12,8 @@ outputs two channels (x, y). It computes: - xout = cos(angle) * xin + sin(angle) * yin - yout = cos(angle) * yin - sin(angle) * xin + xout = cos(angle) * xin + sin(angle) * yin; + yout = cos(angle) * yin - sin(angle) * xin; where angle = pos * pi, so that -1 becomes -pi and +1 becomes +pi. This allows you to use an lf-saw to do continuous rotation around a @@ -22,6 +23,8 @@ The control pos is the angle to rotate around the circle from -1 to +1. -1 is 180 degrees, -0.5 is left, 0 is forward, +0.5 is right, +1 is behind. + +@racketblock[ (let* ((p (mul (white-noise ar) 0.05)) (q (mul (mix (lf-saw ar (make-mce (list 200 200.37 201)) 0)) 0.03)) (encoded (add (pan-b2 p -0.5 1) (pan-b2 q -0.5 1))) @@ -34,16 +37,24 @@ right, +1 is behind. (mce-channel rotated 1) 0.5))) (audition (out 0 decoded))) +] Rotation of stereo sound, via LFO. + +@racketblock[ (let ((x (mul (pink-noise ar) 0.4)) (y (mul (lf-tri ar 800 0) (mul (lf-pulse kr 3 0 0.3) 0.2)))) (audition (out 0 (rotate2 x y (lf-saw kr 0.1 0))))) +] Rotation of stereo sound, via mouse. + +@racketblock[ (let ((x (mix-fill 4 (lambda (_) (mul (lf-saw ar (rand 198 202) 0) 0.1)))) (y (mul (sin-osc ar 900 0) (mul (lf-pulse kr 3 0 0.3) 0.2)))) (audition (out 0 (rotate2 x y (mouse-x kr 0 2 0 0.1))))) +] + diff --git a/doc/help/ugen/physical-models/ball.help.scrbl b/doc/help/ugen/physical-models/ball.help.scrbl index f778fcb..4975209 100644 --- a/doc/help/ugen/physical-models/ball.help.scrbl +++ b/doc/help/ugen/physical-models/ball.help.scrbl @@ -3,6 +3,7 @@ @title{(ball in g damp friction)} + Physical model of bouncing object. Models the path of a bouncing object that is reflected by a @@ -13,3 +14,4 @@ g - gravity damp - damping on impact friction - proximity from which on attraction to surface starts + diff --git a/doc/help/ugen/ternary-ops/mul-add.help.scrbl b/doc/help/ugen/ternary-ops/mul-add.help.scrbl index 86a0840..1525049 100644 --- a/doc/help/ugen/ternary-ops/mul-add.help.scrbl +++ b/doc/help/ugen/ternary-ops/mul-add.help.scrbl @@ -3,11 +3,19 @@ @title{(mul-add a b c)} + Functionally equivalent to (add (mul a b) c). + +@racketblock[ (let ((f (mul-add (lf-saw kr (mce2 10 9) 0) 200 400))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let ((f (add (mul (lf-saw kr (mce2 10 9) 0) 200) 400))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/triggers/gate.help.scrbl b/doc/help/ugen/triggers/gate.help.scrbl index 7ab05aa..4041854 100644 --- a/doc/help/ugen/triggers/gate.help.scrbl +++ b/doc/help/ugen/triggers/gate.help.scrbl @@ -3,9 +3,14 @@ @title{(gate in trig)} + The signal at `in' is passed while `trig' is greater than zero. + +@racketblock[ (let ((s (mul (f-sin-osc ar 500 0) 1/4)) (t (lf-pulse ar 1 0 1/10))) (audition (out 0 (gate s t)))) +] + diff --git a/doc/help/ugen/triggers/in-range.help.scrbl b/doc/help/ugen/triggers/in-range.help.scrbl index 540e4fc..9679de0 100644 --- a/doc/help/ugen/triggers/in-range.help.scrbl +++ b/doc/help/ugen/triggers/in-range.help.scrbl @@ -3,6 +3,7 @@ @title{(in-range in lo hi)} + Tests if a signal is within a given range. If in is >= lo and <= hi output 1.0, otherwise output 0.0. output @@ -12,6 +13,10 @@ in - signal to be tested lo - low threshold hi - high threshold + +@racketblock[ (let ((a (in-range (mul (sin-osc kr 1 0) 0.2) -0.15 0.15))) (audition (out 0 (mul a (mul (brown-noise ar) 0.1))))) +] + diff --git a/doc/help/ugen/triggers/last-value.help.scrbl b/doc/help/ugen/triggers/last-value.help.scrbl index c8829dc..ae54066 100644 --- a/doc/help/ugen/triggers/last-value.help.scrbl +++ b/doc/help/ugen/triggers/last-value.help.scrbl @@ -3,13 +3,21 @@ @title{(last-value in diff)} + output the last value before the input changed more than a threshhold. + +@racketblock[ (let ((f (last-value (mouse-x kr 100 400 0 0.1) 40))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + +@racketblock[ (let* ((x (mouse-x kr 0.1 4 0 0.1)) (f (mul-add (u:abs (sub x (last-value x 0.5))) 400 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/most-change.help.scrbl b/doc/help/ugen/triggers/most-change.help.scrbl index 5aa558a..f36421c 100644 --- a/doc/help/ugen/triggers/most-change.help.scrbl +++ b/doc/help/ugen/triggers/most-change.help.scrbl @@ -3,9 +3,14 @@ @title{(most-change a b)} + output the input that changed most. + +@racketblock[ (let* ((x (mouse-x kr 200 300 0 0.1)) (f (most-change (mul-add (lf-noise0 kr 1) 400 900) x))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/triggers/peak-follower.help.scrbl b/doc/help/ugen/triggers/peak-follower.help.scrbl index 90bcff4..ce9fd74 100644 --- a/doc/help/ugen/triggers/peak-follower.help.scrbl +++ b/doc/help/ugen/triggers/peak-follower.help.scrbl @@ -3,6 +3,7 @@ @title{(peak-follower in decay)} + Track peak signal amplitude. outputs the peak amplitude of the signal received at the input. If level is below maximum, the level decreases by the factor given in decay. @@ -18,27 +19,40 @@ running-min and running-max UGens. No decay + +@racketblock[ (let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) (f (mul-add (peak-follower s 1.0) 1500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] A little decay + +@racketblock[ (let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) (f (mul-add (peak-follower s 0.999) 1500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] Mouse x controls decay + +@racketblock[ (let* ((x (mouse-x kr 0.99 1.0001 1 0.1)) (s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) (f (mul-add (peak-follower s (u:min x 1.0)) 1500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] Follow a sine lfo + +@racketblock[ (let* ((x (mouse-x kr 0.99 1.0001 1 0.1)) (s (sin-osc kr 0.2 0)) (f (mul-add (peak-follower s (u:min x 1.0)) 200 500))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/peak.help.scrbl b/doc/help/ugen/triggers/peak.help.scrbl index 2851463..b391f21 100644 --- a/doc/help/ugen/triggers/peak.help.scrbl +++ b/doc/help/ugen/triggers/peak.help.scrbl @@ -3,10 +3,15 @@ @title{(peak trig reset)} + outputs the maximum value read at the `trig' input until `reset' is triggered. + +@racketblock[ (let* ((p (peak (dust ar 20) (impulse ar 0.4 0))) (f (mul-add p 500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/phasor.help.scrbl b/doc/help/ugen/triggers/phasor.help.scrbl index c797371..3672297 100644 --- a/doc/help/ugen/triggers/phasor.help.scrbl +++ b/doc/help/ugen/triggers/phasor.help.scrbl @@ -3,6 +3,7 @@ @title{(phasor trig rate start end resetpos)} + triggered linear ramp between two levels. Starts a linear ramp when trig input crosses from non-positive to positive. @@ -16,9 +17,13 @@ resetPos - determines where to jump to on recieving a trigger. the phasor controls sine frequency: end frequency matches a second sine wave. + +@racketblock[ (let* ((r (mouse-x kr 0.2 2 1 0.1)) (t (impulse ar r 0)) (x (phasor ar t (fdiv r sample-rate) 0 1 0)) (f (mce2 (lin-lin x 0 1 600 1000) 1000))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/poll.help.scrbl b/doc/help/ugen/triggers/poll.help.scrbl index d455129..5df5b37 100644 --- a/doc/help/ugen/triggers/poll.help.scrbl +++ b/doc/help/ugen/triggers/poll.help.scrbl @@ -3,6 +3,7 @@ @title{(poll trig in trigid label)} + Print/query the current output value of a UGen. trig - a non-positive to positive transition telling poll to return @@ -19,15 +20,23 @@ poll returns its in signal (and is therefore transparent). WARNING: Printing values from the Server in intensive for the CPU. poll should be used for debugging purposes. + +@racketblock[ (define (string->ugen s) (make-mce (cons (string-length s) (map char->integer (string->list s))))) +] + +@racketblock[ (let ((t (impulse kr 2 0)) (i (line kr 0 1 5 remove-synth))) (audition (poll t i 0 (string->ugen "Test")))) +] + +@racketblock[ (with-sc3 (lambda (fd) (letrec ((print (lambda (e) (display e) (newline))) @@ -36,16 +45,27 @@ CPU. poll should be used for debugging purposes. (async fd (/notify 1)) (repeat (showing (lambda () (wait fd "/tr")))) (async fd (/notify 0))))) +] multichannel Expansion (Broken...) + +@racketblock[ (define (poll* trig in trigId label) (poll trig in trigId (string->ugen label))) +] + +@racketblock[ (poll* (impulse kr (mce2 10 5) 0) (line kr 0 (mce2 1 5) (mce2 1 2) do-nothing) 0 "Test") +] + +@racketblock[ (with-sc3 server-status) +] + diff --git a/doc/help/ugen/triggers/pulse-count.help.scrbl b/doc/help/ugen/triggers/pulse-count.help.scrbl index 5482580..08d7d1b 100644 --- a/doc/help/ugen/triggers/pulse-count.help.scrbl +++ b/doc/help/ugen/triggers/pulse-count.help.scrbl @@ -3,9 +3,14 @@ @title{(pulse-count trig reset)} + This outputs the number of pulses received at `trig' and outputs that value until `reset' is triggered. + +@racketblock[ (let ((f (mul (pulse-count (impulse ar 10 0) (impulse ar 0.4 0)) 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.05)))) +] + diff --git a/doc/help/ugen/triggers/pulse-divider.help.scrbl b/doc/help/ugen/triggers/pulse-divider.help.scrbl index 2767169..e47c954 100644 --- a/doc/help/ugen/triggers/pulse-divider.help.scrbl +++ b/doc/help/ugen/triggers/pulse-divider.help.scrbl @@ -3,13 +3,18 @@ @title{(pulse-divider trig div start)} + outputs one impulse each time it receives a certain number of triggers at its input. A trigger happens when the signal changes from non-positive to positive. + +@racketblock[ (let* ((p (impulse ar 8 0)) (d (pulse-divider p (mce2 4 7) 0)) (a (mul (sin-osc ar 1200 0) (decay2 p 0.005 0.1))) (b (mul (sin-osc ar 600 0) (decay2 d 0.005 0.5)))) (audition (out 0 (mul (add a b) 0.4)))) +] + diff --git a/doc/help/ugen/triggers/running-max.help.scrbl b/doc/help/ugen/triggers/running-max.help.scrbl index 2a28df1..4282bd3 100644 --- a/doc/help/ugen/triggers/running-max.help.scrbl +++ b/doc/help/ugen/triggers/running-max.help.scrbl @@ -3,6 +3,7 @@ @title{(running-max in trig)} + Track maximum level. outputs the maximum value received at the input. When triggered, the maximum output value is reset to the current value. @@ -10,11 +11,18 @@ current value. in - input signal trig - reset the output value to the current input value + +@racketblock[ (let* ((t (impulse ar 0.4 0)) (f (mul-add (running-max (dust ar 20) t) 500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + +@racketblock[ (let* ((t (impulse kr (mouse-x kr 0.01 2 1 0.1) 0)) (f (mul-add (running-max (sin-osc kr 2 0) t) 500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/running-min.help.scrbl b/doc/help/ugen/triggers/running-min.help.scrbl index 401ac58..033ca41 100644 --- a/doc/help/ugen/triggers/running-min.help.scrbl +++ b/doc/help/ugen/triggers/running-min.help.scrbl @@ -3,6 +3,7 @@ @title{(running-min in trig)} + Track minimum level. outputs the minimum value received at the input. When triggered, the minimum output value is reset to the current value. @@ -10,11 +11,18 @@ current value. in - input signal trig - reset the output value to the current input value + +@racketblock[ (let* ((t (impulse ar 2.0 0)) (f (mul-add (running-min (sub 1 (dust ar 20)) t) 500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + +@racketblock[ (let* ((t (impulse kr (mouse-x kr 0.5 4 1 0.1) 0)) (f (mul-add (running-min (sub 2 (sin-osc kr 2 0)) t) 500 200))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] + diff --git a/doc/help/ugen/triggers/schmidt.help.scrbl b/doc/help/ugen/triggers/schmidt.help.scrbl index c6b82dc..444add7 100644 --- a/doc/help/ugen/triggers/schmidt.help.scrbl +++ b/doc/help/ugen/triggers/schmidt.help.scrbl @@ -3,6 +3,7 @@ @title{(schmidt in lo hi)} + schmidt trigger. When in crosses to greater than hi, output 1.0, then when signal crosses lower than lo output 0.0. output is initially zero. @@ -11,8 +12,12 @@ in - signal to be tested lo - low threshold hi - high threshold + +@racketblock[ (let* ((in (lf-noise1 kr 3)) (octave (add (schmidt in -0.15 0.15) 1)) (f (add (mul in 200) (mul 500 octave)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/triggers/send-trig.help.scrbl b/doc/help/ugen/triggers/send-trig.help.scrbl index 493bc5d..9bc4290 100644 --- a/doc/help/ugen/triggers/send-trig.help.scrbl +++ b/doc/help/ugen/triggers/send-trig.help.scrbl @@ -3,6 +3,7 @@ @title{(send-trig in id value)} + On receiving a trigger (0 to non-zero transition), send a trigger message from the server back to all registered clients. Clients register by sending a /notify message to the server. @@ -15,10 +16,15 @@ id - an integer that will be passed with the trigger message. This value - a UGen or float that will be polled at the time of trigger, and its value passed with the trigger message + +@racketblock[ (let ((s (lf-noise0 kr 10))) (audition (mrg2 (send-trig s 0 s) (out 0 (mul (sin-osc ar (mul-add s 200 500) 0) 0.1))))) +] + +@racketblock[ (with-sc3 (lambda (fd) (async fd (notify 1)) @@ -26,4 +32,6 @@ value - a UGen or float that will be polled at the time of trigger, (let ((r (wait fd "/tr"))) (async fd (notify 0)) r))) +] + diff --git a/doc/help/ugen/triggers/set-reset-ff.help.scrbl b/doc/help/ugen/triggers/set-reset-ff.help.scrbl index 6f04cfe..8ed5142 100644 --- a/doc/help/ugen/triggers/set-reset-ff.help.scrbl +++ b/doc/help/ugen/triggers/set-reset-ff.help.scrbl @@ -3,6 +3,7 @@ @title{(set-reset-ff trig reset)} + Set-reset flip flop. output is set to 1.0 upon receiving a trigger in the set input, and to 0.0 upon receiving a trigger in the reset input. Once the flip flop is set to zero or one further triggers in @@ -12,7 +13,11 @@ precipitating event cause something to happen until you reset it. trig - trigger sets output to one reset - trigger resets output to zero + +@racketblock[ (let ((n (brown-noise ar)) (g (set-reset-ff (dust ar 5) (dust ar 5)))) (audition (out 0 (mul3 n g 0.2)))) +] + diff --git a/doc/help/ugen/triggers/stepper.help.scrbl b/doc/help/ugen/triggers/stepper.help.scrbl index 63ddddd..ec19d83 100644 --- a/doc/help/ugen/triggers/stepper.help.scrbl +++ b/doc/help/ugen/triggers/stepper.help.scrbl @@ -3,9 +3,12 @@ @title{(stepper trig reset min max step resetval)} + stepper pulse counter. Each trigger increments a counter which is output as a signal. The counter wraps between min and max. + +@racketblock[ (with-sc3 (lambda (fd) (let ((a (list 97.999 195.998 523.251 466.164 195.998 @@ -14,14 +17,20 @@ output as a signal. The counter wraps between min and max. 155.563))) (async fd (b-alloc 10 128 1)) (send fd (b-setn1 10 0 a))))) +] Function composition... + +@racketblock[ (define (seq s l) (if (null? l) s (seq ((car l) s) (cdr l)))) +] + +@racketblock[ (let* ((rate (mouse-x kr 1 5 1 0.1)) (clock (impulse kr rate 0)) (env (decay2 clock 0.002 2.5)) @@ -40,34 +49,43 @@ Function composition... (lambda (s) (mul (rlpf s ffreq 0.3) env)) (lambda (s) (mul (rlpf s ffreq 0.3) env)) (lambda (s) (mul s 0.2)) - Echo + ;; Echo (lambda (s) (mul-add (comb-l s 1 (fdiv 0.66 rate) 2) 0.8 s)) - Reverb + ;; Reverb (lambda (s) (add s (mul (seq s (replicate 5 rvb)) 0.3))) (lambda (s) (leak-dc s 0.1)) - Flanger + ;; Flanger (lambda (s) (add (delay-l s 0.1 lfo) s)) - Slight bass emphasis + ;; Slight bass emphasis (lambda (s) (one-pole s 0.9)))) (init (mix (lf-pulse ar (mul freq (mce3 1 3/2 2)) 0 0.3)))) (audition (out 0 (seq init proc)))) +] Pattern randomizer.... + +@racketblock[ (with-sc3 (lambda (fd) (let ((p (map (lambda (e) (midi-cps (+ 36 (s:degree-to-key e (list 0 3 5 7 10) 12)))) (map floor (replicate-m 16 (random 0 15)))))) (send fd (b-setn1 10 0 p))))) +] A shorter variant, using some simple syntax... + +@racketblock[ (define-syntax seq* (syntax-rules () ((_ i s f ...) (seq i (list (lambda (s) f) ...))))) +] + +@racketblock[ (let* ((rate (mouse-x kr 1 5 1 0.1)) (clock (impulse kr rate 0)) (env (decay2 clock 0.002 2.5)) @@ -91,4 +109,6 @@ A shorter variant, using some simple syntax... (add (delay-l s 0.1 lfo) s) (one-pole s 0.9)))) (audition (out 0 proc))) +] + diff --git a/doc/help/ugen/triggers/sweep.help.scrbl b/doc/help/ugen/triggers/sweep.help.scrbl index bcb5c39..625eb65 100644 --- a/doc/help/ugen/triggers/sweep.help.scrbl +++ b/doc/help/ugen/triggers/sweep.help.scrbl @@ -3,36 +3,53 @@ @title{(sweep trig rate)} + triggered linear ramp. Starts a linear raise by rate/sec from zero when trig input crosses from non-positive to positive. Using sweep to modulate sine frequency + +@racketblock[ (let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0)) (f (add (sweep t 700) 500))) (audition (out 0 (mul (sin-osc ar f 0) 0.2)))) +] Using sweep to index into a buffer + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((t (impulse ar (mouse-x kr 0.5 20 1 0.1) 0)) (i (sweep t (buf-sample-rate ir 0)))) (audition (out 0 (buf-rd 1 ar 0 i 0 2)))) +] Backwards, variable offset + +@racketblock[ (let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0)) (r (buf-sample-rate ir 0)) (i (add (sweep t (neg r)) (mul (buf-frames ir 0) (lf-noise0 kr 15))))) (audition (out 0 (buf-rd 1 ar 0 i 0 2)))) +] Raising rate + +@racketblock[ (let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0)) (r (add (sweep t 2) 0.5)) (i (sweep t (mul (buf-sample-rate ir 0) r)))) (audition (out 0 (buf-rd 1 ar 0 i 0 2)))) +] + diff --git a/doc/help/ugen/triggers/t-delay.help.scrbl b/doc/help/ugen/triggers/t-delay.help.scrbl index 3622e72..a6ee231 100644 --- a/doc/help/ugen/triggers/t-delay.help.scrbl +++ b/doc/help/ugen/triggers/t-delay.help.scrbl @@ -3,15 +3,20 @@ @title{(t-delay trigger delayTime)} + Delays a trigger by a given time. Any triggers which arrive in the time between an input trigger and its delayed output, are ignored. trigger - input trigger signal. delayTime - delay time in seconds. + +@racketblock[ (let* ((s (mul (sin-osc ar 440 0) 0.1)) (z (impulse ar 2 0)) (l (mul z 0.1)) (r (mul (toggle-ff (t-delay z 0.5)) s))) (audition (out 0 (mce2 l r)))) +] + diff --git a/doc/help/ugen/triggers/timer.help.scrbl b/doc/help/ugen/triggers/timer.help.scrbl index b9ea611..9a408f2 100644 --- a/doc/help/ugen/triggers/timer.help.scrbl +++ b/doc/help/ugen/triggers/timer.help.scrbl @@ -3,12 +3,17 @@ @title{(timer trig)} + Returns time since last triggered Using timer to modulate sine frequency: the slower the trigger is the higher the frequency + +@racketblock[ (let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0)) (s (sin-osc ar (mul-add (timer t) 500 500) 0))) (audition (out 0 (mul s 0.2)))) +] + diff --git a/doc/help/ugen/triggers/toggle-ff.help.scrbl b/doc/help/ugen/triggers/toggle-ff.help.scrbl index 2a65dd0..f12ce30 100644 --- a/doc/help/ugen/triggers/toggle-ff.help.scrbl +++ b/doc/help/ugen/triggers/toggle-ff.help.scrbl @@ -3,11 +3,16 @@ @title{(toggle-ff trig)} + Toggle flip flop. Toggles between zero and one upon receiving a trigger. trig - trigger input + +@racketblock[ (let* ((t (dust ar (x-line kr 1 1000 60 do-nothing))) (s (sin-osc ar (mul-add (toggle-ff t) 400 800) 0))) (audition (out 0 (mul s 0.1)))) +] + diff --git a/doc/help/ugen/triggers/trig.help.scrbl b/doc/help/ugen/triggers/trig.help.scrbl index db965a5..6949636 100644 --- a/doc/help/ugen/triggers/trig.help.scrbl +++ b/doc/help/ugen/triggers/trig.help.scrbl @@ -3,11 +3,19 @@ @title{(trig in dur)} + When `in' is trigerred output the trigger value for `dur' seconds. + +@racketblock[ (let ((s (f-sin-osc ar 800 0)) (g (trig (dust ar 1) 0.2))) (audition (out 0 (mul3 s g 0.5)))) +] + +@racketblock[ (audition (out 0 (trig (dust ar 4) 0.1))) +] + diff --git a/doc/help/ugen/triggers/trig1.help.scrbl b/doc/help/ugen/triggers/trig1.help.scrbl index fd89e1c..7ad42a3 100644 --- a/doc/help/ugen/triggers/trig1.help.scrbl +++ b/doc/help/ugen/triggers/trig1.help.scrbl @@ -3,8 +3,13 @@ @title{(trig1 in dur)} + When `in' is trigered output a unit signal for `dur' seconds. + +@racketblock[ (let ((a (trig1 (dust ar 1) 0.2))) (audition (out 0 (mul3 (f-sin-osc ar 800 0) a 0.2)))) +] + diff --git a/doc/help/ugen/unary-ops/abs.help.scrbl b/doc/help/ugen/unary-ops/abs.help.scrbl index 438a125..175fcb7 100644 --- a/doc/help/ugen/unary-ops/abs.help.scrbl +++ b/doc/help/ugen/unary-ops/abs.help.scrbl @@ -3,7 +3,12 @@ @title{(abs a)} + Absolute value. -(audition (out 0 (u:abs (mul (sync-saw ar 100 440) 0.1)))) + +@racketblock[ +(audition (out 0 (u:abs (mul (sync-saw ar 100 440) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/amp-db.help.scrbl b/doc/help/ugen/unary-ops/amp-db.help.scrbl index d56ac7a..5c95b37 100644 --- a/doc/help/ugen/unary-ops/amp-db.help.scrbl +++ b/doc/help/ugen/unary-ops/amp-db.help.scrbl @@ -3,14 +3,22 @@ @title{(amp-db a)} + Convert linear amplitude to decibels. + +@racketblock[ (audition (out 0 (mul (f-sin-osc ar 800 0.0) (db-amp (amp-db (line kr 0.5 0.0 5 remove-synth)))))) +] + +@racketblock[ (let* ((x (mouse-x kr -60 0 0 0.1)) (f (mul-add (db-amp x) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/arc-cos.help.scrbl b/doc/help/ugen/unary-ops/arc-cos.help.scrbl index 237fe85..a6c2eea 100644 --- a/doc/help/ugen/unary-ops/arc-cos.help.scrbl +++ b/doc/help/ugen/unary-ops/arc-cos.help.scrbl @@ -3,11 +3,16 @@ @title{(arc-cos a)} + Arc cosine. + +@racketblock[ (let* ((a (line kr -1 1 1 remove-synth)) (b (sub (fdiv (arc-cos a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/arc-sin.help.scrbl b/doc/help/ugen/unary-ops/arc-sin.help.scrbl index ac5fa66..f1fb669 100644 --- a/doc/help/ugen/unary-ops/arc-sin.help.scrbl +++ b/doc/help/ugen/unary-ops/arc-sin.help.scrbl @@ -3,11 +3,16 @@ @title{(arc-sin a)} + Arc sine. + +@racketblock[ (let* ((a (line kr -1 1 1 remove-synth)) (b (sub (fdiv (arc-sin a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/arc-tan.help.scrbl b/doc/help/ugen/unary-ops/arc-tan.help.scrbl index 09ab7ec..799ddad 100644 --- a/doc/help/ugen/unary-ops/arc-tan.help.scrbl +++ b/doc/help/ugen/unary-ops/arc-tan.help.scrbl @@ -3,11 +3,16 @@ @title{(arc-tan a)} + Arc tan. + +@racketblock[ (let* ((a (line kr -1 1 1 remove-synth)) (b (sub (fdiv (arc-tan a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/ceil.help.scrbl b/doc/help/ugen/unary-ops/ceil.help.scrbl index c7639fd..998eb0a 100644 --- a/doc/help/ugen/unary-ops/ceil.help.scrbl +++ b/doc/help/ugen/unary-ops/ceil.help.scrbl @@ -3,10 +3,15 @@ @title{(ceil a)} + Round signal up. + +@racketblock[ (let* ((x (mouse-x kr 65 95 0 0.1)) (f (midi-cps (mce2 (u:floor x) (ceil x))))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/cos-h.help.scrbl b/doc/help/ugen/unary-ops/cos-h.help.scrbl index c2bbd50..5e88944 100644 --- a/doc/help/ugen/unary-ops/cos-h.help.scrbl +++ b/doc/help/ugen/unary-ops/cos-h.help.scrbl @@ -3,11 +3,16 @@ @title{(cos-h a)} + Cosine. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (cos-h a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/cos.help.scrbl b/doc/help/ugen/unary-ops/cos.help.scrbl index a48d3c9..f182ce5 100644 --- a/doc/help/ugen/unary-ops/cos.help.scrbl +++ b/doc/help/ugen/unary-ops/cos.help.scrbl @@ -3,11 +3,16 @@ @title{(cos a)} + Cosine. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (u:cos a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/cps-midi.help.scrbl b/doc/help/ugen/unary-ops/cps-midi.help.scrbl index 851b3c0..40ad174 100644 --- a/doc/help/ugen/unary-ops/cps-midi.help.scrbl +++ b/doc/help/ugen/unary-ops/cps-midi.help.scrbl @@ -3,9 +3,14 @@ @title{(cps-midi a)} + Convert cycles per second to MIDI note. + +@racketblock[ (let ((f (line kr 600 900 5 remove-synth))) (audition (out 0 (mul (saw ar (midi-cps (cps-midi f))) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/cps-oct.help.scrbl b/doc/help/ugen/unary-ops/cps-oct.help.scrbl index 60e1d1e..9bfa8a4 100644 --- a/doc/help/ugen/unary-ops/cps-oct.help.scrbl +++ b/doc/help/ugen/unary-ops/cps-oct.help.scrbl @@ -3,9 +3,14 @@ @title{(cps-oct a)} + Convert cycles per second to decimal octaves. + +@racketblock[ (audition (let ((f (oct-cps (cps-oct (x-line kr 600 900 6 remove-synth))))) (out 0 (mul (saw ar f) 0.2)))) +] + diff --git a/doc/help/ugen/unary-ops/cubed.help.scrbl b/doc/help/ugen/unary-ops/cubed.help.scrbl index bd34611..2b97e25 100644 --- a/doc/help/ugen/unary-ops/cubed.help.scrbl +++ b/doc/help/ugen/unary-ops/cubed.help.scrbl @@ -3,11 +3,16 @@ @title{(cubed a)} + Cube. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (cubed a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/db-amp.help.scrbl b/doc/help/ugen/unary-ops/db-amp.help.scrbl index 81f3978..6782b93 100644 --- a/doc/help/ugen/unary-ops/db-amp.help.scrbl +++ b/doc/help/ugen/unary-ops/db-amp.help.scrbl @@ -3,9 +3,14 @@ @title{(db-amp a)} + Convert decibels to linear amplitude. + +@racketblock[ (audition (out 0 (mul (f-sin-osc ar 800 0.0) (db-amp (line kr -3 -40 10 remove-synth))))) +] + diff --git a/doc/help/ugen/unary-ops/distort.help.scrbl b/doc/help/ugen/unary-ops/distort.help.scrbl index d9c4a75..ed19191 100644 --- a/doc/help/ugen/unary-ops/distort.help.scrbl +++ b/doc/help/ugen/unary-ops/distort.help.scrbl @@ -3,10 +3,15 @@ @title{(distort a)} + Nonlinear distortion. + +@racketblock[ (audition (out 0 (mul (distort (mul (f-sin-osc ar 500 0.0) (x-line kr 0.1 10 10 do-nothing))) 0.25))) +] + diff --git a/doc/help/ugen/unary-ops/exp.help.scrbl b/doc/help/ugen/unary-ops/exp.help.scrbl index 90fdd68..1bf60eb 100644 --- a/doc/help/ugen/unary-ops/exp.help.scrbl +++ b/doc/help/ugen/unary-ops/exp.help.scrbl @@ -3,11 +3,16 @@ @title{(exp a)} + Exponential. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (u:exp a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/floor.help.scrbl b/doc/help/ugen/unary-ops/floor.help.scrbl index 40dd7af..01716e8 100644 --- a/doc/help/ugen/unary-ops/floor.help.scrbl +++ b/doc/help/ugen/unary-ops/floor.help.scrbl @@ -3,10 +3,15 @@ @title{(u:floor a)} + Round signal down. + +@racketblock[ (let* ((x (mouse-x kr 65 95 0 0.1)) (f (midi-cps (u:floor x)))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/frac.help.scrbl b/doc/help/ugen/unary-ops/frac.help.scrbl index 982f47a..f2eda62 100644 --- a/doc/help/ugen/unary-ops/frac.help.scrbl +++ b/doc/help/ugen/unary-ops/frac.help.scrbl @@ -3,11 +3,16 @@ @title{(frac a)} + Fractional part. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (frac a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/is-negative.help.scrbl b/doc/help/ugen/unary-ops/is-negative.help.scrbl index c958e50..5bffe54 100644 --- a/doc/help/ugen/unary-ops/is-negative.help.scrbl +++ b/doc/help/ugen/unary-ops/is-negative.help.scrbl @@ -3,14 +3,22 @@ @title{(is-negative a)} + Predicate to determine if a value is negative. + +@racketblock[ (define (is-negative a) (lt a 0.0)) +] + +@racketblock[ (let* ((a (line ar -1 1 1 remove-synth)) (b (is-negative a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/is-positive.help.scrbl b/doc/help/ugen/unary-ops/is-positive.help.scrbl index 77fc930..ea722c0 100644 --- a/doc/help/ugen/unary-ops/is-positive.help.scrbl +++ b/doc/help/ugen/unary-ops/is-positive.help.scrbl @@ -3,14 +3,22 @@ @title{(is-positive a)} + Predicate to determine if a value is positive. + +@racketblock[ (define (is-positive a) (ge a 0.0)) +] + +@racketblock[ (let* ((a (line ar -1 1 1 remove-synth)) (b (is-positive a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/is-strictly-positive.help.scrbl b/doc/help/ugen/unary-ops/is-strictly-positive.help.scrbl index 0f40fad..32afe44 100644 --- a/doc/help/ugen/unary-ops/is-strictly-positive.help.scrbl +++ b/doc/help/ugen/unary-ops/is-strictly-positive.help.scrbl @@ -3,14 +3,22 @@ @title{(is-strictly-positive a)} + Predicate to determine if a value is strictly positive. + +@racketblock[ (define (is-strictly-positive a) (gt a 0.0)) +] + +@racketblock[ (let* ((a (line ar -1 1 1 remove-synth)) (b (is-strictly-positive a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/log.help.scrbl b/doc/help/ugen/unary-ops/log.help.scrbl index 40e536a..3052615 100644 --- a/doc/help/ugen/unary-ops/log.help.scrbl +++ b/doc/help/ugen/unary-ops/log.help.scrbl @@ -3,11 +3,16 @@ @title{(u:log a)} + Reciprocal. + +@racketblock[ (let* ((a (line ar -2 2 2 remove-synth)) (b (u:log a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/log10.help.scrbl b/doc/help/ugen/unary-ops/log10.help.scrbl index 4566b98..45c33d2 100644 --- a/doc/help/ugen/unary-ops/log10.help.scrbl +++ b/doc/help/ugen/unary-ops/log10.help.scrbl @@ -3,11 +3,16 @@ @title{(log10 a)} + Base ten logarithm. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (log10 a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/log2.help.scrbl b/doc/help/ugen/unary-ops/log2.help.scrbl index 9bb92b6..54d8e7c 100644 --- a/doc/help/ugen/unary-ops/log2.help.scrbl +++ b/doc/help/ugen/unary-ops/log2.help.scrbl @@ -3,11 +3,16 @@ @title{(log2 a)} + Base two logarithm. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (log2 a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/midi-cps.help.scrbl b/doc/help/ugen/unary-ops/midi-cps.help.scrbl index b38585b..b217412 100644 --- a/doc/help/ugen/unary-ops/midi-cps.help.scrbl +++ b/doc/help/ugen/unary-ops/midi-cps.help.scrbl @@ -3,8 +3,13 @@ @title{(midi-cps a)} + Convert MIDI note to cycles per second. + +@racketblock[ (audition (out 0 (mul (saw ar (midi-cps (line kr 24 108 10 remove-synth))) 0.2))) +] + diff --git a/doc/help/ugen/unary-ops/neg.help.scrbl b/doc/help/ugen/unary-ops/neg.help.scrbl index b0486f3..cd2e56a 100644 --- a/doc/help/ugen/unary-ops/neg.help.scrbl +++ b/doc/help/ugen/unary-ops/neg.help.scrbl @@ -3,10 +3,15 @@ @title{(neg a)} + Negation. + +@racketblock[ (let ((s (sin-osc ar 440 0))) (audition (out 0 (mce2 (mul s 0.1) (add s (neg s)))))) +] + diff --git a/doc/help/ugen/unary-ops/oct-cps.help.scrbl b/doc/help/ugen/unary-ops/oct-cps.help.scrbl index 10ecb8e..891f1f3 100644 --- a/doc/help/ugen/unary-ops/oct-cps.help.scrbl +++ b/doc/help/ugen/unary-ops/oct-cps.help.scrbl @@ -3,13 +3,21 @@ @title{(oct-cps a)} + Convert decimal octaves to cycles per second. + +@racketblock[ (audition (let ((f (oct-cps (line kr 2 9 6 remove-synth)))) (out 0 (mul (saw ar f) 0.2)))) +] + +@racketblock[ (audition (let ((f (oct-cps (u:round (line kr 2 9 6 remove-synth) (/ 1 12))))) (out 0 (mul (saw ar f) 0.2)))) +] + diff --git a/doc/help/ugen/unary-ops/sign.help.scrbl b/doc/help/ugen/unary-ops/sign.help.scrbl index 4bf14a1..e698df7 100644 --- a/doc/help/ugen/unary-ops/sign.help.scrbl +++ b/doc/help/ugen/unary-ops/sign.help.scrbl @@ -3,11 +3,16 @@ @title{(sign a)} + Sign function. -1 when a < 0, +1 when a > 0, 0 when a is 0 + +@racketblock[ (let* ((a (line ar -1 1 1 remove-synth)) (b (sign a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/sin-h.help.scrbl b/doc/help/ugen/unary-ops/sin-h.help.scrbl index eb68c53..1db58db 100644 --- a/doc/help/ugen/unary-ops/sin-h.help.scrbl +++ b/doc/help/ugen/unary-ops/sin-h.help.scrbl @@ -3,11 +3,16 @@ @title{(sin-h a)} + Sine. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (sin-h a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/sin.help.scrbl b/doc/help/ugen/unary-ops/sin.help.scrbl index b5295f3..feec6ac 100644 --- a/doc/help/ugen/unary-ops/sin.help.scrbl +++ b/doc/help/ugen/unary-ops/sin.help.scrbl @@ -3,11 +3,16 @@ @title{(u:sin a)} + Sine. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (u:sin a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/soft-clip.help.scrbl b/doc/help/ugen/unary-ops/soft-clip.help.scrbl index d998dae..f8b4acf 100644 --- a/doc/help/ugen/unary-ops/soft-clip.help.scrbl +++ b/doc/help/ugen/unary-ops/soft-clip.help.scrbl @@ -3,11 +3,16 @@ @title{(soft-clip a)} + Nonlinear distortion. Distortion with a perfectly linear region from -0.5 to +0.5. + +@racketblock[ (audition (out 0 (mul (soft-clip (mul (f-sin-osc ar 500 0.0) (x-line kr 0.1 10 10 do-nothing))) 0.25))) +] + diff --git a/doc/help/ugen/unary-ops/sqrt.help.scrbl b/doc/help/ugen/unary-ops/sqrt.help.scrbl index 7d5dba1..1f1fa23 100644 --- a/doc/help/ugen/unary-ops/sqrt.help.scrbl +++ b/doc/help/ugen/unary-ops/sqrt.help.scrbl @@ -3,12 +3,17 @@ @title{(u:sqrt a)} + Square root. The definition of square root is extended for signals so that sqrt(a) when a<0 returns -sqrt(-a). + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (u:sqrt a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/squared.help.scrbl b/doc/help/ugen/unary-ops/squared.help.scrbl index aad59ce..b4a915b 100644 --- a/doc/help/ugen/unary-ops/squared.help.scrbl +++ b/doc/help/ugen/unary-ops/squared.help.scrbl @@ -3,11 +3,16 @@ @title{(squared a)} + Square. + +@racketblock[ (let* ((a (line ar -2 2 3 remove-synth)) (b (squared a)) (f (mul-add (mce2 a b) 600 900))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/tan-h.help.scrbl b/doc/help/ugen/unary-ops/tan-h.help.scrbl index 273a519..223e6a7 100644 --- a/doc/help/ugen/unary-ops/tan-h.help.scrbl +++ b/doc/help/ugen/unary-ops/tan-h.help.scrbl @@ -3,11 +3,16 @@ @title{(tan-h a)} + Tangent. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (tan-h a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/ugen/unary-ops/tan.help.scrbl b/doc/help/ugen/unary-ops/tan.help.scrbl index 29e591d..7e50593 100644 --- a/doc/help/ugen/unary-ops/tan.help.scrbl +++ b/doc/help/ugen/unary-ops/tan.help.scrbl @@ -3,11 +3,16 @@ @title{(u:tan a)} + Tangent. + +@racketblock[ (let* ((a (line kr (- pi) pi 1 remove-synth)) (b (sub (fdiv (u:tan a) (/ pi 2)) 1)) (f (mul-add b 900 1600))) (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +] + diff --git a/doc/help/unsorted/convolution2.help.scrbl b/doc/help/unsorted/convolution2.help.scrbl index f6f10b0..23fd05f 100644 --- a/doc/help/unsorted/convolution2.help.scrbl +++ b/doc/help/unsorted/convolution2.help.scrbl @@ -1,8 +1,11 @@ #lang scribble/manual @(require (for-label racket)) -@title{convolution2 +@title{convolution2} + + +@racketblock[ (with-sc3 (lambda (fd) (for-each @@ -26,43 +29,90 @@ (letc ((k 0) (t 0)) (let ((i (impulse 1 0))) (out 0 (mul (convolution2 i k t 2048) 0.5))))))) +] + +@racketblock[ (define send-to (lambda (m) (with-sc3 (lambda (fd) (send fd m))))) +] + +@racketblock[ (define async-to (lambda (m) (with-sc3 (lambda (fd) (async fd m))))) +] + +@racketblock[ (send-to (s-new1 "c" 1001 1 1 "k" 10)) +] + +@racketblock[ (send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) +] +@racketblock[ +(send-to (n-set1 1001 "t" 0)) +] + +@racketblock[ +(send-to (n-set1 1001 "t" 1)) +] + + +@racketblock[ (send-to (n-set1 1001 "k" 12)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 0)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 1)) +] + +@racketblock[ (async-to (b-zero 12)) +] + +@racketblock[ (for-each (lambda (n) (send-to (b-set1 12 (+ (* 20 n) 10) 1))) (enumFromTo 0 39)) +] + +@racketblock[ (send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))} +] + +@racketblock[ +(send-to (n-set1 1001 "t" 1)) +] with soundfile -(async-to (b-alloc-read 10 "/home/rohan/data/audio/metal.wav" 0 0)) +@racketblock[ +(async-to (b-alloc-read 10 "/home/rohan/data/audio/metal.wav" 0 0)) +] + + +@racketblock[ (let ((i (sound-in 0))) (mul (convolution2 i 10 0 512) 0.5)) +] + diff --git a/doc/help/unsorted/disk-in.help.scrbl b/doc/help/unsorted/disk-in.help.scrbl index fff2bd6..f5d16e1 100644 --- a/doc/help/unsorted/disk-in.help.scrbl +++ b/doc/help/unsorted/disk-in.help.scrbl @@ -1,8 +1,11 @@ #lang scribble/manual @(require (for-label racket)) -@title{disk-in +@title{disk-in} + + +@racketblock[ (let ((f "/home/rohan/data/audio/metal.wav") (nc 1)) (with-sc3 @@ -10,12 +13,19 @@ (async fd (b-alloc 0 8192 nc)) (async fd (b-read 0 f 0 -1 0 1)) (play fd (out 0 (disk-in nc 0 0)))))) +] + +@racketblock[ (with-sc3 reset) +] + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-close 0)) - (async fd (b-free 0))))} + (async fd (b-free 0)))) +] diff --git a/doc/help/unsorted/disk-out.help.scrbl b/doc/help/unsorted/disk-out.help.scrbl index f56b8a4..87b039c 100644 --- a/doc/help/unsorted/disk-out.help.scrbl +++ b/doc/help/unsorted/disk-out.help.scrbl @@ -1,13 +1,19 @@ #lang scribble/manual @(require (for-label racket)) -@title{(disk-out bufnum channels) +@title{(disk-out bufnum channels)} + + +@racketblock[ (let ((bus-size 1024) (bufferexpt 15)) (= 0 (fxand (expt 2 bufferexpt) (- (fxarithmetic-shift bus-size 1) 1)))) +] + +@racketblock[ (let ((g (letc ((bufnum 0)) (let ((z (clip2 (rlpf @@ -32,14 +38,24 @@ 0 1)) (send fd (s-new1 "disk-out-help" 1001 1 1 "bufnum" 10))))) +] + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-free1 1001)) (async fd (b-close 10)) (async fd (b-free 10)))) +] + +@racketblock[ (system "sndfile-info /tmp/test.aiff") -(system "jack-play /tmp/test.aiff")} +] + +@racketblock[ +(system "jack-play /tmp/test.aiff") +] diff --git a/doc/help/unsorted/free.help.scrbl b/doc/help/unsorted/free.help.scrbl index 88b9dc5..131937a 100644 --- a/doc/help/unsorted/free.help.scrbl +++ b/doc/help/unsorted/free.help.scrbl @@ -1,14 +1,21 @@ #lang scribble/manual @(require (for-label racket)) -@title{free +@title{free} + + +@racketblock[ (withSc3 (lambda (fd) (sendSynth fd "a" (Out 0 (Mul (SinOsc 800 0) 0.1))) (sendSynth fd "b" (Mrg2 (Out 1 (Mul (PinkNoise) 0.1)) (Free (Dust 6) 1001))) (sendMessage fd (s_new0 "a" 1001 0 0)) (sendMessage fd (s_new0 "b" -1 0 0)))) - -(withSc3 reset)} +] + + +@racketblock[ +(withSc3 reset) +] diff --git a/doc/help/unsorted/gbman-c.help.scrbl b/doc/help/unsorted/gbman-c.help.scrbl index 4bd9e42..6ee82e6 100644 --- a/doc/help/unsorted/gbman-c.help.scrbl +++ b/doc/help/unsorted/gbman-c.help.scrbl @@ -1,8 +1,11 @@ #lang scribble/manual @(require (for-label racket)) -@title{gbman-c} +@title{gbman-c ; c.f. gbman-l} -c.f. gbman-l + +@racketblock[ (mul (gbman-c (mouse-x 20 sample-rate 0 0.1) 1.2 2.1) 0.05) +] + diff --git a/doc/help/unsorted/linen.scrbl b/doc/help/unsorted/linen.scrbl index d8e9045..a6c1d1d 100644 --- a/doc/help/unsorted/linen.scrbl +++ b/doc/help/unsorted/linen.scrbl @@ -1,9 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{linen} +@title{linen ; open gate for random interval} -open gate for random interval + +@racketblock[ (let* ((r (s:rand 0.05 0.4)) (u (letc ((gate 0)) (let ((e (linen gate 0.1 0.2 0.1 do-nothing))) @@ -17,4 +18,6 @@ open gate for random interval (send fd (bundle (+ (utcr) r) (list (n-set1 1001 "gate" 0)))) (pauseThread (* r 4)) (send fd (n-free1 1001))))) +] + diff --git a/doc/help/unsorted/mrg.help.scrbl b/doc/help/unsorted/mrg.help.scrbl index f6c465d..839995f 100644 --- a/doc/help/unsorted/mrg.help.scrbl +++ b/doc/help/unsorted/mrg.help.scrbl @@ -1,10 +1,13 @@ #lang scribble/manual @(require (for-label racket)) -@title{mrg} +@title{mrg ; the implementation is not thorough (error...)} -the implementation is not thorough (error...) + +@racketblock[ (let ((l (mul (sin-osc (mce2 300 400) 0) 0.1)) (r (out 1 (mul (sin-osc 900 0) 0.1)))) (add (mrg2 l r) (mrg2 l r))) +] + diff --git a/doc/help/unsorted/pack-fft.help.scrbl b/doc/help/unsorted/pack-fft.help.scrbl index c6f2079..8f241bc 100644 --- a/doc/help/unsorted/pack-fft.help.scrbl +++ b/doc/help/unsorted/pack-fft.help.scrbl @@ -1,7 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{pack-fft +@title{pack-fft} + + +@racketblock[ (let* ((n 100) (n* (enumFromTo 1 n)) (m1 (map (lambda (_) (range (f-sin-osc (exp-rand 0.1 1) 0) 0 1)) n*)) @@ -13,6 +16,7 @@ (c1 (fft* (local-buf 1 512) (f-sin-osc 440 0))) (c2 (pack-fft c1 512 0 (- n 1) 1 (packfft-data m3 p))) (s (ifft* c2))) - (mce2 s s))} + (mce2 s s)) +] diff --git a/doc/help/unsorted/pause.help.scrbl b/doc/help/unsorted/pause.help.scrbl index 617dbd7..3b2caba 100644 --- a/doc/help/unsorted/pause.help.scrbl +++ b/doc/help/unsorted/pause.help.scrbl @@ -1,7 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{pause +@title{pause} + + +@racketblock[ (with-sc3 (lambda (fd) (send-synth fd "a" (out 0 (mul (sin-osc 800 0) 0.1))) @@ -13,6 +16,7 @@ (pause-thread 1) (send fd (n-set1 1002 "g" 1)) (pause-thread 1) - (reset fd)))} + (reset fd))) +] diff --git a/doc/help/unsorted/poll.scrbl b/doc/help/unsorted/poll.scrbl index dcf6ccd..ecab09a 100644 --- a/doc/help/unsorted/poll.scrbl +++ b/doc/help/unsorted/poll.scrbl @@ -1,7 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{poll +@title{poll} + + +@racketblock[ (with-sc3 (lambda (fd) (letrec ((print (lambda (e) (display e) (newline))) @@ -9,6 +12,7 @@ (repeat (lambda (f) (if (f) (repeat f) #f)))) (async fd (notify 1)) (repeat (showing (lambda () (wait fd "/tr")))) - (async fd (notify 0)))))} + (async fd (notify 0))))) +] diff --git a/doc/help/unsorted/pv-mag-mul.help.scrbl b/doc/help/unsorted/pv-mag-mul.help.scrbl index 55f39ab..131c985 100644 --- a/doc/help/unsorted/pv-mag-mul.help.scrbl +++ b/doc/help/unsorted/pv-mag-mul.help.scrbl @@ -4,3 +4,5 @@ @title{pv-mag-mul} + + diff --git a/doc/help/unsorted/pv-mag-shift.help.scrbl b/doc/help/unsorted/pv-mag-shift.help.scrbl index 7c6cc1b..2f9327f 100644 --- a/doc/help/unsorted/pv-mag-shift.help.scrbl +++ b/doc/help/unsorted/pv-mag-shift.help.scrbl @@ -4,3 +4,5 @@ @title{pv-mag-shift} + + diff --git a/doc/help/unsorted/pv-max.help.scrbl b/doc/help/unsorted/pv-max.help.scrbl index a8c53df..d50ceda 100644 --- a/doc/help/unsorted/pv-max.help.scrbl +++ b/doc/help/unsorted/pv-max.help.scrbl @@ -4,3 +4,4 @@ @title{pv-max} + diff --git a/doc/help/unsorted/pv-min.help.scrbl b/doc/help/unsorted/pv-min.help.scrbl index baf43e9..ebd8248 100644 --- a/doc/help/unsorted/pv-min.help.scrbl +++ b/doc/help/unsorted/pv-min.help.scrbl @@ -4,3 +4,4 @@ @title{pv-min} + diff --git a/doc/help/unsorted/pv-rect-comb2.help.scrbl b/doc/help/unsorted/pv-rect-comb2.help.scrbl index 146ed79..e7110a4 100644 --- a/doc/help/unsorted/pv-rect-comb2.help.scrbl +++ b/doc/help/unsorted/pv-rect-comb2.help.scrbl @@ -4,3 +4,4 @@ @title{pv-rect-comb2} + diff --git a/doc/help/unsorted/pvcollect.help.scrbl b/doc/help/unsorted/pvcollect.help.scrbl index 347c528..74ca5ec 100644 --- a/doc/help/unsorted/pvcollect.help.scrbl +++ b/doc/help/unsorted/pvcollect.help.scrbl @@ -1,47 +1,75 @@ #lang scribble/manual @(require (for-label racket)) -@title{pvcollect +@title{pvcollect} + + +@racketblock[ (define no-op (lambda (m p _) (list m p))) +] + +@racketblock[ (define rand-phase (lambda (m p _) (list m (rand 0 3.14)))) +] + +@racketblock[ (define noise-phase (lambda (m p _) (list m (lin-lin (lf-noise0 3) -1 1 0 3.14)))) +] + +@racketblock[ (define combf (lambda (m p i) (list (if (= (modulo i 7) 0) m 0) p))) +] + +@racketblock[ (define noise-mag (lambda (m p _) (list (mul (gt (lf-noise0 10) 0) m) p))) +] + +@racketblock[ (define spectral-delay (lambda (m p _) (let ((v (lin-lin (lf-par 0.5 0) -1 1 0.1 1))) (list (add m (delay-n m 1 v)) p)))) +] + +@racketblock[ (define (bpf-sweep nf) (lambda (m p i) (let ((e (u:abs (sub i (lin-lin (lf-par 0.1 0) -1 1 2 (/ nf 20)))))) (list (mul (lt e 10) m) p)))) +] + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 10 1024 1)) (async fd (b-alloc-read 11 "/home/rohan/data/audio/metal.wav" 0 0)))) +] + +@racketblock[ (let* ((nf 1024) (i (play-buf 1 11 (buf-rate-scale 11) 1 0 loop do-nothing)) (c1 (fft* 10 i)) (c2 (pvcollect c1 nf spectral-delay 0 250 0))) - (mul 0.1 (ifft* c2)))} + (mul 0.1 (ifft* c2))) +] diff --git a/doc/help/unsorted/rand-id.help.scrbl b/doc/help/unsorted/rand-id.help.scrbl index 6b88f58..68afaa9 100644 --- a/doc/help/unsorted/rand-id.help.scrbl +++ b/doc/help/unsorted/rand-id.help.scrbl @@ -3,7 +3,10 @@ @title{rand-id} + graphs (r & s) to generate noise in the context of a given RNG and to reset a specified RNG + +@racketblock[ (with-sc3 (lambda (fd) (send-synth @@ -16,23 +19,37 @@ graphs (r & s) to generate noise in the context of a given RNG and to reset a sp (letc ((seed 1910) (id 1)) (mrg2 (rand-id id) (rand-seed (impulse (mul-add (f-sin-osc 0.2 0) 10 11) 0) seed)))))) +] start synths on left and right channel with a different randgen ids + +@racketblock[ (with-sc3 (lambda (fd) (send fd (s-new2 "r" 1001 1 1 "bus" 0 "id" 1)) (send fd (s-new2 "r" 1002 1 1 "bus" 1 "id" 2)))) +] reset the seed of randgen 1 + +@racketblock[ (with-sc3 (lambda (fd) (send fd (s-new1 "s" 1003 1 1 "id" 1)))) +] change the target RNG with ID 2, ie. effect right channel + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-set1 1003 "id" 2)))) +] free nodes + +@racketblock[ (with-sc3 (lambda (fd) (send fd (n-free1 1001)) (send fd (n-free1 1002)) (send fd (n-free1 1003)))) +] + diff --git a/doc/help/unsorted/record-buf.help.scrbl b/doc/help/unsorted/record-buf.help.scrbl index 74358cb..ac14af9 100644 --- a/doc/help/unsorted/record-buf.help.scrbl +++ b/doc/help/unsorted/record-buf.help.scrbl @@ -3,19 +3,34 @@ @title{record-buf} + allocate buffer (assume sample-rate of 48000) + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-alloc 0 (* 48000 4) 1)))) +] record for four seconds (until end of buffer) + +@racketblock[ (let ((o (mul (formant (x-line 400 1000 4 do-nothing) 2000 800) 0.125))) (mrg2 o (record-buf 0 0 1 0 1 no-loop 1 remove-synth o))) +] play it back + +@racketblock[ (play-buf 1 0 1 1 0 no-loop remove-synth) +] ... -(with-sc3 (lambda (fd) (async fd (b-alloc 0 (* 48000 4) 1)))) +@racketblock[ +(with-sc3 (lambda (fd) (async fd (b-alloc 0 (* 48000 4) 1)))) +] + + +@racketblock[ (define recorder (letc ((bus 0) (bufnum 0) @@ -27,7 +42,10 @@ play it back (trigger 1)) (let ((i (in 2 (add num-output-buses bus)))) (record-buf bufnum offset recLevel preLevel run loop trigger do-nothing i)))) +] + +@racketblock[ (define player (letc ((bufnum 0) (rate 1) @@ -36,7 +54,10 @@ play it back (loop 1) (gain 1)) (out 0 (mul (play-buf 2 bufnum rate trigger startPos loop do-nothing) gain)))) +] + +@racketblock[ (with-sc3 (lambda (fd) (send-synth fd "recorder" recorder) @@ -48,23 +69,49 @@ play it back (send fd (n-trace y)) (send-synth fd "player" player) (send fd (s-new1 "player" z add-to-tail 1 "bufnum" b))))) +] + +@racketblock[ (define do-send (lambda (m) (with-sc3 (lambda (fd) (send fd m))))) +] + +@racketblock[ (do-send (n-set1 1001 "run" 1)) +] + +@racketblock[ (do-send (n-set1 1002 "loop" 1)) +] + +@racketblock[ (do-send (n-set1 1002 "gain" 2)) +] + +@racketblock[ (do-send (n-set1 1002 "trigger" 1)) +] + +@racketblock[ (do-send (n-free1 1001)) -(do-send (n-free1 1002)) +] +@racketblock[ +(do-send (n-free1 1002)) +] + + +@racketblock[ (with-sc3 (lambda (fd) (async fd (b-free 10)))) +] + diff --git a/doc/help/unsorted/rossler.help.scrbl b/doc/help/unsorted/rossler.help.scrbl index 3b0a866..8346a20 100644 --- a/doc/help/unsorted/rossler.help.scrbl +++ b/doc/help/unsorted/rossler.help.scrbl @@ -4,5 +4,9 @@ @title{rossler} not-implemented -(mul (rossler 4 0.08) 0.1) + +@racketblock[ +(mul (rossler 4 0.08) 0.1) +] + diff --git a/doc/help/unsorted/shift-left.help.scrbl b/doc/help/unsorted/shift-left.help.scrbl index b75861f..02dab0a 100644 --- a/doc/help/unsorted/shift-left.help.scrbl +++ b/doc/help/unsorted/shift-left.help.scrbl @@ -4,3 +4,4 @@ @title{the sc3 ** operator is the shift-left binary ugen} + diff --git a/doc/help/unsorted/subsample-offset.help.scrbl b/doc/help/unsorted/subsample-offset.help.scrbl index d698e27..9207bb9 100644 --- a/doc/help/unsorted/subsample-offset.help.scrbl +++ b/doc/help/unsorted/subsample-offset.help.scrbl @@ -3,7 +3,11 @@ @title{subsample-offset} + + demonstrate cubic subsample interpolation, an impulse train that can be moved between samples + +@racketblock[ (with-sc3 (lambda (fd) (send-synth @@ -18,12 +22,15 @@ demonstrate cubic subsample interpolation, an impulse train that can be moved be (mouse-x 0 add-offset 0 0.1))) (r (delay-c i (mul d (add 1 x)) (mul d (add o x))))) (offset-out out r)))))) +] Create two pulse trains one sample apart, move one relative to the other. When cursor is at the left, the impulsese adjacent, on the right, theye exactly 1 sample apart. View this with an oscilloscope. + +@racketblock[ (with-sc3 (lambda (fd) (let ((t (utcr)) @@ -32,4 +39,6 @@ oscilloscope. (list (s-new1 "s" -1 1 1 "addOffset" 3)))) (send fd (bundle (+ t 0.2 dt) (list (s-new1 "s" -1 1 1 "addOffset" 0))))))) +] + diff --git a/doc/help/unsorted/v-osc.help.scrbl b/doc/help/unsorted/v-osc.help.scrbl index 00c5406..66084f5 100644 --- a/doc/help/unsorted/v-osc.help.scrbl +++ b/doc/help/unsorted/v-osc.help.scrbl @@ -1,7 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{allocate and fill tables 0 to 7, c.f. v-osc3 +@title{allocate and fill tables 0 to 7, c.f. v-osc3} + + +@racketblock[ (with-sc3 (lambda (fd) (let* ((square @@ -13,18 +16,26 @@ (a (map (lambda (j) (square (/ (- n j) n))) (enumFromTo 0 (- n 1))))) (async fd (b-gen1 i "sine1" (cons 7 a))))))) - (for-each nth (enumFromTo 0 7)))))} + (for-each nth (enumFromTo 0 7))))) +] -v-osc buffers 0 through 7 +v-osc ; buffers 0 through 7 + +@racketblock[ (let ((b (mouse-x 0 7 0 0.1)) (f (mce2 120 121))) (mul (v-osc b f 0) 0.1)) +] reallocate buffers while oscillator is running + +@racketblock[ (with-sc3 (lambda (fd) (for-each (lambda (i) (async fd (b-gen1 i "sine1" (cons 7 (replicateM 16 (lambda () (s:rand 0 1))))))) (enumFromTo 0 7)))) +] + diff --git a/doc/help/unsorted/v-osc3.help.scrbl b/doc/help/unsorted/v-osc3.help.scrbl index d3b552d..26f8ffe 100644 --- a/doc/help/unsorted/v-osc3.help.scrbl +++ b/doc/help/unsorted/v-osc3.help.scrbl @@ -1,7 +1,10 @@ #lang scribble/manual @(require (for-label racket)) -@title{allocate and fill tables 0 to 7 with a generated list of harmonic amplitudes +@title{allocate and fill tables 0 to 7 with a generated list of harmonic amplitudes} + + +@racketblock[ (with-sc3 (lambda (fd) (let* ((square @@ -14,20 +17,28 @@ (square (/ (- n j) n))) (enumFromTo 0 (- n 1))))) (async fd (b-gen1 i "sine1" (cons 7 a))))))) - (for-each nth (enumFromTo 0 7)))))} + (for-each nth (enumFromTo 0 7))))) +] -v-osc3 buffers 0 through 7 +v-osc3 ; buffers 0 through 7 + +@racketblock[ (let ((p (mouse-x 0 7 0 0.1)) (f1 (mce2 240 241)) (f2 (mce2 240.27 241.1)) (f3 (mce2 240.43 239.71))) (mul (v-osc3 p f1 f2 f3) 0.1)) +] reallocate buffers while oscillator is running + +@racketblock[ (with-sc3 (lambda (fd) (for-each (lambda (i) (async fd (b-gen1 i "sine1" (cons 7 (replicateM 16 (lambda () (s:rand 0 1))))))) (enumFromTo 0 7)))) +] + diff --git a/doc/rsc3-docs/doc-index.html b/doc/rsc3-docs/doc-index.html index b52ff0e..43c0e44 100644 --- a/doc/rsc3-docs/doc-index.html +++ b/doc/rsc3-docs/doc-index.html @@ -1,191 +1,2 @@ -Index

Index

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

(abs a)
(abs-dif a b)
(add a b)
(allpass-n in maxDelayTime delayTime decayTime)
(am-clip a b)
(amp-comp freq root exp)
(amp-compA freq root minAmp rootAmp)
(amp-db a)
(amplitude rate in attackTime releaseTime)
(arc-cos a)
(arc-sin a)
(arc-tan a)
(Atan2 x y)
(ball in g damp friction)
(bpf in freq rq)
(bpz2 in)
(brf in freq rq)
(brown-noise rate)
(brz2 in)
(buf-allpass-c buf in delaytime decaytime)
(buf-channels rate bufnum)
(buf-comb-c buf in delaytime decaytime)
(buf-delay-c buf in delaytime)
(buf-dur rate bufnum)
(buf-frames rate bufnum)
(buf-rate-scale rate bufnum)
(buf-rd numChannels rate bufnum phase loop interpolation)
(buf-sample-rate rate bufnum)
(ceil a)
(clip in lo hi)
(clip-noise rate)
(clip2 a b)
(coin-gate prob in)
(comb-n in maxDelayTime delayTime decayTime)
(compander input control thresh slopeBelow slopeAbove clampTime relaxTime)
(convolution in kernel framesize)
(convolution2 in bufnum trigger framesize) - -#| - -Strict convolution with fixed kernel which can be updated using a -trigger signal. - -in - processing target -bufnum - buffer index for the fixed kernel, may be modulated in - combination with the trigger -trigger - update the kernel on a change from <=0 to >0 -framesize - size of fft frame, must be a power of two. convolution - uses twice this number internally, maximum value you - can give this argument is 2^16=65536. Note that it gets - progressively more expensive to run for higher powers! - 512, 1024, 2048, 4096 standard. - -|# - -(with-sc3 - (lambda (fd) - (for-each - (lambda (b) - (async fd (b-alloc b 2048 1))) - (list 10 11 12)) - (for-each - (lambda (n) - (send fd (b-set1 10 (+ (* 400 n) 100) 1))) - (enum-from-to 0 2)) - (for-each - (lambda (n) - (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1)))) - (enum-from-to 0 49)) - (for-each - (lambda (n) - (send fd (b-set1 12 (+ (* 40 n) 20) 1))) - (enum-from-to 0 19)) - (send-synth - fd "c" - (letc ((k 0) (t 0)) - (let ((i (impulse ar 1 0))) - (out 0 (mul (convolution2 i k t 2048) 0.5))))))) - -(define send-to - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m))))) - -(define async-to - (lambda (m) - (with-sc3 - (lambda (fd) - (async fd m))))) - -(send-to (s-new1 "c" 1001 1 1 "k" 10)) - -(send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(send-to (n-set1 1001 "k" 12)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(async-to (b-zero 12)) - -(for-each - (lambda (n) - (send-to (b-set1 12 (+ (* 20 n) 10) 1))) - (enum-from-to 0 39)) - -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))
(cos a)
(cos-h a)
(cps-midi a)
(cps-oct a)
(crackle rate chaosParam)
(cubed a)
(cusp-n rate freq a b xi)
(db-amp a)
(dbrown length lo hi step)
(dbufrd bufnum phase loop)
(decay in decayTime)
(decay2 in attackTime decayTime)
(decode-b2 numChannels w x y orientation)
(degree-to-key bufnum in octave)
(delay-n in maxDelayTime delayTime)
(delay1 in)
(delay2 in)
(demand trig reset ugens)
(demand-env-gen rate levels times shapes curves gate reset
(detect-silence in amp time doneAction)
(dgeom length start grow)
(dif-sqr a b)
(disk-in num-channels rate bufnum)
(disk-out bufnum channels)
(distort a)
(done src)
(drand length array)
(dseq length array)
(dser length array)
(dseries length start step)
(dswitch index array)
(dswitch1 index array)
(dust rate density)
(dust2 rate density)
(duty rate duration reset doneAction level)
(dwhite length lo hi)
(dyn-klank in freqScale freqOffset decayScale spec)
(env-gen rate gate levelScale levelBias timeScale doneAction envelope)
(excess a b)
(exp a)
(exp-rand lo hi)
(fb-sine-c rate freq im fb a c xi yi)
(fdiv a b)
(fft buffer in hop wintype active)
(fold in lo hi)
(fold2 a b)
(formlet in freq attackTime decayTime)
(fos in a0 a1 b1)
(frac a)
(free trig nodeID)
(free-self src)
(free-self-when-done src)
(free-verb in mix room damp)
(freq-shift input shift phase)
(gate in trig)
(gbman-c rate freq xi yi)
(ge a b)
(grain-buf nc tr dur sndbuf rate pos interp pan envbuf)
(grain-fm nc tr dur carfreq modfreq index pan envbuf)
(grain-sin nc tr dur freq pan envbuf)
(Grainin nc tr dur in pan envbuf)
(gray-noise rate)
(gt a b)
(hasher in)
(henon-n rate freq a b x0 x1)
(hpf in freq)
(hpz1 in)
(hpz2 in)
(hypot x y)
(i-rand lo hi)
(Ifft buffer wintype)
(import (rsc3))
(import (rsc3)) - -(audition (out 0 (mul (blip ar 440 200) 0.15)))
(import (rsc3)) - -(audition (out 0 (mul (impulse ar 800 0) 0.1))) - -(let ((f (x-line kr 800 10 5 remove-synth))) - (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) - -(let ((f (mouse-y* kr 4 8 0 0.1)) - (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))
(import (rsc3)) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) - -(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) - -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))
(import (sosc) (rsc3))
(import (sosc) (rsc3)) - -(let ((a (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) - (f (mul-add (lf-noise1 kr 2) 300 400)) - (i (mul (sin-osc ar f 0) 0.1))) - (mrg2 (buf-wr 0 p 1 i) - (out 0 0.0))))) - (b (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) - (out 0 (buf-rd 1 ar 0 p 1 2)))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 (* 44100 2) 1)) - (send-synth fd "a" a) - (send-synth fd "b" b) - (send fd (s-new0 "a" 1001 1 0)) - (send fd (s-new0 "b" 1002 1 0))))) - -(define (do-send m) - (with-sc3 (lambda (fd) (send fd m)))) - -(do-send (n-set1 1002 "r" 5)) - -(do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))
(in num-channels rate bus)
(in-feedback num-channels bus)
(in-range in lo hi)
(in-trig num-channels bus)
(is-negative a)
(is-positive a)
(is-strictly-positive a)
(k2a in)
(key-state rate keynum minval maxval lag)
(klang rate freqScale freqOffset spec)
(klank in freqScale freqOffset decayScale spec)
(lag in lagTime)
(lag-in num-channels bus lag)
(lag2 in lagTime)
(lag3 in lagTime)
(last-value in diff)
(latch in trig)
(latoocarfian-c rate freq a b c d xi yi)
(le a b)
(leak-dc in coef)
(lf-cub rate freq iphase)
(lf-noise0 rate freq)
(lf-pulse rate freq iphase width)
(lf-saw rate freq iphase)
(lf-tri rate freq iphase)
(lfclip-noise rate freq)
(lfd-noise0 rate freq)
(lfdclip-noise rate freq)
(limiter input level lookAheadTime)
(lin-cong-c rate freq a c m xi)
(lin-exp in srclo srchi dstlo dsthi)
(lin-lin in srclo srchi dstlo dsthi)
(lin-pan2 in pos level)
(lin-rand lo hi minmax)
(line rate start end dur doneAction)
(linen gate attackTime susLevel releaseTime doneAction)
(local-in num-channels rate)
(log10 a)
(log2 a)
(logistic rate chaosParam freq)
(lorenz-l rate freq s r b h xi yi zi)
(lpf in freq)
(lpz1 ar in)
(lpz2 ar in)
(lt a b)
(mantissa-mask in bits)
(max a b)
(median length in)
(midi-cps a)
(min a b)
(mix UGen)
(mix-fill n f) - -(let ((n 6) - (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))
(Mod a b)
(moog-ff in freq gain reset)
(most-change a b)
(mouse-button rate minval maxval lag)
(mouse-x rate minval maxval warp lag)
(mouse-y rate minval maxval warp lag)
(mrg2 left right)
(mul a b)
(mul-add a b c)
(n-rand lo hi n)
(neg a)
(normalizer in level dur)
(oct-cps a)
(offset-out bufferindex inputs)
(one-pole in coef)
(one-zero in coef)
(osc rate bufnum freq phase)
(osc-n rate bufnum freq phase)
(out bufferindex inputs)
(Packfft chain bufsize frombin tobin zeroothers magsphases)
(pan-b2 in azimuth gain)
(pan2 in pos level)
(pause gate nodeID)
(pause-self src)
(pause-self-when-done src)
(peak trig reset)
(peak-follower in decay)
(phasor trig rate start end resetpos)
(pink-noise rate)
(pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave
(pitch-shift in winSize pchRatio pchDispersion timeDispersion)
(play-buf numChannels bufnum rate trigger startPos loop)
(pluck in tr maxdelaytime delaytime decaytime coef)
(pm-osc rate carfreq modfreq index modphase)
(poll trig in trigid label)
(pow a b)
(pulse rate freq width)
(pulse-count trig reset)
(pulse-divider trig div start)
(pv-add bufferA bufferB)
(pv-bin-scramble buffer wipe width trig)
(pv-bin-shift buffer stretch shift)
(pv-bin-wipe bufferA bufferB wipe)
(pv-brick-wall buffer wipe)
(pv-conformal-map buffer real imag)
(pv-copy bufferA bufferB)
(pv-copyPhase bufferA bufferB)
(pv-diffuser buffer trig)
(pv-hainsworth-foote buffer proph propf threshold waittime)
(pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) - -#| - -fft feature detector for onset detection based on work described in -Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using -Feature Extraction. in Proceedings of the Computer Music Modeling and -Retrieval Symposium, Lecture Notes in Computer Science. springer -Verlag. - -First order derivatives of the features are taken. Threshold may -need to be set low to pick up on changes. - -buffer - fft buffer to read from. -propsc - Proportion of spectral centroid feature. -prophfe - Proportion of high frequency energy feature. -prophfc - Proportion of high frequency content feature. -propsf - Proportion of spectral flux feature. -threshold - Threshold level for allowing a detection -waittime - If triggered, minimum wait until a further frame can - cause another spot (useful to stop multiple detects on - heavy signals) - -Default values in sclang are: propsc=0.25, prophfe=0.25, -prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. - -|# - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)))) - -(let* ((source (sound-in 0)) - (detect (pv-jensen-andersen (fft* 0 source) - 0.25 0.25 0.25 0.25 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))
(pv-local-max buffer threshold)
(pv-mag-above buffer threshold)
(pv-mag-below buffer threshold)
(pv-mag-mul bufferA bufferB)
(pv-mag-noise buffer)
(pv-mag-shift buffer stretch shift)
(pv-mag-smear buffer bins)
(pv-mag-squared buffer)
(pv-max bufferA bufferB)
(pv-min bufferA bufferB)
(pv-mul bufferA bufferB)
(pv-phase-shift buffer shift)
(pv-phase-shift270 buffer)
(pv-phase-shift90 buffer)
(pv-rand-comb buffer wipe trig)
(pv-rand-wipe bufferA bufferB wipe trig)
(pv-rect-comb buffer numTeeth phase width) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (x (mouse-x kr 0 0.5 0 0.1)) - (y (mouse-y kr 0 0.5 0 0.1)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 x y))) - (audition (out 0 (ifft* c)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) - (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))
(pv-rect-comb2 bufferA bufferB numTeeth phase width)
(PV_Magclip buffer threshold)
(PV_Magfreeze buffer freeze)
(pvcollect chain numframes func frombin tobin zeroothers)
(quad-n rate freq a b c xi)
(rand lo hi)
(rand-id rate id)
(rand-seed rate trig seed)
(record-buf bufnum offset reclevel prelevel run loop trigger inputs)
(replace-out bufferindex inputs)
(resonz in freq bwr)
(Rhpf in freq rq)
(ring1 a b)
(ring2 a b)
(ring3 a b)
(ring4 a b)
(ringz in freq decayTime)
(Rlpf in freq rq)
(rossler rate chaosParam dt)
(rotate2 x y pos)
(round a b)
(round-up a b)
(running-max in trig)
(running-min in trig)
(running-sum in numsamp)
(saw rate freq)
(scale-neg a b)
(schmidt in lo hi)
(select which array)
(send-trig in id value)
(set-reset-ff trig reset)
(shaper bufnum in)
(sign a)
(sin-h a)
(sin-osc rate freq phase)
(slew in up dn)
(slope in)
(soft-clip a)
(sos in a0 a1 a2 b1 b2)
(sound-in channel)
(sqr-dif a b)
(sqr-sum a b)
(squared a)
(standard-l rate freq k xi yi)
(stepper trig reset min max step resetval)
(sub a b)
(sum-sqr a b)
(sweep trig rate)
(sync-saw rate syncFreq sawFreq)
(t-choose trig array)
(t-delay trigger delayTime)
(t-duty rate duration reset doneAction level gap)
(t-exp-rand lo hi trig)
(t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)
(t-rand lo hi trig)
(tan-h a)
(thresh a b)
(ti-rand lo hi trig)
(timer trig)
(toggle-ff trig)
(trig in dur)
(trig1 in dur)
(trunc a b)
(tw-choose trig array weights normalize)
(tw-index in normalize array)
(two-pole in freq radius)
(two-zero in freq radius)
(u:floor a)
(u:log a)
(u:sin a)
(u:sqrt a)
(u:tan a)
(v-osc rate bufpos freq phase)
(v-osc3 rate bufpos freq1 freq2 freq3)
(var-saw rate freq iphasewidth)
(warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)
(white-noise rate)
(wrap in lo hi)
(wrap-index bufnum in)
(wrap2 a b)
(x-line rate start end dur doneAction)
(x-out buffer-index xfade inputs)
(zero-crossing in)
/b_alloc Allocate buffer space.
/b_allocRead Allocate buffer space and read a sound file.
/b_close
/b_fill Fill ranges of sample value(s)
/b_free Free buffer data.
/b_gen Call a command to fill a buffer
/b_get Get sample value(s)
/b_getn Get ranges of sample value(s)
/b_query
/b_read Read sound file data into an existing buffer.
/b_set Set sample value(s)
/b_setn Set ranges of sample value(s)
/b_write Write sound file data.
/b_zero Zero sample data
/c_fill Fill ranges of bus value(s)
/c_get Get bus value(s)
/c_getn Get ranges of bus value(s)
/c_set Set bus value(s)
/c_setn Set ranges of bus value(s)
/clearSched Clear all scheduled bundles.
/d_free delete synth definition
/d_load Load synth definition
/d_recv Receive a synth definition file
/dumpOSC Display incoming OSC messages
/g_deepFree Free all synths in this group and all its sub-groups.
/g_freeAll Delete all nodes in a group.
/g_head Add node to head of group
/g_new Create a new group
/g_tail Add node to tail of group
/n_after Place a node after another
/n_before Place a node before another
/n_fill Fill ranges of a node’s control value(s)
/n_free Delete a node.
/n_map Map a node’s controls to read from a bus
/n_mapn Map a node’s controls to read from buses
/n_query Get info about a node
/n_run Turn node on or off
/n_set Set a node’s control value(s)
/n_setn Set ranges of a node’s control value(s)
/n_trace Trace a node
/notify Register to receive notifications from server
/nrt_end end real time mode, close file
/quit Quit program
/s_get Get control value(s)
/s_getn Get ranges of control value(s)
/s_new Create a new synth
/s_noid Auto-reassign synth’s ID to a reserved value
/status Query the status
/sync Notify when async commands have completed.
/tr A trigger message
/u_cmd send a command to a unit generator
num-audio-buses
num-buffers
num-control-buses
num-input-buses
num-output-buses
num-running-synths
radians-per-sample
rsc3: racket/scheme/supercollider
rsc3: server commands
rsc3: tutorials
rsc3: ugens
sample-dur
sample-rate
SC2: Note extra iphase argument. - -(import (rsc3)) - -(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) - -(let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))
See allpass-n
See buf-comb-c
See buf-delay-c
See Bufallpass-c
See comb-n
See cusp-n
See dbrown
See delay-n
See drand
See dwhite
See fb-sine-c
See freeVerb
see g-new
See GbmanL.
See gt
See henon-n
See latoocarfian-c.
See lf-cub.
See lf-noise0
See lfd-noise0
See lin-cong-c.
see n-set
See quad-n
see s-new
See standard-l.
subsample-offset

 
\ No newline at end of file +Index

Index

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

(abs a)
(abs-dif a b)
(add a b)
(allpass-n in maxDelayTime delayTime decayTime)
(am-clip a b)
(amp-comp freq root exp)
(amp-compA freq root minAmp rootAmp)
(amp-db a)
(amplitude rate in attackTime releaseTime)
(arc-cos a)
(arc-sin a)
(arc-tan a)
(Atan2 x y)
(ball in g damp friction)
(bpf in freq rq)
(bpz2 in)
(brf in freq rq)
(brown-noise rate)
(brz2 in)
(buf-allpass-c buf in delaytime decaytime)
(buf-channels rate bufnum)
(buf-comb-c buf in delaytime decaytime)
(buf-delay-c buf in delaytime)
(buf-dur rate bufnum)
(buf-frames rate bufnum)
(buf-rate-scale rate bufnum)
(buf-rd numChannels rate bufnum phase loop interpolation)
(buf-sample-rate rate bufnum)
(ceil a)
(clip in lo hi)
(clip-noise rate)
(clip2 a b)
(coin-gate prob in)
(comb-n in maxDelayTime delayTime decayTime)
(compander input control thresh slopeBelow slopeAbove clampTime relaxTime)
(convolution in kernel framesize)
(convolution2 in bufnum trigger framesize)
(cos a)
(cos-h a)
(cps-midi a)
(cps-oct a)
(crackle rate chaosParam)
(cubed a)
(cusp-n rate freq a b xi)
(db-amp a)
(dbrown length lo hi step)
(dbufrd bufnum phase loop)
(decay in decayTime)
(decay2 in attackTime decayTime)
(decode-b2 numChannels w x y orientation)
(degree-to-key bufnum in octave)
(delay-n in maxDelayTime delayTime)
(delay1 in)
(delay2 in)
(demand trig reset ugens)
(demand-env-gen rate levels times shapes curves gate reset
(detect-silence in amp time doneAction)
(dgeom length start grow)
(dif-sqr a b)
(disk-in num-channels rate bufnum)
(disk-out bufnum channels)
(distort a)
(done src)
(drand length array)
(dseq length array)
(dser length array)
(dseries length start step)
(dswitch index array)
(dswitch1 index array)
(dust rate density)
(dust2 rate density)
(duty rate duration reset doneAction level)
(dwhite length lo hi)
(dyn-klank in freqScale freqOffset decayScale spec)
(env-gen rate gate levelScale levelBias timeScale doneAction envelope)
(excess a b)
(exp a)
(exp-rand lo hi)
(fb-sine-c rate freq im fb a c xi yi)
(fdiv a b)
(fft buffer in hop wintype active)
(fold in lo hi)
(fold2 a b)
(formlet in freq attackTime decayTime)
(fos in a0 a1 b1)
(frac a)
(free trig nodeID)
(free-self src)
(free-self-when-done src)
(free-verb in mix room damp)
(freq-shift input shift phase)
(gate in trig)
(gbman-c rate freq xi yi)
(ge a b)
(grain-buf nc tr dur sndbuf rate pos interp pan envbuf)
(grain-fm nc tr dur carfreq modfreq index pan envbuf)
(grain-sin nc tr dur freq pan envbuf)
(Grainin nc tr dur in pan envbuf)
(gray-noise rate)
(gt a b)
(hasher in)
(henon-n rate freq a b x0 x1)
(hpf in freq)
(hpz1 in)
(hpz2 in)
(hypot x y)
(i-rand lo hi)
(Ifft buffer wintype)
(in num-channels rate bus)
(in-feedback num-channels bus)
(in-range in lo hi)
(in-trig num-channels bus)
(is-negative a)
(is-positive a)
(is-strictly-positive a)
(k2a in)
(key-state rate keynum minval maxval lag)
(klang rate freqScale freqOffset spec)
(klank in freqScale freqOffset decayScale spec)
(lag in lagTime)
(lag-in num-channels bus lag)
(lag2 in lagTime)
(lag3 in lagTime)
(last-value in diff)
(latch in trig)
(latoocarfian-c rate freq a b c d xi yi)
(le a b)
(leak-dc in coef)
(lf-cub rate freq iphase)
(lf-noise0 rate freq)
(lf-pulse rate freq iphase width)
(lf-saw rate freq iphase)
(lf-tri rate freq iphase)
(lfclip-noise rate freq)
(lfd-noise0 rate freq)
(lfdclip-noise rate freq)
(limiter input level lookAheadTime)
(lin-cong-c rate freq a c m xi)
(lin-exp in srclo srchi dstlo dsthi)
(lin-lin in srclo srchi dstlo dsthi)
(lin-pan2 in pos level)
(lin-rand lo hi minmax)
(line rate start end dur doneAction)
(linen gate attackTime susLevel releaseTime doneAction)
(local-in num-channels rate)
(log10 a)
(log2 a)
(logistic rate chaosParam freq)
(lorenz-l rate freq s r b h xi yi zi)
(lpf in freq)
(lpz1 ar in)
(lpz2 ar in)
(lt a b)
(mantissa-mask in bits)
(max a b)
(median length in)
(midi-cps a)
(min a b)
(mix UGen)
(mix-fill n f)
(Mod a b)
(moog-ff in freq gain reset)
(most-change a b)
(mouse-button rate minval maxval lag)
(mouse-x rate minval maxval warp lag)
(mouse-y rate minval maxval warp lag)
(mrg2 left right)
(mul a b)
(mul-add a b c)
(n-rand lo hi n)
(neg a)
(normalizer in level dur)
(oct-cps a)
(offset-out bufferindex inputs)
(one-pole in coef)
(one-zero in coef)
(osc rate bufnum freq phase)
(osc-n rate bufnum freq phase)
(out bufferindex inputs)
(Packfft chain bufsize frombin tobin zeroothers magsphases)
(pan-b2 in azimuth gain)
(pan2 in pos level)
(pause gate nodeID)
(pause-self src)
(pause-self-when-done src)
(peak trig reset)
(peak-follower in decay)
(phasor trig rate start end resetpos)
(pink-noise rate)
(pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave
(pitch-shift in winSize pchRatio pchDispersion timeDispersion)
(play-buf numChannels bufnum rate trigger startPos loop)
(pluck in tr maxdelaytime delaytime decaytime coef)
(pm-osc rate carfreq modfreq index modphase)
(poll trig in trigid label)
(pow a b)
(pulse rate freq width)
(pulse-count trig reset)
(pulse-divider trig div start)
(pv-add bufferA bufferB)
(pv-bin-scramble buffer wipe width trig)
(pv-bin-shift buffer stretch shift)
(pv-bin-wipe bufferA bufferB wipe)
(pv-brick-wall buffer wipe)
(pv-conformal-map buffer real imag)
(pv-copy bufferA bufferB)
(pv-copyPhase bufferA bufferB)
(pv-diffuser buffer trig)
(pv-hainsworth-foote buffer proph propf threshold waittime)
(pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)
(pv-local-max buffer threshold)
(pv-mag-above buffer threshold)
(pv-mag-below buffer threshold)
(pv-mag-mul bufferA bufferB)
(pv-mag-noise buffer)
(pv-mag-shift buffer stretch shift)
(pv-mag-smear buffer bins)
(pv-mag-squared buffer)
(pv-max bufferA bufferB)
(pv-min bufferA bufferB)
(pv-mul bufferA bufferB)
(pv-phase-shift buffer shift)
(pv-phase-shift270 buffer)
(pv-phase-shift90 buffer)
(pv-rand-comb buffer wipe trig)
(pv-rand-wipe bufferA bufferB wipe trig)
(pv-rect-comb buffer numTeeth phase width)
(pv-rect-comb2 bufferA bufferB numTeeth phase width)
(PV_Magclip buffer threshold)
(PV_Magfreeze buffer freeze)
(pvcollect chain numframes func frombin tobin zeroothers)
(quad-n rate freq a b c xi)
(rand lo hi)
(rand-id rate id)
(rand-seed rate trig seed)
(record-buf bufnum offset reclevel prelevel run loop trigger inputs)
(replace-out bufferindex inputs)
(resonz in freq bwr)
(Rhpf in freq rq)
(ring1 a b)
(ring2 a b)
(ring3 a b)
(ring4 a b)
(ringz in freq decayTime)
(Rlpf in freq rq)
(rossler rate chaosParam dt)
(rotate2 x y pos)
(round a b)
(round-up a b)
(running-max in trig)
(running-min in trig)
(running-sum in numsamp)
(saw rate freq)
(scale-neg a b)
(schmidt in lo hi)
(select which array)
(send-trig in id value)
(set-reset-ff trig reset)
(shaper bufnum in)
(sign a)
(sin-h a)
(sin-osc rate freq phase)
(slew in up dn)
(slope in)
(soft-clip a)
(sos in a0 a1 a2 b1 b2)
(sound-in channel)
(sqr-dif a b)
(sqr-sum a b)
(squared a)
(standard-l rate freq k xi yi)
(stepper trig reset min max step resetval)
(sub a b)
(sum-sqr a b)
(sweep trig rate)
(sync-saw rate syncFreq sawFreq)
(t-choose trig array)
(t-delay trigger delayTime)
(t-duty rate duration reset doneAction level gap)
(t-exp-rand lo hi trig)
(t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)
(t-rand lo hi trig)
(tan-h a)
(thresh a b)
(ti-rand lo hi trig)
(timer trig)
(toggle-ff trig)
(trig in dur)
(trig1 in dur)
(trunc a b)
(tw-choose trig array weights normalize)
(tw-index in normalize array)
(two-pole in freq radius)
(two-zero in freq radius)
(u:floor a)
(u:log a)
(u:sin a)
(u:sqrt a)
(u:tan a)
(v-osc rate bufpos freq phase)
(v-osc3 rate bufpos freq1 freq2 freq3)
(var-saw rate freq iphasewidth)
(warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)
(white-noise rate)
(wrap in lo hi)
(wrap-index bufnum in)
(wrap2 a b)
(x-line rate start end dur doneAction)
(x-out buffer-index xfade inputs)
(zero-crossing in)
/b_alloc Allocate buffer space.
/b_allocRead Allocate buffer space and read a sound file.
/b_close
/b_fill Fill ranges of sample value(s)
/b_free Free buffer data.
/b_gen Call a command to fill a buffer
/b_get Get sample value(s)
/b_getn Get ranges of sample value(s)
/b_query
/b_read Read sound file data into an existing buffer.
/b_set Set sample value(s)
/b_setn Set ranges of sample value(s)
/b_write Write sound file data.
/b_zero Zero sample data
/c_fill Fill ranges of bus value(s)
/c_get Get bus value(s)
/c_getn Get ranges of bus value(s)
/c_set Set bus value(s)
/c_setn Set ranges of bus value(s)
/clearSched Clear all scheduled bundles.
/d_free delete synth definition
/d_load Load synth definition
/d_recv Receive a synth definition file
/dumpOSC Display incoming OSC messages
/g_deepFree Free all synths in this group and all its sub-groups.
/g_freeAll Delete all nodes in a group.
/g_head Add node to head of group
/g_new Create a new group
/g_tail Add node to tail of group
/n_after Place a node after another
/n_before Place a node before another
/n_fill Fill ranges of a node’s control value(s)
/n_free Delete a node.
/n_map Map a node’s controls to read from a bus
/n_mapn Map a node’s controls to read from buses
/n_query Get info about a node
/n_run Turn node on or off
/n_set Set a node’s control value(s)
/n_setn Set ranges of a node’s control value(s)
/n_trace Trace a node
/notify Register to receive notifications from server
/nrt_end end real time mode, close file
/quit Quit program
/s_get Get control value(s)
/s_getn Get ranges of control value(s)
/s_new Create a new synth
/s_noid Auto-reassign synth’s ID to a reserved value
/status Query the status
/sync Notify when async commands have completed.
/tr A trigger message
/u_cmd send a command to a unit generator
blip
buf-wr
c-osc
eq
formant
gendy1
impulse
index
num-audio-buses
num-buffers
num-control-buses
num-input-buses
num-output-buses
num-running-synths
radians-per-sample
rsc3: racket/scheme/supercollider
rsc3: server commands
rsc3: tutorials
rsc3: ugens
sample-dur
sample-rate
SC2: Note extra iphase argument.
See allpass-n
See buf-comb-c
See buf-delay-c
See Bufallpass-c
See comb-n
See cusp-n
See dbrown
See delay-n
See drand
See dwhite
See fb-sine-c
See freeVerb
see g-new
See GbmanL.
See henon-n
See latoocarfian-c.
See lf-cub.
See lf-noise0
See lfd-noise0
See lin-cong-c.
see n-set
See quad-n
see s-new
See standard-l.
subsample-offset

 
\ No newline at end of file diff --git a/doc/rsc3-docs/index.html b/doc/rsc3-docs/index.html index 96745fa..53c0c34 100644 --- a/doc/rsc3-docs/index.html +++ b/doc/rsc3-docs/index.html @@ -1,192 +1,2 @@ -rsc3: racket/scheme/supercollider
On this page:
rsc3:   racket/  scheme/  supercollider
8.6

rsc3: racket/scheme/supercollider

    1 rsc3: server commands

      1.1 /g_deepFree Free all synths in this group and all its sub-groups.

      1.2 /c_setn Set ranges of bus value(s)

      1.3 /sync Notify when async commands have completed.

      1.4 /s_getn Get ranges of control value(s)

      1.5 /s_get Get control value(s)

      1.6 /n_mapn Map a node’s controls to read from buses

      1.7 /b_gen Call a command to fill a buffer

      1.8 /n_trace Trace a node

      1.9 /b_alloc Allocate buffer space.

      1.10 /n_query Get info about a node

      1.11 /d_load Load synth definition

      1.12 /n_fill Fill ranges of a node’s control value(s)

      1.13 /n_before Place a node before another

      1.14 /b_close

      1.15 see s-new

      1.16 /s_new Create a new synth

      1.17 /b_setn Set ranges of sample value(s)

      1.18 /c_set Set bus value(s)

      1.19 /n_free Delete a node.

      1.20 see n-set

      1.21 /n_run Turn node on or off

      1.22 /b_read Read sound file data into an existing buffer.

      1.23 /nrt_end end real time mode, close file

      1.24 /b_get Get sample value(s)

      1.25 /n_after Place a node after another

      1.26 /d_free delete synth definition

      1.27 /n_set Set a node’s control value(s)

      1.28 /b_write Write sound file data.

      1.29 /b_getn Get ranges of sample value(s)

      1.30 /b_fill Fill ranges of sample value(s)

      1.31 /s_noid Auto-reassign synth’s ID to a reserved value

      1.32 /d_recv Receive a synth definition file

      1.33 /u_cmd send a command to a unit generator

      1.34 /b_allocRead Allocate buffer space and read a sound file.

      1.35 /n_map Map a node’s controls to read from a bus

      1.36 /status Query the status

      1.37 /g_new Create a new group

      1.38 /c_get Get bus value(s)

      1.39 /b_set Set sample value(s)

      1.40 /b_zero Zero sample data

      1.41 /tr A trigger message

      1.42 /dumpOSC Display incoming OSC messages

      1.43 /n_setn Set ranges of a node’s control value(s)

      1.44 /b_free Free buffer data.

      1.45 /notify Register to receive notifications from server

      1.46 /b_query

      1.47 /g_tail Add node to tail of group

      1.48 /clearSched Clear all scheduled bundles.

      1.49 /g_freeAll Delete all nodes in a group.

      1.50 /g_head Add node to head of group

      1.51 /c_getn Get ranges of bus value(s)

      1.52 /quit Quit program

      1.53 see g-new

      1.54 /c_fill Fill ranges of bus value(s)

    2 rsc3: ugens

      2.1 (Rlpf in freq rq)

      2.2 (fold in lo hi)

      2.3 (formlet in freq attackTime decayTime)

      2.4 (lin-lin in srclo srchi dstlo dsthi)

      2.5 (fos in a0 a1 b1)

      2.6 (bpf in freq rq)

      2.7 (wrap in lo hi)

      2.8 (bpz2 in)

      2.9 (amp-comp freq root exp)

      2.10 (lag2 in lagTime)

      2.11 (one-zero in coef)

      2.12 (klank in freqScale freqOffset decayScale spec)

      2.13 (lpz2 ar in)

      2.14 (lin-exp in srclo srchi dstlo dsthi)

      2.15 (hpz2 in)

      2.16 (leak-dc in coef)

      2.17 (hpf in freq)

      2.18 (sos in a0 a1 a2 b1 b2)

      2.19 (normalizer in level dur)

      2.20 (two-zero in freq radius)

      2.21 (clip in lo hi)

      2.22 (limiter input level lookAheadTime)

      2.23 (median length in)

      2.24 (lag3 in lagTime)

      2.25 (amp-compA freq root minAmp rootAmp)

      2.26 (two-pole in freq radius)

      2.27 (lpf in freq)

      2.28 (hpz1 in)

      2.29 (freq-shift input shift phase)

      2.30 (lpz1 ar in)

      2.31 (moog-ff in freq gain reset)

      2.32 (resonz in freq bwr)

      2.33 (brz2 in)

      2.34 (Rhpf in freq rq)

      2.35 (brf in freq rq)

      2.36 (one-pole in coef)

      2.37 (lag in lagTime)

      2.38 (ringz in freq decayTime)

      2.39 (dyn-klank in freqScale freqOffset decayScale spec)

      2.40 (Grainin nc tr dur in pan envbuf)

      2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

      2.42 (grain-sin nc tr dur freq pan envbuf)

      2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

      2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

      2.45 (disk-in num-channels rate bufnum)

      2.46 (disk-out bufnum channels)

      2.47 num-input-buses

      2.48 num-control-buses

      2.49 num-buffers

      2.50 num-output-buses

      2.51 (buf-frames rate bufnum)

      2.52 (buf-rate-scale rate bufnum)

      2.53 sample-dur

      2.54 sample-rate

      2.55 radians-per-sample

      2.56 (buf-dur rate bufnum)

      2.57 (buf-channels rate bufnum)

      2.58 (buf-sample-rate rate bufnum)

      2.59 num-audio-buses

      2.60 num-running-synths

      2.61 subsample-offset

      2.62 (zero-crossing in)

      2.63 (slope in)

      2.64 (running-sum in numsamp)

      2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

      2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

      2.67 (amplitude rate in attackTime releaseTime)

      2.68 (pulse-divider trig div start)

      2.69 (gate in trig)

      2.70 (poll trig in trigid label)

      2.71 (most-change a b)

      2.72 (trig in dur)

      2.73 (pulse-count trig reset)

      2.74 (stepper trig reset min max step resetval)

      2.75 (last-value in diff)

      2.76 (peak-follower in decay)

      2.77 (running-max in trig)

      2.78 (trig1 in dur)

      2.79 (phasor trig rate start end resetpos)

      2.80 (schmidt in lo hi)

      2.81 (peak trig reset)

      2.82 (toggle-ff trig)

      2.83 (sweep trig rate)

      2.84 (send-trig in id value)

      2.85 (in-range in lo hi)

      2.86 (timer trig)

      2.87 (t-delay trigger delayTime)

      2.88 (running-min in trig)

      2.89 (set-reset-ff trig reset)

      2.90 (saw rate freq)

      2.91 (pm-osc rate carfreq modfreq index modphase)

      2.92 (lf-tri rate freq iphase)

      2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

      2.94 (tw-index in normalize array)

      2.95 (osc-n rate bufnum freq phase)

      2.96 (osc rate bufnum freq phase)

      2.97 (lf-saw rate freq iphase)

      2.98 (tw-choose trig array weights normalize)

      2.99 (import (rsc3))

      2.100 (pulse rate freq width)

      2.101 (shaper bufnum in)

      2.102 SC2: Note extra iphase argument. - -(import (rsc3)) - -(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) - -(let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

      2.103 (v-osc rate bufpos freq phase)

      2.104 (var-saw rate freq iphasewidth)

      2.105 (import (sosc) (rsc3)) - -(let ((a (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) - (f (mul-add (lf-noise1 kr 2) 300 400)) - (i (mul (sin-osc ar f 0) 0.1))) - (mrg2 (buf-wr 0 p 1 i) - (out 0 0.0))))) - (b (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) - (out 0 (buf-rd 1 ar 0 p 1 2)))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 (* 44100 2) 1)) - (send-synth fd "a" a) - (send-synth fd "b" b) - (send fd (s-new0 "a" 1001 1 0)) - (send fd (s-new0 "b" 1002 1 0))))) - -(define (do-send m) - (with-sc3 (lambda (fd) (send fd m)))) - -(do-send (n-set1 1002 "r" 5)) - -(do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))

      2.106 (import (rsc3)) - -(audition (out 0 (mul (impulse ar 800 0) 0.1))) - -(let ((f (x-line kr 800 10 5 remove-synth))) - (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) - -(let ((f (mouse-y* kr 4 8 0 0.1)) - (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))

      2.107 (import (rsc3)) - -(audition (out 0 (mul (blip ar 440 200) 0.15)))

      2.108 (select which array)

      2.109 (import (rsc3))

      2.110 (import (rsc3)) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) - -(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) - -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))

      2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

      2.112 (lf-cub rate freq iphase)

      2.113 (lf-pulse rate freq iphase width)

      2.114 (import (sosc) (rsc3))

      2.115 See lf-cub.

      2.116 (sync-saw rate syncFreq sawFreq)

      2.117 (t-choose trig array)

      2.118 (sin-osc rate freq phase)

      2.119 (klang rate freqScale freqOffset spec)

      2.120 (lag-in num-channels bus lag)

      2.121 (sound-in channel)

      2.122 (in num-channels rate bus)

      2.123 (in-trig num-channels bus)

      2.124 (replace-out bufferindex inputs)

      2.125 (local-in num-channels rate)

      2.126 (offset-out bufferindex inputs)

      2.127 (in-feedback num-channels bus)

      2.128 (x-out buffer-index xfade inputs)

      2.129 (out bufferindex inputs)

      2.130 (mix UGen)

      2.131 (mix-fill n f) - -(let ((n 6) - (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))

      2.132 (latch in trig)

      2.133 (decay in decayTime)

      2.134 (wrap-index bufnum in)

      2.135 (mouse-y rate minval maxval warp lag)

      2.136 (degree-to-key bufnum in octave)

      2.137 (key-state rate keynum minval maxval lag)

      2.138 (mrg2 left right)

      2.139 (mouse-button rate minval maxval lag)

      2.140 (slew in up dn)

      2.141 (mouse-x rate minval maxval warp lag)

      2.142 (decay2 in attackTime decayTime)

      2.143 (k2a in)

      2.144 (mul-add a b c)

      2.145 (clip2 a b)

      2.146 (Atan2 x y)

      2.147 (trunc a b)

      2.148 (sub a b)

      2.149 (round-up a b)

      2.150 (ring4 a b)

      2.151 (pow a b)

      2.152 (ring1 a b)

      2.153 (gt a b)

      2.154 (add a b)

      2.155 (abs-dif a b)

      2.156 (am-clip a b)

      2.157 (ge a b)

      2.158 (max a b)

      2.159 (ring3 a b)

      2.160 (thresh a b)

      2.161 (dif-sqr a b)

      2.162 (excess a b)

      2.163 (fold2 a b)

      2.164 (sqr-dif a b)

      2.165 (hypot x y)

      2.166 (sqr-sum a b)

      2.167 (sum-sqr a b)

      2.168 (le a b)

      2.169 See gt

      2.170 (scale-neg a b)

      2.171 (ring2 a b)

      2.172 (Mod a b)

      2.173 (fdiv a b)

      2.174 (mul a b)

      2.175 (min a b)

      2.176 (lt a b)

      2.177 (wrap2 a b)

      2.178 (round a b)

      2.179 (hasher in)

      2.180 (rand-seed rate trig seed)

      2.181 (lfd-noise0 rate freq)

      2.182 (lfclip-noise rate freq)

      2.183 See lf-noise0

      2.184 (clip-noise rate)

      2.185 (ti-rand lo hi trig)

      2.186 (lf-noise0 rate freq)

      2.187 (pink-noise rate)

      2.188 (rand lo hi)

      2.189 (gray-noise rate)

      2.190 See lfd-noise0

      2.191 (i-rand lo hi)

      2.192 (n-rand lo hi n)

      2.193 (lfdclip-noise rate freq)

      2.194 (coin-gate prob in)

      2.195 (t-exp-rand lo hi trig)

      2.196 (t-rand lo hi trig)

      2.197 (white-noise rate)

      2.198 (dust2 rate density)

      2.199 See lfd-noise0

      2.200 (rand-id rate id)

      2.201 See lf-noise0

      2.202 (mantissa-mask in bits)

      2.203 (dust rate density)

      2.204 (lin-rand lo hi minmax)

      2.205 (exp-rand lo hi)

      2.206 (brown-noise rate)

      2.207 (u:log a)

      2.208 (frac a)

      2.209 (arc-tan a)

      2.210 (distort a)

      2.211 (tan-h a)

      2.212 (u:floor a)

      2.213 (cps-oct a)

      2.214 (db-amp a)

      2.215 (u:sqrt a)

      2.216 (soft-clip a)

      2.217 (cps-midi a)

      2.218 (is-strictly-positive a)

      2.219 (u:tan a)

      2.220 (cos-h a)

      2.221 (amp-db a)

      2.222 (abs a)

      2.223 (log10 a)

      2.224 (midi-cps a)

      2.225 (is-positive a)

      2.226 (sign a)

      2.227 (neg a)

      2.228 (log2 a)

      2.229 (ceil a)

      2.230 (arc-cos a)

      2.231 (exp a)

      2.232 (squared a)

      2.233 (arc-sin a)

      2.234 (cubed a)

      2.235 (is-negative a)

      2.236 (oct-cps a)

      2.237 (u:sin a)

      2.238 (sin-h a)

      2.239 (cos a)

      2.240 (pv-mul bufferA bufferB)

      2.241 (pv-mag-squared buffer)

      2.242 (pv-min bufferA bufferB)

      2.243 (pv-mag-noise buffer)

      2.244 (pv-mag-below buffer threshold)

      2.245 (convolution in kernel framesize)

      2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) - -#| - -fft feature detector for onset detection based on work described in -Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using -Feature Extraction. in Proceedings of the Computer Music Modeling and -Retrieval Symposium, Lecture Notes in Computer Science. springer -Verlag. - -First order derivatives of the features are taken. Threshold may -need to be set low to pick up on changes. - -buffer - fft buffer to read from. -propsc - Proportion of spectral centroid feature. -prophfe - Proportion of high frequency energy feature. -prophfc - Proportion of high frequency content feature. -propsf - Proportion of spectral flux feature. -threshold - Threshold level for allowing a detection -waittime - If triggered, minimum wait until a further frame can - cause another spot (useful to stop multiple detects on - heavy signals) - -Default values in sclang are: propsc=0.25, prophfe=0.25, -prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. - -|# - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)))) - -(let* ((source (sound-in 0)) - (detect (pv-jensen-andersen (fft* 0 source) - 0.25 0.25 0.25 0.25 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))

      2.247 (pv-phase-shift270 buffer)

      2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

      2.249 (pv-phase-shift buffer shift)

      2.250 (pv-copy bufferA bufferB)

      2.251 (pv-brick-wall buffer wipe)

      2.252 (pv-mag-smear buffer bins)

      2.253 (pv-mag-above buffer threshold)

      2.254 (pv-bin-shift buffer stretch shift)

      2.255 (fft buffer in hop wintype active)

      2.256 (pv-bin-wipe bufferA bufferB wipe)

      2.257 (pv-copyPhase bufferA bufferB)

      2.258 (pv-phase-shift90 buffer)

      2.259 (convolution2 in bufnum trigger framesize) - -#| - -Strict convolution with fixed kernel which can be updated using a -trigger signal. - -in - processing target -bufnum - buffer index for the fixed kernel, may be modulated in - combination with the trigger -trigger - update the kernel on a change from <=0 to >0 -framesize - size of fft frame, must be a power of two. convolution - uses twice this number internally, maximum value you - can give this argument is 2^16=65536. Note that it gets - progressively more expensive to run for higher powers! - 512, 1024, 2048, 4096 standard. - -|# - -(with-sc3 - (lambda (fd) - (for-each - (lambda (b) - (async fd (b-alloc b 2048 1))) - (list 10 11 12)) - (for-each - (lambda (n) - (send fd (b-set1 10 (+ (* 400 n) 100) 1))) - (enum-from-to 0 2)) - (for-each - (lambda (n) - (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1)))) - (enum-from-to 0 49)) - (for-each - (lambda (n) - (send fd (b-set1 12 (+ (* 40 n) 20) 1))) - (enum-from-to 0 19)) - (send-synth - fd "c" - (letc ((k 0) (t 0)) - (let ((i (impulse ar 1 0))) - (out 0 (mul (convolution2 i k t 2048) 0.5))))))) - -(define send-to - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m))))) - -(define async-to - (lambda (m) - (with-sc3 - (lambda (fd) - (async fd m))))) - -(send-to (s-new1 "c" 1001 1 1 "k" 10)) - -(send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(send-to (n-set1 1001 "k" 12)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(async-to (b-zero 12)) - -(for-each - (lambda (n) - (send-to (b-set1 12 (+ (* 20 n) 10) 1))) - (enum-from-to 0 39)) - -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))

      2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

      2.261 (pv-add bufferA bufferB)

      2.262 (pv-rand-comb buffer wipe trig)

      2.263 (pv-local-max buffer threshold)

      2.264 (pv-mag-mul bufferA bufferB)

      2.265 (pv-conformal-map buffer real imag)

      2.266 (pv-diffuser buffer trig)

      2.267 (pv-max bufferA bufferB)

      2.268 (Ifft buffer wintype)

      2.269 (pv-bin-scramble buffer wipe width trig)

      2.270 (pv-rand-wipe bufferA bufferB wipe trig)

      2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

      2.272 (pvcollect chain numframes func frombin tobin zeroothers)

      2.273 (PV_Magclip buffer threshold)

      2.274 (PV_Magfreeze buffer freeze)

      2.275 (pv-rect-comb buffer numTeeth phase width) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (x (mouse-x kr 0 0.5 0 0.1)) - (y (mouse-y kr 0 0.5 0 0.1)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 x y))) - (audition (out 0 (ifft* c)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) - (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))

      2.276 (pv-mag-shift buffer stretch shift)

      2.277 See allpass-n

      2.278 See comb-n

      2.279 See Bufallpass-c

      2.280 (free-verb in mix room damp)

      2.281 See freeVerb

      2.282 (play-buf numChannels bufnum rate trigger startPos loop)

      2.283 See buf-delay-c

      2.284 (delay2 in)

      2.285 (comb-n in maxDelayTime delayTime decayTime)

      2.286 See Bufallpass-c

      2.287 (allpass-n in maxDelayTime delayTime decayTime)

      2.288 See comb-n

      2.289 (buf-allpass-c buf in delaytime decaytime)

      2.290 See allpass-n

      2.291 See buf-delay-c

      2.292 (buf-delay-c buf in delaytime)

      2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

      2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

      2.295 See buf-comb-c

      2.296 (buf-comb-c buf in delaytime decaytime)

      2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

      2.298 (delay1 in)

      2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

      2.300 See delay-n

      2.301 See buf-comb-c

      2.302 See delay-n

      2.303 (delay-n in maxDelayTime delayTime)

      2.304 (ball in g damp friction)

      2.305 (dswitch1 index array)

      2.306 (t-duty rate duration reset doneAction level gap)

      2.307 See dwhite

      2.308 (dwhite length lo hi)

      2.309 (dbufrd bufnum phase loop)

      2.310 (demand-env-gen rate levels times shapes curves gate reset

      2.311 (demand trig reset ugens)

      2.312 (duty rate duration reset doneAction level)

      2.313 (dser length array)

      2.314 (dgeom length start grow)

      2.315 (drand length array)

      2.316 See drand

      2.317 (dseries length start step)

      2.318 (dswitch index array)

      2.319 See dbrown

      2.320 (dbrown length lo hi step)

      2.321 (dseq length array)

      2.322 See latoocarfian-c.

      2.323 (fb-sine-c rate freq im fb a c xi yi)

      2.324 See fb-sine-c

      2.325 (quad-n rate freq a b c xi)

      2.326 (lorenz-l rate freq s r b h xi yi zi)

      2.327 See standard-l.

      2.328 See quad-n

      2.329 See cusp-n

      2.330 See latoocarfian-c.

      2.331 (logistic rate chaosParam freq)

      2.332 See fb-sine-c

      2.333 (latoocarfian-c rate freq a b c d xi yi)

      2.334 (rossler rate chaosParam dt)

      2.335 (standard-l rate freq k xi yi)

      2.336 See quad-n

      2.337 (cusp-n rate freq a b xi)

      2.338 (lin-cong-c rate freq a c m xi)

      2.339 (crackle rate chaosParam)

      2.340 (henon-n rate freq a b x0 x1)

      2.341 See henon-n

      2.342 See lin-cong-c.

      2.343 See GbmanL.

      2.344 See GbmanL.

      2.345 See henon-n

      2.346 See lin-cong-c.

      2.347 (gbman-c rate freq xi yi)

      2.348 (lin-pan2 in pos level)

      2.349 (rotate2 x y pos)

      2.350 (decode-b2 numChannels w x y orientation)

      2.351 (pan2 in pos level)

      2.352 (pan-b2 in azimuth gain)

      2.353 (detect-silence in amp time doneAction)

      2.354 (line rate start end dur doneAction)

      2.355 (free trig nodeID)

      2.356 (pause-self-when-done src)

      2.357 (pause-self src)

      2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

      2.359 (free-self-when-done src)

      2.360 (pause gate nodeID)

      2.361 (x-line rate start end dur doneAction)

      2.362 (done src)

      2.363 (linen gate attackTime susLevel releaseTime doneAction)

      2.364 (free-self src)

    3 rsc3: tutorials

    Index

Notice to Mice

 
\ No newline at end of file +rsc3: racket/scheme/supercollider
On this page:
rsc3:   racket/  scheme/  supercollider
8.6

rsc3: racket/scheme/supercollider

    1 rsc3: server commands

      1.1 /g_deepFree Free all synths in this group and all its sub-groups.

      1.2 /c_setn Set ranges of bus value(s)

      1.3 /sync Notify when async commands have completed.

      1.4 /s_getn Get ranges of control value(s)

      1.5 /s_get Get control value(s)

      1.6 /n_mapn Map a node’s controls to read from buses

      1.7 /b_gen Call a command to fill a buffer

      1.8 /n_trace Trace a node

      1.9 /b_alloc Allocate buffer space.

      1.10 /n_query Get info about a node

      1.11 /d_load Load synth definition

      1.12 /n_fill Fill ranges of a node’s control value(s)

      1.13 /n_before Place a node before another

      1.14 /b_close

      1.15 see s-new

      1.16 /s_new Create a new synth

      1.17 /b_setn Set ranges of sample value(s)

      1.18 /c_set Set bus value(s)

      1.19 /n_free Delete a node.

      1.20 see n-set

      1.21 /n_run Turn node on or off

      1.22 /b_read Read sound file data into an existing buffer.

      1.23 /nrt_end end real time mode, close file

      1.24 /b_get Get sample value(s)

      1.25 /n_after Place a node after another

      1.26 /d_free delete synth definition

      1.27 /n_set Set a node’s control value(s)

      1.28 /b_write Write sound file data.

      1.29 /b_getn Get ranges of sample value(s)

      1.30 /b_fill Fill ranges of sample value(s)

      1.31 /s_noid Auto-reassign synth’s ID to a reserved value

      1.32 /d_recv Receive a synth definition file

      1.33 /u_cmd send a command to a unit generator

      1.34 /b_allocRead Allocate buffer space and read a sound file.

      1.35 /n_map Map a node’s controls to read from a bus

      1.36 /status Query the status

      1.37 /g_new Create a new group

      1.38 /c_get Get bus value(s)

      1.39 /b_set Set sample value(s)

      1.40 /b_zero Zero sample data

      1.41 /tr A trigger message

      1.42 /dumpOSC Display incoming OSC messages

      1.43 /n_setn Set ranges of a node’s control value(s)

      1.44 /b_free Free buffer data.

      1.45 /notify Register to receive notifications from server

      1.46 /b_query

      1.47 /g_tail Add node to tail of group

      1.48 /clearSched Clear all scheduled bundles.

      1.49 /g_freeAll Delete all nodes in a group.

      1.50 /g_head Add node to head of group

      1.51 /c_getn Get ranges of bus value(s)

      1.52 /quit Quit program

      1.53 see g-new

      1.54 /c_fill Fill ranges of bus value(s)

    2 rsc3: ugens

      2.1 (Rlpf in freq rq)

      2.2 (fold in lo hi)

      2.3 (formlet in freq attackTime decayTime)

      2.4 (lin-lin in srclo srchi dstlo dsthi)

      2.5 (fos in a0 a1 b1)

      2.6 (bpf in freq rq)

      2.7 (wrap in lo hi)

      2.8 (bpz2 in)

      2.9 (amp-comp freq root exp)

      2.10 (lag2 in lagTime)

      2.11 (one-zero in coef)

      2.12 (klank in freqScale freqOffset decayScale spec)

      2.13 (lpz2 ar in)

      2.14 (lin-exp in srclo srchi dstlo dsthi)

      2.15 (hpz2 in)

      2.16 (leak-dc in coef)

      2.17 (hpf in freq)

      2.18 (sos in a0 a1 a2 b1 b2)

      2.19 (normalizer in level dur)

      2.20 (two-zero in freq radius)

      2.21 (clip in lo hi)

      2.22 (limiter input level lookAheadTime)

      2.23 (median length in)

      2.24 (lag3 in lagTime)

      2.25 (amp-compA freq root minAmp rootAmp)

      2.26 (two-pole in freq radius)

      2.27 (lpf in freq)

      2.28 (hpz1 in)

      2.29 (freq-shift input shift phase)

      2.30 (lpz1 ar in)

      2.31 (moog-ff in freq gain reset)

      2.32 (resonz in freq bwr)

      2.33 (brz2 in)

      2.34 (Rhpf in freq rq)

      2.35 (brf in freq rq)

      2.36 (one-pole in coef)

      2.37 (lag in lagTime)

      2.38 (ringz in freq decayTime)

      2.39 (dyn-klank in freqScale freqOffset decayScale spec)

      2.40 (Grainin nc tr dur in pan envbuf)

      2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

      2.42 (grain-sin nc tr dur freq pan envbuf)

      2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

      2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

      2.45 (disk-in num-channels rate bufnum)

      2.46 (disk-out bufnum channels)

      2.47 num-input-buses

      2.48 num-control-buses

      2.49 num-buffers

      2.50 num-output-buses

      2.51 (buf-frames rate bufnum)

      2.52 (buf-rate-scale rate bufnum)

      2.53 sample-dur

      2.54 sample-rate

      2.55 radians-per-sample

      2.56 (buf-dur rate bufnum)

      2.57 (buf-channels rate bufnum)

      2.58 (buf-sample-rate rate bufnum)

      2.59 num-audio-buses

      2.60 num-running-synths

      2.61 subsample-offset

      2.62 (zero-crossing in)

      2.63 (slope in)

      2.64 (running-sum in numsamp)

      2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

      2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

      2.67 (amplitude rate in attackTime releaseTime)

      2.68 (pulse-divider trig div start)

      2.69 (gate in trig)

      2.70 (poll trig in trigid label)

      2.71 (most-change a b)

      2.72 (trig in dur)

      2.73 (pulse-count trig reset)

      2.74 (stepper trig reset min max step resetval)

      2.75 (last-value in diff)

      2.76 (peak-follower in decay)

      2.77 (running-max in trig)

      2.78 (trig1 in dur)

      2.79 (phasor trig rate start end resetpos)

      2.80 (schmidt in lo hi)

      2.81 (peak trig reset)

      2.82 (toggle-ff trig)

      2.83 (sweep trig rate)

      2.84 (send-trig in id value)

      2.85 (in-range in lo hi)

      2.86 (timer trig)

      2.87 (t-delay trigger delayTime)

      2.88 (running-min in trig)

      2.89 (set-reset-ff trig reset)

      2.90 (saw rate freq)

      2.91 (pm-osc rate carfreq modfreq index modphase)

      2.92 (lf-tri rate freq iphase)

      2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

      2.94 (tw-index in normalize array)

      2.95 (osc-n rate bufnum freq phase)

      2.96 (osc rate bufnum freq phase)

      2.97 (lf-saw rate freq iphase)

      2.98 (tw-choose trig array weights normalize)

      2.99 gendy1

      2.100 (pulse rate freq width)

      2.101 (shaper bufnum in)

      2.102 SC2: Note extra iphase argument.

      2.103 (v-osc rate bufpos freq phase)

      2.104 (var-saw rate freq iphasewidth)

      2.105 buf-wr

      2.106 impulse

      2.107 blip

      2.108 (select which array)

      2.109 formant

      2.110 c-osc

      2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

      2.112 (lf-cub rate freq iphase)

      2.113 (lf-pulse rate freq iphase width)

      2.114 index

      2.115 See lf-cub.

      2.116 (sync-saw rate syncFreq sawFreq)

      2.117 (t-choose trig array)

      2.118 (sin-osc rate freq phase)

      2.119 (klang rate freqScale freqOffset spec)

      2.120 (lag-in num-channels bus lag)

      2.121 (sound-in channel)

      2.122 (in num-channels rate bus)

      2.123 (in-trig num-channels bus)

      2.124 (replace-out bufferindex inputs)

      2.125 (local-in num-channels rate)

      2.126 (offset-out bufferindex inputs)

      2.127 (in-feedback num-channels bus)

      2.128 (x-out buffer-index xfade inputs)

      2.129 (out bufferindex inputs)

      2.130 (mix UGen)

      2.131 (mix-fill n f)

      2.132 (latch in trig)

      2.133 (decay in decayTime)

      2.134 (wrap-index bufnum in)

      2.135 (mouse-y rate minval maxval warp lag)

      2.136 (degree-to-key bufnum in octave)

      2.137 (key-state rate keynum minval maxval lag)

      2.138 (mrg2 left right)

      2.139 (mouse-button rate minval maxval lag)

      2.140 (slew in up dn)

      2.141 (mouse-x rate minval maxval warp lag)

      2.142 (decay2 in attackTime decayTime)

      2.143 (k2a in)

      2.144 (mul-add a b c)

      2.145 (clip2 a b)

      2.146 (Atan2 x y)

      2.147 (trunc a b)

      2.148 (sub a b)

      2.149 (round-up a b)

      2.150 (ring4 a b)

      2.151 (pow a b)

      2.152 (ring1 a b)

      2.153 (gt a b)

      2.154 (add a b)

      2.155 (abs-dif a b)

      2.156 (am-clip a b)

      2.157 (ge a b)

      2.158 (max a b)

      2.159 (ring3 a b)

      2.160 (thresh a b)

      2.161 (dif-sqr a b)

      2.162 (excess a b)

      2.163 (fold2 a b)

      2.164 (sqr-dif a b)

      2.165 (hypot x y)

      2.166 (sqr-sum a b)

      2.167 (sum-sqr a b)

      2.168 (le a b)

      2.169 eq

      2.170 (scale-neg a b)

      2.171 (ring2 a b)

      2.172 (Mod a b)

      2.173 (fdiv a b)

      2.174 (mul a b)

      2.175 (min a b)

      2.176 (lt a b)

      2.177 (wrap2 a b)

      2.178 (round a b)

      2.179 (hasher in)

      2.180 (rand-seed rate trig seed)

      2.181 (lfd-noise0 rate freq)

      2.182 (lfclip-noise rate freq)

      2.183 See lf-noise0

      2.184 (clip-noise rate)

      2.185 (ti-rand lo hi trig)

      2.186 (lf-noise0 rate freq)

      2.187 (pink-noise rate)

      2.188 (rand lo hi)

      2.189 (gray-noise rate)

      2.190 See lfd-noise0

      2.191 (i-rand lo hi)

      2.192 (n-rand lo hi n)

      2.193 (lfdclip-noise rate freq)

      2.194 (coin-gate prob in)

      2.195 (t-exp-rand lo hi trig)

      2.196 (t-rand lo hi trig)

      2.197 (white-noise rate)

      2.198 (dust2 rate density)

      2.199 See lfd-noise0

      2.200 (rand-id rate id)

      2.201 See lf-noise0

      2.202 (mantissa-mask in bits)

      2.203 (dust rate density)

      2.204 (lin-rand lo hi minmax)

      2.205 (exp-rand lo hi)

      2.206 (brown-noise rate)

      2.207 (u:log a)

      2.208 (frac a)

      2.209 (arc-tan a)

      2.210 (distort a)

      2.211 (tan-h a)

      2.212 (u:floor a)

      2.213 (cps-oct a)

      2.214 (db-amp a)

      2.215 (u:sqrt a)

      2.216 (soft-clip a)

      2.217 (cps-midi a)

      2.218 (is-strictly-positive a)

      2.219 (u:tan a)

      2.220 (cos-h a)

      2.221 (amp-db a)

      2.222 (abs a)

      2.223 (log10 a)

      2.224 (midi-cps a)

      2.225 (is-positive a)

      2.226 (sign a)

      2.227 (neg a)

      2.228 (log2 a)

      2.229 (ceil a)

      2.230 (arc-cos a)

      2.231 (exp a)

      2.232 (squared a)

      2.233 (arc-sin a)

      2.234 (cubed a)

      2.235 (is-negative a)

      2.236 (oct-cps a)

      2.237 (u:sin a)

      2.238 (sin-h a)

      2.239 (cos a)

      2.240 (pv-mul bufferA bufferB)

      2.241 (pv-mag-squared buffer)

      2.242 (pv-min bufferA bufferB)

      2.243 (pv-mag-noise buffer)

      2.244 (pv-mag-below buffer threshold)

      2.245 (convolution in kernel framesize)

      2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)

      2.247 (pv-phase-shift270 buffer)

      2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

      2.249 (pv-phase-shift buffer shift)

      2.250 (pv-copy bufferA bufferB)

      2.251 (pv-brick-wall buffer wipe)

      2.252 (pv-mag-smear buffer bins)

      2.253 (pv-mag-above buffer threshold)

      2.254 (pv-bin-shift buffer stretch shift)

      2.255 (fft buffer in hop wintype active)

      2.256 (pv-bin-wipe bufferA bufferB wipe)

      2.257 (pv-copyPhase bufferA bufferB)

      2.258 (pv-phase-shift90 buffer)

      2.259 (convolution2 in bufnum trigger framesize)

      2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

      2.261 (pv-add bufferA bufferB)

      2.262 (pv-rand-comb buffer wipe trig)

      2.263 (pv-local-max buffer threshold)

      2.264 (pv-mag-mul bufferA bufferB)

      2.265 (pv-conformal-map buffer real imag)

      2.266 (pv-diffuser buffer trig)

      2.267 (pv-max bufferA bufferB)

      2.268 (Ifft buffer wintype)

      2.269 (pv-bin-scramble buffer wipe width trig)

      2.270 (pv-rand-wipe bufferA bufferB wipe trig)

      2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

      2.272 (pvcollect chain numframes func frombin tobin zeroothers)

      2.273 (PV_Magclip buffer threshold)

      2.274 (PV_Magfreeze buffer freeze)

      2.275 (pv-rect-comb buffer numTeeth phase width)

      2.276 (pv-mag-shift buffer stretch shift)

      2.277 See allpass-n

      2.278 See comb-n

      2.279 See Bufallpass-c

      2.280 (free-verb in mix room damp)

      2.281 See freeVerb

      2.282 (play-buf numChannels bufnum rate trigger startPos loop)

      2.283 See buf-delay-c

      2.284 (delay2 in)

      2.285 (comb-n in maxDelayTime delayTime decayTime)

      2.286 See Bufallpass-c

      2.287 (allpass-n in maxDelayTime delayTime decayTime)

      2.288 See comb-n

      2.289 (buf-allpass-c buf in delaytime decaytime)

      2.290 See allpass-n

      2.291 See buf-delay-c

      2.292 (buf-delay-c buf in delaytime)

      2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

      2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

      2.295 See buf-comb-c

      2.296 (buf-comb-c buf in delaytime decaytime)

      2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

      2.298 (delay1 in)

      2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

      2.300 See delay-n

      2.301 See buf-comb-c

      2.302 See delay-n

      2.303 (delay-n in maxDelayTime delayTime)

      2.304 (ball in g damp friction)

      2.305 (dswitch1 index array)

      2.306 (t-duty rate duration reset doneAction level gap)

      2.307 See dwhite

      2.308 (dwhite length lo hi)

      2.309 (dbufrd bufnum phase loop)

      2.310 (demand-env-gen rate levels times shapes curves gate reset

      2.311 (demand trig reset ugens)

      2.312 (duty rate duration reset doneAction level)

      2.313 (dser length array)

      2.314 (dgeom length start grow)

      2.315 (drand length array)

      2.316 See drand

      2.317 (dseries length start step)

      2.318 (dswitch index array)

      2.319 See dbrown

      2.320 (dbrown length lo hi step)

      2.321 (dseq length array)

      2.322 See latoocarfian-c.

      2.323 (fb-sine-c rate freq im fb a c xi yi)

      2.324 See fb-sine-c

      2.325 (quad-n rate freq a b c xi)

      2.326 (lorenz-l rate freq s r b h xi yi zi)

      2.327 See standard-l.

      2.328 See quad-n

      2.329 See cusp-n

      2.330 See latoocarfian-c.

      2.331 (logistic rate chaosParam freq)

      2.332 See fb-sine-c

      2.333 (latoocarfian-c rate freq a b c d xi yi)

      2.334 (rossler rate chaosParam dt)

      2.335 (standard-l rate freq k xi yi)

      2.336 See quad-n

      2.337 (cusp-n rate freq a b xi)

      2.338 (lin-cong-c rate freq a c m xi)

      2.339 (crackle rate chaosParam)

      2.340 (henon-n rate freq a b x0 x1)

      2.341 See henon-n

      2.342 See lin-cong-c.

      2.343 See GbmanL.

      2.344 See GbmanL.

      2.345 See henon-n

      2.346 See lin-cong-c.

      2.347 (gbman-c rate freq xi yi)

      2.348 (lin-pan2 in pos level)

      2.349 (rotate2 x y pos)

      2.350 (decode-b2 numChannels w x y orientation)

      2.351 (pan2 in pos level)

      2.352 (pan-b2 in azimuth gain)

      2.353 (detect-silence in amp time doneAction)

      2.354 (line rate start end dur doneAction)

      2.355 (free trig nodeID)

      2.356 (pause-self-when-done src)

      2.357 (pause-self src)

      2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

      2.359 (free-self-when-done src)

      2.360 (pause gate nodeID)

      2.361 (x-line rate start end dur doneAction)

      2.362 (done src)

      2.363 (linen gate attackTime susLevel releaseTime doneAction)

      2.364 (free-self src)

    3 rsc3: tutorials

    Index

Partially regenerated documentation (rsc.help.scm -> rsc.scrbl)

 
\ No newline at end of file diff --git a/doc/rsc3-docs/rsc3__server_commands.html b/doc/rsc3-docs/rsc3__server_commands.html index 223e8e1..d91c817 100644 --- a/doc/rsc3-docs/rsc3__server_commands.html +++ b/doc/rsc3-docs/rsc3__server_commands.html @@ -1,5 +1,5 @@ -1 rsc3: server commands
rsc3:   server commands
On this page:
1.1 /  g_  deep  Free Free all synths in this group and all its sub-groups.
1.2 /  c_  setn Set ranges of bus value(s)
1.3 /  sync Notify when async commands have completed.
1.4 /  s_  getn Get ranges of control value(s)
1.5 /  s_  get Get control value(s)
1.6 /  n_  mapn Map a node’s controls to read from buses
1.7 /  b_  gen Call a command to fill a buffer
1.8 /  n_  trace Trace a node
1.9 /  b_  alloc Allocate buffer space.
1.10 /  n_  query Get info about a node
1.11 /  d_  load Load synth definition
1.12 /  n_  fill Fill ranges of a node’s control value(s)
1.13 /  n_  before Place a node before another
1.14 /  b_  close
1.15 see s-new
1.16 /  s_  new Create a new synth
1.17 /  b_  setn Set ranges of sample value(s)
1.18 /  c_  set Set bus value(s)
1.19 /  n_  free Delete a node.
1.20 see n-set
1.21 /  n_  run Turn node on or off
1.22 /  b_  read Read sound file data into an existing buffer.
1.23 /  nrt_  end end real time mode, close file
1.24 /  b_  get Get sample value(s)
1.25 /  n_  after Place a node after another
1.26 /  d_  free delete synth definition
1.27 /  n_  set Set a node’s control value(s)
1.28 /  b_  write Write sound file data.
1.29 /  b_  getn Get ranges of sample value(s)
1.30 /  b_  fill Fill ranges of sample value(s)
1.31 /  s_  noid Auto-reassign synth’s ID to a reserved value
1.32 /  d_  recv Receive a synth definition file
1.33 /  u_  cmd send a command to a unit generator
1.34 /  b_  alloc  Read Allocate buffer space and read a sound file.
1.35 /  n_  map Map a node’s controls to read from a bus
1.36 /  status Query the status
1.37 /  g_  new Create a new group
1.38 /  c_  get Get bus value(s)
1.39 /  b_  set Set sample value(s)
1.40 /  b_  zero Zero sample data
1.41 /  tr A trigger message
1.42 /  dump  OSC Display incoming OSC messages
1.43 /  n_  setn Set ranges of a node’s control value(s)
1.44 /  b_  free Free buffer data.
1.45 /  notify Register to receive notifications from server
1.46 /  b_  query
1.47 /  g_  tail Add node to tail of group
1.48 /  clear  Sched Clear all scheduled bundles.
1.49 /  g_  free  All Delete all nodes in a group.
1.50 /  g_  head Add node to head of group
1.51 /  c_  getn Get ranges of bus value(s)
1.52 /  quit Quit program
1.53 see g-new
1.54 /  c_  fill Fill ranges of bus value(s)
8.6

1 rsc3: server commands

server commands

    1.1 /g_deepFree Free all synths in this group and all its sub-groups.

    1.2 /c_setn Set ranges of bus value(s)

    1.3 /sync Notify when async commands have completed.

    1.4 /s_getn Get ranges of control value(s)

    1.5 /s_get Get control value(s)

    1.6 /n_mapn Map a node’s controls to read from buses

    1.7 /b_gen Call a command to fill a buffer

    1.8 /n_trace Trace a node

    1.9 /b_alloc Allocate buffer space.

    1.10 /n_query Get info about a node

    1.11 /d_load Load synth definition

    1.12 /n_fill Fill ranges of a node’s control value(s)

    1.13 /n_before Place a node before another

    1.14 /b_close

    1.15 see s-new

    1.16 /s_new Create a new synth

    1.17 /b_setn Set ranges of sample value(s)

    1.18 /c_set Set bus value(s)

    1.19 /n_free Delete a node.

    1.20 see n-set

    1.21 /n_run Turn node on or off

    1.22 /b_read Read sound file data into an existing buffer.

    1.23 /nrt_end end real time mode, close file

    1.24 /b_get Get sample value(s)

    1.25 /n_after Place a node after another

    1.26 /d_free delete synth definition

    1.27 /n_set Set a node’s control value(s)

    1.28 /b_write Write sound file data.

    1.29 /b_getn Get ranges of sample value(s)

    1.30 /b_fill Fill ranges of sample value(s)

    1.31 /s_noid Auto-reassign synth’s ID to a reserved value

    1.32 /d_recv Receive a synth definition file

    1.33 /u_cmd send a command to a unit generator

    1.34 /b_allocRead Allocate buffer space and read a sound file.

    1.35 /n_map Map a node’s controls to read from a bus

    1.36 /status Query the status

    1.37 /g_new Create a new group

    1.38 /c_get Get bus value(s)

    1.39 /b_set Set sample value(s)

    1.40 /b_zero Zero sample data

    1.41 /tr A trigger message

    1.42 /dumpOSC Display incoming OSC messages

    1.43 /n_setn Set ranges of a node’s control value(s)

    1.44 /b_free Free buffer data.

    1.45 /notify Register to receive notifications from server

    1.46 /b_query

    1.47 /g_tail Add node to tail of group

    1.48 /clearSched Clear all scheduled bundles.

    1.49 /g_freeAll Delete all nodes in a group.

    1.50 /g_head Add node to head of group

    1.51 /c_getn Get ranges of bus value(s)

    1.52 /quit Quit program

    1.53 see g-new

    1.54 /c_fill Fill ranges of bus value(s)

1.1 /g_deepFree Free all synths in this group and all its sub-groups.

[ +1 rsc3: server commands

rsc3:   server commands
On this page:
1.1 /  g_  deep  Free Free all synths in this group and all its sub-groups.
1.2 /  c_  setn Set ranges of bus value(s)
1.3 /  sync Notify when async commands have completed.
1.4 /  s_  getn Get ranges of control value(s)
1.5 /  s_  get Get control value(s)
1.6 /  n_  mapn Map a node’s controls to read from buses
1.7 /  b_  gen Call a command to fill a buffer
1.8 /  n_  trace Trace a node
1.9 /  b_  alloc Allocate buffer space.
1.10 /  n_  query Get info about a node
1.11 /  d_  load Load synth definition
1.12 /  n_  fill Fill ranges of a node’s control value(s)
1.13 /  n_  before Place a node before another
1.14 /  b_  close
1.15 see s-new
1.16 /  s_  new Create a new synth
1.17 /  b_  setn Set ranges of sample value(s)
1.18 /  c_  set Set bus value(s)
1.19 /  n_  free Delete a node.
1.20 see n-set
1.21 /  n_  run Turn node on or off
1.22 /  b_  read Read sound file data into an existing buffer.
1.23 /  nrt_  end end real time mode, close file
1.24 /  b_  get Get sample value(s)
1.25 /  n_  after Place a node after another
1.26 /  d_  free delete synth definition
1.27 /  n_  set Set a node’s control value(s)
1.28 /  b_  write Write sound file data.
1.29 /  b_  getn Get ranges of sample value(s)
1.30 /  b_  fill Fill ranges of sample value(s)
1.31 /  s_  noid Auto-reassign synth’s ID to a reserved value
1.32 /  d_  recv Receive a synth definition file
1.33 /  u_  cmd send a command to a unit generator
1.34 /  b_  alloc  Read Allocate buffer space and read a sound file.
1.35 /  n_  map Map a node’s controls to read from a bus
1.36 /  status Query the status
1.37 /  g_  new Create a new group
1.38 /  c_  get Get bus value(s)
1.39 /  b_  set Set sample value(s)
1.40 /  b_  zero Zero sample data
1.41 /  tr A trigger message
1.42 /  dump  OSC Display incoming OSC messages
1.43 /  n_  setn Set ranges of a node’s control value(s)
1.44 /  b_  free Free buffer data.
1.45 /  notify Register to receive notifications from server
1.46 /  b_  query
1.47 /  g_  tail Add node to tail of group
1.48 /  clear  Sched Clear all scheduled bundles.
1.49 /  g_  free  All Delete all nodes in a group.
1.50 /  g_  head Add node to head of group
1.51 /  c_  getn Get ranges of bus value(s)
1.52 /  quit Quit program
1.53 see g-new
1.54 /  c_  fill Fill ranges of bus value(s)
8.6

1 rsc3: server commands

server commands

    1.1 /g_deepFree Free all synths in this group and all its sub-groups.

    1.2 /c_setn Set ranges of bus value(s)

    1.3 /sync Notify when async commands have completed.

    1.4 /s_getn Get ranges of control value(s)

    1.5 /s_get Get control value(s)

    1.6 /n_mapn Map a node’s controls to read from buses

    1.7 /b_gen Call a command to fill a buffer

    1.8 /n_trace Trace a node

    1.9 /b_alloc Allocate buffer space.

    1.10 /n_query Get info about a node

    1.11 /d_load Load synth definition

    1.12 /n_fill Fill ranges of a node’s control value(s)

    1.13 /n_before Place a node before another

    1.14 /b_close

    1.15 see s-new

    1.16 /s_new Create a new synth

    1.17 /b_setn Set ranges of sample value(s)

    1.18 /c_set Set bus value(s)

    1.19 /n_free Delete a node.

    1.20 see n-set

    1.21 /n_run Turn node on or off

    1.22 /b_read Read sound file data into an existing buffer.

    1.23 /nrt_end end real time mode, close file

    1.24 /b_get Get sample value(s)

    1.25 /n_after Place a node after another

    1.26 /d_free delete synth definition

    1.27 /n_set Set a node’s control value(s)

    1.28 /b_write Write sound file data.

    1.29 /b_getn Get ranges of sample value(s)

    1.30 /b_fill Fill ranges of sample value(s)

    1.31 /s_noid Auto-reassign synth’s ID to a reserved value

    1.32 /d_recv Receive a synth definition file

    1.33 /u_cmd send a command to a unit generator

    1.34 /b_allocRead Allocate buffer space and read a sound file.

    1.35 /n_map Map a node’s controls to read from a bus

    1.36 /status Query the status

    1.37 /g_new Create a new group

    1.38 /c_get Get bus value(s)

    1.39 /b_set Set sample value(s)

    1.40 /b_zero Zero sample data

    1.41 /tr A trigger message

    1.42 /dumpOSC Display incoming OSC messages

    1.43 /n_setn Set ranges of a node’s control value(s)

    1.44 /b_free Free buffer data.

    1.45 /notify Register to receive notifications from server

    1.46 /b_query

    1.47 /g_tail Add node to tail of group

    1.48 /clearSched Clear all scheduled bundles.

    1.49 /g_freeAll Delete all nodes in a group.

    1.50 /g_head Add node to head of group

    1.51 /c_getn Get ranges of bus value(s)

    1.52 /quit Quit program

    1.53 see g-new

    1.54 /c_fill Fill ranges of bus value(s)

1.1 /g_deepFree Free all synths in this group and all its sub-groups.

[ int - group ID ] * N

Traverses all groups below this group and frees all the synths. Sub-groups are not freed. A list of groups may be specified.

1.2 /c_setn Set ranges of bus value(s)

[ @@ -179,17 +179,7 @@ int or string - a control index or name float - a control value ] * N

Takes a list of pairs of control indices and values and sets the controls to those values. If the node is a group, then it sets the -controls of every node in the group.

(with-sc3 - (lambda (fd) - (letc ((f 440) - (a 0.1)) - (send-synth fd "sin" (out 0 (mul (sin-osc ar f 0) a)))) - (send fd (s-new0 "sin" 1001 add-to-tail 1))))

(with-sc3 - (lambda (fd) - (send fd (n-set1 1001 "f" 1280))))

(with-sc3 - (lambda (fd) - (send fd (n-set 1001 (list (tuple2 "f" (random 60 900)) - (tuple2 "a" (random 0.05 0.25)))))))

1.28 /b_write Write sound file data.

int - buffer number +controls of every node in the group.

(with-sc3
 (lambda (fd)
   (letc ((f 440)
          (a 0.1))
     (send-synth fd "sin" (out 0 (mul (sin-osc ar f 0) a))))
   (send fd (s-new0 "sin" 1001 add-to-tail 1))))
(with-sc3
 (lambda (fd)
   (send fd (n-set1 1001 "f" 1280))))
(with-sc3
 (lambda (fd)
   (send fd (n-set 1001 (list (tuple2 "f" (random 60 900))
                              (tuple2 "a" (random 0.05 0.25)))))))

1.28 /b_write Write sound file data.

int - buffer number string - path name of a sound file. string - header format. string - sample format. @@ -271,7 +261,7 @@ target ID.

3 - add the new group just after the node specified by the add target ID.

4 - the new node replaces the node specified by the add target ID. The target node is freed.

Multiple groups may be created in one command by adding arguments.

1.38 /c_get Get bus value(s)

[ -int - a bus index + int - a bus index ] * N

Takes a list of buses and replies to sender with the corresponding /c_set command.

1.39 /b_set Set sample value(s)

int - buffer number [ @@ -310,10 +300,7 @@ sending you notifications.

Asynchronous. Replies to sender with /done when int - number of frames int - number of channels float - sample rate -] * N

(with-sc3 - (lambda (fd) - (async fd (/b_alloc 10 6 1)) - (async fd (/b_query 10))))

1.47 /g_tail Add node to tail of group

[ +] * N

(with-sc3
 (lambda (fd)
   (async fd (/b_alloc 10 6 1))
   (async fd (/b_query 10))))

1.47 /g_tail Add node to tail of group

[ int - group ID int - node ID ] * N

Adds the node to the tail (last to be executed) of the group.

1.48 /clearSched Clear all scheduled bundles.

Removes all bundles from the scheduling queue.

1.49 /g_freeAll Delete all nodes in a group.

[ diff --git a/doc/rsc3-docs/rsc3__tutorials.html b/doc/rsc3-docs/rsc3__tutorials.html index 3481f60..13b7442 100644 --- a/doc/rsc3-docs/rsc3__tutorials.html +++ b/doc/rsc3-docs/rsc3__tutorials.html @@ -1,2 +1,2 @@ -3 rsc3: tutorials

8.6

3 rsc3: tutorials

A Gentle Introduction to SuperCollider (2nd edition).pdf

SuperCollider tutorial - Nick Collins

rsc3-for-schemers.md

rsc3-tutorial.md

 
\ No newline at end of file +3 rsc3: tutorials
8.6

3 rsc3: tutorials

A Gentle Introduction to SuperCollider (2nd edition).pdf

SuperCollider tutorial - Nick Collins

rsc3-for-schemers.md

rsc3-tutorial.md

 
\ No newline at end of file diff --git a/doc/rsc3-docs/rsc3__ugens.html b/doc/rsc3-docs/rsc3__ugens.html index 0f67d3d..a3d2f8b 100644 --- a/doc/rsc3-docs/rsc3__ugens.html +++ b/doc/rsc3-docs/rsc3__ugens.html @@ -1,710 +1,45 @@ -2 rsc3: ugens
rsc3:   ugens
On this page:
2.1 (Rlpf in freq rq)
2.2 (fold in lo hi)
2.3 (formlet in freq attack  Time decay  Time)
2.4 (lin-lin in srclo srchi dstlo dsthi)
2.5 (fos in a0 a1 b1)
2.6 (bpf in freq rq)
2.7 (wrap in lo hi)
2.8 (bpz2 in)
2.9 (amp-comp freq root exp)
2.10 (lag2 in lag  Time)
2.11 (one-zero in coef)
2.12 (klank in freq  Scale freq  Offset decay  Scale spec)
2.13 (lpz2 ar in)
2.14 (lin-exp in srclo srchi dstlo dsthi)
2.15 (hpz2 in)
2.16 (leak-dc in coef)
2.17 (hpf in freq)
2.18 (sos in a0 a1 a2 b1 b2)
2.19 (normalizer in level dur)
2.20 (two-zero in freq radius)
2.21 (clip in lo hi)
2.22 (limiter input level look  Ahead  Time)
2.23 (median length in)
2.24 (lag3 in lag  Time)
2.25 (amp-comp  A freq root min  Amp root  Amp)
2.26 (two-pole in freq radius)
2.27 (lpf in freq)
2.28 (hpz1 in)
2.29 (freq-shift input shift phase)
2.30 (lpz1 ar in)
2.31 (moog-ff in freq gain reset)
2.32 (resonz in freq bwr)
2.33 (brz2 in)
2.34 (Rhpf in freq rq)
2.35 (brf in freq rq)
2.36 (one-pole in coef)
2.37 (lag in lag  Time)
2.38 (ringz in freq decay  Time)
2.39 (dyn-klank in freq  Scale freq  Offset decay  Scale spec)
2.40 (Grainin nc tr dur in pan envbuf)
2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)
2.42 (grain-sin nc tr dur freq pan envbuf)
2.43 (warp1 nc buf ptr freq  Scale window  Size envbuf overlaps windowrand  Ratio interp)
2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)
2.45 (disk-in num-channels rate bufnum)
2.46 (disk-out bufnum channels)
2.47 num-input-buses
2.48 num-control-buses
2.49 num-buffers
2.50 num-output-buses
2.51 (buf-frames rate bufnum)
2.52 (buf-rate-scale rate bufnum)
2.53 sample-dur
2.54 sample-rate
2.55 radians-per-sample
2.56 (buf-dur rate bufnum)
2.57 (buf-channels rate bufnum)
2.58 (buf-sample-rate rate bufnum)
2.59 num-audio-buses
2.60 num-running-synths
2.61 subsample-offset
2.62 (zero-crossing in)
2.63 (slope in)
2.64 (running-sum in numsamp)
2.65 (pitch in init  Freq min  Freq max  Freq exec  Freq max  Bins  Per  Octave
2.66 (compander input control thresh slope  Below slope  Above clamp  Time relax  Time)
2.67 (amplitude rate in attack  Time release  Time)
2.68 (pulse-divider trig div start)
2.69 (gate in trig)
2.70 (poll trig in trigid label)
2.71 (most-change a b)
2.72 (trig in dur)
2.73 (pulse-count trig reset)
2.74 (stepper trig reset min max step resetval)
2.75 (last-value in diff)
2.76 (peak-follower in decay)
2.77 (running-max in trig)
2.78 (trig1 in dur)
2.79 (phasor trig rate start end resetpos)
2.80 (schmidt in lo hi)
2.81 (peak trig reset)
2.82 (toggle-ff trig)
2.83 (sweep trig rate)
2.84 (send-trig in id value)
2.85 (in-range in lo hi)
2.86 (timer trig)
2.87 (t-delay trigger delay  Time)
2.88 (running-min in trig)
2.89 (set-reset-ff trig reset)
2.90 (saw rate freq)
2.91 (pm-osc rate carfreq modfreq index modphase)
2.92 (lf-tri rate freq iphase)
2.93 (t-grains num  Channels trigger bufnum rate center  Pos dur pan amp interp)
2.94 (tw-index in normalize array)
2.95 (osc-n rate bufnum freq phase)
2.96 (osc rate bufnum freq phase)
2.97 (lf-saw rate freq iphase)
2.98 (tw-choose trig array weights normalize)
2.99 (import (rsc3))
2.100 (pulse rate freq width)
2.101 (shaper bufnum in)
2.102 SC2:   Note extra iphase argument. - -(import (rsc3)) - -(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) - -(let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))
2.103 (v-osc rate bufpos freq phase)
2.104 (var-saw rate freq iphasewidth)
2.105 (import (sosc) (rsc3)) - -(let ((a (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) - (f (mul-add (lf-noise1 kr 2) 300 400)) - (i (mul (sin-osc ar f 0) 0.1))) - (mrg2 (buf-wr 0 p 1 i) - (out 0 0.0))))) - (b (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) - (out 0 (buf-rd 1 ar 0 p 1 2)))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 (* 44100 2) 1)) - (send-synth fd "a" a) - (send-synth fd "b" b) - (send fd (s-new0 "a" 1001 1 0)) - (send fd (s-new0 "b" 1002 1 0))))) - -(define (do-send m) - (with-sc3 (lambda (fd) (send fd m)))) - -(do-send (n-set1 1002 "r" 5)) - -(do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))
2.106 (import (rsc3)) - -(audition (out 0 (mul (impulse ar 800 0) 0.1))) - -(let ((f (x-line kr 800 10 5 remove-synth))) - (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) - -(let ((f (mouse-y* kr 4 8 0 0.1)) - (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))
2.107 (import (rsc3)) - -(audition (out 0 (mul (blip ar 440 200) 0.15)))
2.108 (select which array)
2.109 (import (rsc3))
2.110 (import (rsc3)) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+   1 2 4) 1 1/  2 1/  3 1/  4 1/  5 1/  6 1/  7 1/  8 1/  9 1/  10))))) - -(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) - -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))
2.111 (v-osc3 rate bufpos freq1 freq2 freq3)
2.112 (lf-cub rate freq iphase)
2.113 (lf-pulse rate freq iphase width)
2.114 (import (sosc) (rsc3))
2.115 See lf-cub.
2.116 (sync-saw rate sync  Freq saw  Freq)
2.117 (t-choose trig array)
2.118 (sin-osc rate freq phase)
2.119 (klang rate freq  Scale freq  Offset spec)
2.120 (lag-in num-channels bus lag)
2.121 (sound-in channel)
2.122 (in num-channels rate bus)
2.123 (in-trig num-channels bus)
2.124 (replace-out bufferindex inputs)
2.125 (local-in num-channels rate)
2.126 (offset-out bufferindex inputs)
2.127 (in-feedback num-channels bus)
2.128 (x-out buffer-index xfade inputs)
2.129 (out bufferindex inputs)
2.130 (mix UGen)
2.131 (mix-fill n f) - -(let ((n 6) - (o (lambda (_  ) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))
2.132 (latch in trig)
2.133 (decay in decay  Time)
2.134 (wrap-index bufnum in)
2.135 (mouse-y rate minval maxval warp lag)
2.136 (degree-to-key bufnum in octave)
2.137 (key-state rate keynum minval maxval lag)
2.138 (mrg2 left right)
2.139 (mouse-button rate minval maxval lag)
2.140 (slew in up dn)
2.141 (mouse-x rate minval maxval warp lag)
2.142 (decay2 in attack  Time decay  Time)
2.143 (k2a in)
2.144 (mul-add a b c)
2.145 (clip2 a b)
2.146 (Atan2 x y)
2.147 (trunc a b)
2.148 (sub a b)
2.149 (round-up a b)
2.150 (ring4 a b)
2.151 (pow a b)
2.152 (ring1 a b)
2.153 (gt a b)
2.154 (add a b)
2.155 (abs-dif a b)
2.156 (am-clip a b)
2.157 (ge a b)
2.158 (max a b)
2.159 (ring3 a b)
2.160 (thresh a b)
2.161 (dif-sqr a b)
2.162 (excess a b)
2.163 (fold2 a b)
2.164 (sqr-dif a b)
2.165 (hypot x y)
2.166 (sqr-sum a b)
2.167 (sum-sqr a b)
2.168 (le a b)
2.169 See gt
2.170 (scale-neg a b)
2.171 (ring2 a b)
2.172 (Mod a b)
2.173 (fdiv a b)
2.174 (mul a b)
2.175 (min a b)
2.176 (lt a b)
2.177 (wrap2 a b)
2.178 (round a b)
2.179 (hasher in)
2.180 (rand-seed rate trig seed)
2.181 (lfd-noise0 rate freq)
2.182 (lfclip-noise rate freq)
2.183 See lf-noise0
2.184 (clip-noise rate)
2.185 (ti-rand lo hi trig)
2.186 (lf-noise0 rate freq)
2.187 (pink-noise rate)
2.188 (rand lo hi)
2.189 (gray-noise rate)
2.190 See lfd-noise0
2.191 (i-rand lo hi)
2.192 (n-rand lo hi n)
2.193 (lfdclip-noise rate freq)
2.194 (coin-gate prob in)
2.195 (t-exp-rand lo hi trig)
2.196 (t-rand lo hi trig)
2.197 (white-noise rate)
2.198 (dust2 rate density)
2.199 See lfd-noise0
2.200 (rand-id rate id)
2.201 See lf-noise0
2.202 (mantissa-mask in bits)
2.203 (dust rate density)
2.204 (lin-rand lo hi minmax)
2.205 (exp-rand lo hi)
2.206 (brown-noise rate)
2.207 (u:  log a)
2.208 (frac a)
2.209 (arc-tan a)
2.210 (distort a)
2.211 (tan-h a)
2.212 (u:  floor a)
2.213 (cps-oct a)
2.214 (db-amp a)
2.215 (u:  sqrt a)
2.216 (soft-clip a)
2.217 (cps-midi a)
2.218 (is-strictly-positive a)
2.219 (u:  tan a)
2.220 (cos-h a)
2.221 (amp-db a)
2.222 (abs a)
2.223 (log10 a)
2.224 (midi-cps a)
2.225 (is-positive a)
2.226 (sign a)
2.227 (neg a)
2.228 (log2 a)
2.229 (ceil a)
2.230 (arc-cos a)
2.231 (exp a)
2.232 (squared a)
2.233 (arc-sin a)
2.234 (cubed a)
2.235 (is-negative a)
2.236 (oct-cps a)
2.237 (u:  sin a)
2.238 (sin-h a)
2.239 (cos a)
2.240 (pv-mul buffer  A buffer  B)
2.241 (pv-mag-squared buffer)
2.242 (pv-min buffer  A buffer  B)
2.243 (pv-mag-noise buffer)
2.244 (pv-mag-below buffer threshold)
2.245 (convolution in kernel framesize)
2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) - -#| - -fft feature detector for onset detection based on work described in -Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using -Feature Extraction. in Proceedings of the Computer Music Modeling and -Retrieval Symposium, Lecture Notes in Computer Science. springer -Verlag. - -First order derivatives of the features are taken. Threshold may -need to be set low to pick up on changes. - -buffer - fft buffer to read from. -propsc - Proportion of spectral centroid feature. -prophfe - Proportion of high frequency energy feature. -prophfc - Proportion of high frequency content feature. -propsf - Proportion of spectral flux feature. -threshold - Threshold level for allowing a detection -waittime - If triggered, minimum wait until a further frame can - cause another spot (useful to stop multiple detects on - heavy signals) - -Default values in sclang are:   propsc=0.25, prophfe=0.25, -prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. - -|# - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)))) - -(let* ((source (sound-in 0)) - (detect (pv-jensen-andersen (fft* 0 source) - 0.25 0.25 0.25 0.25 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))
2.247 (pv-phase-shift270 buffer)
2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)
2.249 (pv-phase-shift buffer shift)
2.250 (pv-copy buffer  A buffer  B)
2.251 (pv-brick-wall buffer wipe)
2.252 (pv-mag-smear buffer bins)
2.253 (pv-mag-above buffer threshold)
2.254 (pv-bin-shift buffer stretch shift)
2.255 (fft buffer in hop wintype active)
2.256 (pv-bin-wipe buffer  A buffer  B wipe)
2.257 (pv-copy  Phase buffer  A buffer  B)
2.258 (pv-phase-shift90 buffer)
2.259 (convolution2 in bufnum trigger framesize) - -#| - -Strict convolution with fixed kernel which can be updated using a -trigger signal. - -in - processing target -bufnum - buffer index for the fixed kernel, may be modulated in - combination with the trigger -trigger - update the kernel on a change from <=0 to >0 -framesize - size of fft frame, must be a power of two. convolution - uses twice this number internally, maximum value you - can give this argument is 2^16=65536. Note that it gets - progressively more expensive to run for higher powers! - 512, 1024, 2048, 4096 standard. - -|# - -(with-sc3 - (lambda (fd) - (for-each - (lambda (b) - (async fd (b-alloc b 2048 1))) - (list 10 11 12)) - (for-each - (lambda (n) - (send fd (b-set1 10 (+   (* 400 n) 100) 1))) - (enum-from-to 0 2)) - (for-each - (lambda (n) - (send fd (b-set1 11 (+   (* 20 n) 10) (random 0 1)))) - (enum-from-to 0 49)) - (for-each - (lambda (n) - (send fd (b-set1 12 (+   (* 40 n) 20) 1))) - (enum-from-to 0 19)) - (send-synth - fd "c" - (letc ((k 0) (t 0)) - (let ((i (impulse ar 1 0))) - (out 0 (mul (convolution2 i k t 2048) 0.5))))))) - -(define send-to - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m))))) - -(define async-to - (lambda (m) - (with-sc3 - (lambda (fd) - (async fd m))))) - -(send-to (s-new1 "c" 1001 1 1 "k" 10)) - -(send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(send-to (n-set1 1001 "k" 12)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(async-to (b-zero 12)) - -(for-each - (lambda (n) - (send-to (b-set1 12 (+   (* 20 n) 10) 1))) - (enum-from-to 0 39)) - -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))
2.260 (pv-rect-comb2 buffer  A buffer  B num  Teeth phase width)
2.261 (pv-add buffer  A buffer  B)
2.262 (pv-rand-comb buffer wipe trig)
2.263 (pv-local-max buffer threshold)
2.264 (pv-mag-mul buffer  A buffer  B)
2.265 (pv-conformal-map buffer real imag)
2.266 (pv-diffuser buffer trig)
2.267 (pv-max buffer  A buffer  B)
2.268 (Ifft buffer wintype)
2.269 (pv-bin-scramble buffer wipe width trig)
2.270 (pv-rand-wipe buffer  A buffer  B wipe trig)
2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)
2.272 (pvcollect chain numframes func frombin tobin zeroothers)
2.273 (PV_  Magclip buffer threshold)
2.274 (PV_  Magfreeze buffer freeze)
2.275 (pv-rect-comb buffer num  Teeth phase width) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (x (mouse-x kr 0 0.5 0 0.1)) - (y (mouse-y kr 0 0.5 0 0.1)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 x y))) - (audition (out 0 (ifft* c)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) - (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))
2.276 (pv-mag-shift buffer stretch shift)
2.277 See allpass-n
2.278 See comb-n
2.279 See Bufallpass-c
2.280 (free-verb in mix room damp)
2.281 See free  Verb
2.282 (play-buf num  Channels bufnum rate trigger start  Pos loop)
2.283 See buf-delay-c
2.284 (delay2 in)
2.285 (comb-n in max  Delay  Time delay  Time decay  Time)
2.286 See Bufallpass-c
2.287 (allpass-n in max  Delay  Time delay  Time decay  Time)
2.288 See comb-n
2.289 (buf-allpass-c buf in delaytime decaytime)
2.290 See allpass-n
2.291 See buf-delay-c
2.292 (buf-delay-c buf in delaytime)
2.293 (pluck in tr maxdelaytime delaytime decaytime coef)
2.294 (pitch-shift in win  Size pch  Ratio pch  Dispersion time  Dispersion)
2.295 See buf-comb-c
2.296 (buf-comb-c buf in delaytime decaytime)
2.297 (buf-rd num  Channels rate bufnum phase loop interpolation)
2.298 (delay1 in)
2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)
2.300 See delay-n
2.301 See buf-comb-c
2.302 See delay-n
2.303 (delay-n in max  Delay  Time delay  Time)
2.304 (ball in g damp friction)
2.305 (dswitch1 index array)
2.306 (t-duty rate duration reset done  Action level gap)
2.307 See dwhite
2.308 (dwhite length lo hi)
2.309 (dbufrd bufnum phase loop)
2.310 (demand-env-gen rate levels times shapes curves gate reset
2.311 (demand trig reset ugens)
2.312 (duty rate duration reset done  Action level)
2.313 (dser length array)
2.314 (dgeom length start grow)
2.315 (drand length array)
2.316 See drand
2.317 (dseries length start step)
2.318 (dswitch index array)
2.319 See dbrown
2.320 (dbrown length lo hi step)
2.321 (dseq length array)
2.322 See latoocarfian-c.
2.323 (fb-sine-c rate freq im fb a c xi yi)
2.324 See fb-sine-c
2.325 (quad-n rate freq a b c xi)
2.326 (lorenz-l rate freq s r b h xi yi zi)
2.327 See standard-l.
2.328 See quad-n
2.329 See cusp-n
2.330 See latoocarfian-c.
2.331 (logistic rate chaos  Param freq)
2.332 See fb-sine-c
2.333 (latoocarfian-c rate freq a b c d xi yi)
2.334 (rossler rate chaos  Param dt)
2.335 (standard-l rate freq k xi yi)
2.336 See quad-n
2.337 (cusp-n rate freq a b xi)
2.338 (lin-cong-c rate freq a c m xi)
2.339 (crackle rate chaos  Param)
2.340 (henon-n rate freq a b x0 x1)
2.341 See henon-n
2.342 See lin-cong-c.
2.343 See Gbman  L.
2.344 See Gbman  L.
2.345 See henon-n
2.346 See lin-cong-c.
2.347 (gbman-c rate freq xi yi)
2.348 (lin-pan2 in pos level)
2.349 (rotate2 x y pos)
2.350 (decode-b2 num  Channels w x y orientation)
2.351 (pan2 in pos level)
2.352 (pan-b2 in azimuth gain)
2.353 (detect-silence in amp time done  Action)
2.354 (line rate start end dur done  Action)
2.355 (free trig node  ID)
2.356 (pause-self-when-done src)
2.357 (pause-self src)
2.358 (env-gen rate gate level  Scale level  Bias time  Scale done  Action envelope)
2.359 (free-self-when-done src)
2.360 (pause gate node  ID)
2.361 (x-line rate start end dur done  Action)
2.362 (done src)
2.363 (linen gate attack  Time sus  Level release  Time done  Action)
2.364 (free-self src)
8.6

2 rsc3: ugens

    2.1 (Rlpf in freq rq)

    2.2 (fold in lo hi)

    2.3 (formlet in freq attackTime decayTime)

    2.4 (lin-lin in srclo srchi dstlo dsthi)

    2.5 (fos in a0 a1 b1)

    2.6 (bpf in freq rq)

    2.7 (wrap in lo hi)

    2.8 (bpz2 in)

    2.9 (amp-comp freq root exp)

    2.10 (lag2 in lagTime)

    2.11 (one-zero in coef)

    2.12 (klank in freqScale freqOffset decayScale spec)

    2.13 (lpz2 ar in)

    2.14 (lin-exp in srclo srchi dstlo dsthi)

    2.15 (hpz2 in)

    2.16 (leak-dc in coef)

    2.17 (hpf in freq)

    2.18 (sos in a0 a1 a2 b1 b2)

    2.19 (normalizer in level dur)

    2.20 (two-zero in freq radius)

    2.21 (clip in lo hi)

    2.22 (limiter input level lookAheadTime)

    2.23 (median length in)

    2.24 (lag3 in lagTime)

    2.25 (amp-compA freq root minAmp rootAmp)

    2.26 (two-pole in freq radius)

    2.27 (lpf in freq)

    2.28 (hpz1 in)

    2.29 (freq-shift input shift phase)

    2.30 (lpz1 ar in)

    2.31 (moog-ff in freq gain reset)

    2.32 (resonz in freq bwr)

    2.33 (brz2 in)

    2.34 (Rhpf in freq rq)

    2.35 (brf in freq rq)

    2.36 (one-pole in coef)

    2.37 (lag in lagTime)

    2.38 (ringz in freq decayTime)

    2.39 (dyn-klank in freqScale freqOffset decayScale spec)

    2.40 (Grainin nc tr dur in pan envbuf)

    2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

    2.42 (grain-sin nc tr dur freq pan envbuf)

    2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

    2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

    2.45 (disk-in num-channels rate bufnum)

    2.46 (disk-out bufnum channels)

    2.47 num-input-buses

    2.48 num-control-buses

    2.49 num-buffers

    2.50 num-output-buses

    2.51 (buf-frames rate bufnum)

    2.52 (buf-rate-scale rate bufnum)

    2.53 sample-dur

    2.54 sample-rate

    2.55 radians-per-sample

    2.56 (buf-dur rate bufnum)

    2.57 (buf-channels rate bufnum)

    2.58 (buf-sample-rate rate bufnum)

    2.59 num-audio-buses

    2.60 num-running-synths

    2.61 subsample-offset

    2.62 (zero-crossing in)

    2.63 (slope in)

    2.64 (running-sum in numsamp)

    2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

    2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

    2.67 (amplitude rate in attackTime releaseTime)

    2.68 (pulse-divider trig div start)

    2.69 (gate in trig)

    2.70 (poll trig in trigid label)

    2.71 (most-change a b)

    2.72 (trig in dur)

    2.73 (pulse-count trig reset)

    2.74 (stepper trig reset min max step resetval)

    2.75 (last-value in diff)

    2.76 (peak-follower in decay)

    2.77 (running-max in trig)

    2.78 (trig1 in dur)

    2.79 (phasor trig rate start end resetpos)

    2.80 (schmidt in lo hi)

    2.81 (peak trig reset)

    2.82 (toggle-ff trig)

    2.83 (sweep trig rate)

    2.84 (send-trig in id value)

    2.85 (in-range in lo hi)

    2.86 (timer trig)

    2.87 (t-delay trigger delayTime)

    2.88 (running-min in trig)

    2.89 (set-reset-ff trig reset)

    2.90 (saw rate freq)

    2.91 (pm-osc rate carfreq modfreq index modphase)

    2.92 (lf-tri rate freq iphase)

    2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

    2.94 (tw-index in normalize array)

    2.95 (osc-n rate bufnum freq phase)

    2.96 (osc rate bufnum freq phase)

    2.97 (lf-saw rate freq iphase)

    2.98 (tw-choose trig array weights normalize)

    2.99 (import (rsc3))

    2.100 (pulse rate freq width)

    2.101 (shaper bufnum in)

    2.102 SC2: Note extra iphase argument. - -(import (rsc3)) - -(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) - -(let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

    2.103 (v-osc rate bufpos freq phase)

    2.104 (var-saw rate freq iphasewidth)

    2.105 (import (sosc) (rsc3)) - -(let ((a (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) - (f (mul-add (lf-noise1 kr 2) 300 400)) - (i (mul (sin-osc ar f 0) 0.1))) - (mrg2 (buf-wr 0 p 1 i) - (out 0 0.0))))) - (b (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) - (out 0 (buf-rd 1 ar 0 p 1 2)))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 (* 44100 2) 1)) - (send-synth fd "a" a) - (send-synth fd "b" b) - (send fd (s-new0 "a" 1001 1 0)) - (send fd (s-new0 "b" 1002 1 0))))) - -(define (do-send m) - (with-sc3 (lambda (fd) (send fd m)))) - -(do-send (n-set1 1002 "r" 5)) - -(do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))

    2.106 (import (rsc3)) - -(audition (out 0 (mul (impulse ar 800 0) 0.1))) - -(let ((f (x-line kr 800 10 5 remove-synth))) - (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) - -(let ((f (mouse-y* kr 4 8 0 0.1)) - (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))

    2.107 (import (rsc3)) - -(audition (out 0 (mul (blip ar 440 200) 0.15)))

    2.108 (select which array)

    2.109 (import (rsc3))

    2.110 (import (rsc3)) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) - -(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) - -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))

    2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

    2.112 (lf-cub rate freq iphase)

    2.113 (lf-pulse rate freq iphase width)

    2.114 (import (sosc) (rsc3))

    2.115 See lf-cub.

    2.116 (sync-saw rate syncFreq sawFreq)

    2.117 (t-choose trig array)

    2.118 (sin-osc rate freq phase)

    2.119 (klang rate freqScale freqOffset spec)

    2.120 (lag-in num-channels bus lag)

    2.121 (sound-in channel)

    2.122 (in num-channels rate bus)

    2.123 (in-trig num-channels bus)

    2.124 (replace-out bufferindex inputs)

    2.125 (local-in num-channels rate)

    2.126 (offset-out bufferindex inputs)

    2.127 (in-feedback num-channels bus)

    2.128 (x-out buffer-index xfade inputs)

    2.129 (out bufferindex inputs)

    2.130 (mix UGen)

    2.131 (mix-fill n f) - -(let ((n 6) - (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))

    2.132 (latch in trig)

    2.133 (decay in decayTime)

    2.134 (wrap-index bufnum in)

    2.135 (mouse-y rate minval maxval warp lag)

    2.136 (degree-to-key bufnum in octave)

    2.137 (key-state rate keynum minval maxval lag)

    2.138 (mrg2 left right)

    2.139 (mouse-button rate minval maxval lag)

    2.140 (slew in up dn)

    2.141 (mouse-x rate minval maxval warp lag)

    2.142 (decay2 in attackTime decayTime)

    2.143 (k2a in)

    2.144 (mul-add a b c)

    2.145 (clip2 a b)

    2.146 (Atan2 x y)

    2.147 (trunc a b)

    2.148 (sub a b)

    2.149 (round-up a b)

    2.150 (ring4 a b)

    2.151 (pow a b)

    2.152 (ring1 a b)

    2.153 (gt a b)

    2.154 (add a b)

    2.155 (abs-dif a b)

    2.156 (am-clip a b)

    2.157 (ge a b)

    2.158 (max a b)

    2.159 (ring3 a b)

    2.160 (thresh a b)

    2.161 (dif-sqr a b)

    2.162 (excess a b)

    2.163 (fold2 a b)

    2.164 (sqr-dif a b)

    2.165 (hypot x y)

    2.166 (sqr-sum a b)

    2.167 (sum-sqr a b)

    2.168 (le a b)

    2.169 See gt

    2.170 (scale-neg a b)

    2.171 (ring2 a b)

    2.172 (Mod a b)

    2.173 (fdiv a b)

    2.174 (mul a b)

    2.175 (min a b)

    2.176 (lt a b)

    2.177 (wrap2 a b)

    2.178 (round a b)

    2.179 (hasher in)

    2.180 (rand-seed rate trig seed)

    2.181 (lfd-noise0 rate freq)

    2.182 (lfclip-noise rate freq)

    2.183 See lf-noise0

    2.184 (clip-noise rate)

    2.185 (ti-rand lo hi trig)

    2.186 (lf-noise0 rate freq)

    2.187 (pink-noise rate)

    2.188 (rand lo hi)

    2.189 (gray-noise rate)

    2.190 See lfd-noise0

    2.191 (i-rand lo hi)

    2.192 (n-rand lo hi n)

    2.193 (lfdclip-noise rate freq)

    2.194 (coin-gate prob in)

    2.195 (t-exp-rand lo hi trig)

    2.196 (t-rand lo hi trig)

    2.197 (white-noise rate)

    2.198 (dust2 rate density)

    2.199 See lfd-noise0

    2.200 (rand-id rate id)

    2.201 See lf-noise0

    2.202 (mantissa-mask in bits)

    2.203 (dust rate density)

    2.204 (lin-rand lo hi minmax)

    2.205 (exp-rand lo hi)

    2.206 (brown-noise rate)

    2.207 (u:log a)

    2.208 (frac a)

    2.209 (arc-tan a)

    2.210 (distort a)

    2.211 (tan-h a)

    2.212 (u:floor a)

    2.213 (cps-oct a)

    2.214 (db-amp a)

    2.215 (u:sqrt a)

    2.216 (soft-clip a)

    2.217 (cps-midi a)

    2.218 (is-strictly-positive a)

    2.219 (u:tan a)

    2.220 (cos-h a)

    2.221 (amp-db a)

    2.222 (abs a)

    2.223 (log10 a)

    2.224 (midi-cps a)

    2.225 (is-positive a)

    2.226 (sign a)

    2.227 (neg a)

    2.228 (log2 a)

    2.229 (ceil a)

    2.230 (arc-cos a)

    2.231 (exp a)

    2.232 (squared a)

    2.233 (arc-sin a)

    2.234 (cubed a)

    2.235 (is-negative a)

    2.236 (oct-cps a)

    2.237 (u:sin a)

    2.238 (sin-h a)

    2.239 (cos a)

    2.240 (pv-mul bufferA bufferB)

    2.241 (pv-mag-squared buffer)

    2.242 (pv-min bufferA bufferB)

    2.243 (pv-mag-noise buffer)

    2.244 (pv-mag-below buffer threshold)

    2.245 (convolution in kernel framesize)

    2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) - -#| - -fft feature detector for onset detection based on work described in -Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using -Feature Extraction. in Proceedings of the Computer Music Modeling and -Retrieval Symposium, Lecture Notes in Computer Science. springer -Verlag. - -First order derivatives of the features are taken. Threshold may -need to be set low to pick up on changes. - -buffer - fft buffer to read from. -propsc - Proportion of spectral centroid feature. -prophfe - Proportion of high frequency energy feature. -prophfc - Proportion of high frequency content feature. -propsf - Proportion of spectral flux feature. -threshold - Threshold level for allowing a detection -waittime - If triggered, minimum wait until a further frame can - cause another spot (useful to stop multiple detects on - heavy signals) - -Default values in sclang are: propsc=0.25, prophfe=0.25, -prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. - -|# - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)))) - -(let* ((source (sound-in 0)) - (detect (pv-jensen-andersen (fft* 0 source) - 0.25 0.25 0.25 0.25 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))

    2.247 (pv-phase-shift270 buffer)

    2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

    2.249 (pv-phase-shift buffer shift)

    2.250 (pv-copy bufferA bufferB)

    2.251 (pv-brick-wall buffer wipe)

    2.252 (pv-mag-smear buffer bins)

    2.253 (pv-mag-above buffer threshold)

    2.254 (pv-bin-shift buffer stretch shift)

    2.255 (fft buffer in hop wintype active)

    2.256 (pv-bin-wipe bufferA bufferB wipe)

    2.257 (pv-copyPhase bufferA bufferB)

    2.258 (pv-phase-shift90 buffer)

    2.259 (convolution2 in bufnum trigger framesize) - -#| - -Strict convolution with fixed kernel which can be updated using a -trigger signal. - -in - processing target -bufnum - buffer index for the fixed kernel, may be modulated in - combination with the trigger -trigger - update the kernel on a change from <=0 to >0 -framesize - size of fft frame, must be a power of two. convolution - uses twice this number internally, maximum value you - can give this argument is 2^16=65536. Note that it gets - progressively more expensive to run for higher powers! - 512, 1024, 2048, 4096 standard. - -|# - -(with-sc3 - (lambda (fd) - (for-each - (lambda (b) - (async fd (b-alloc b 2048 1))) - (list 10 11 12)) - (for-each - (lambda (n) - (send fd (b-set1 10 (+ (* 400 n) 100) 1))) - (enum-from-to 0 2)) - (for-each - (lambda (n) - (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1)))) - (enum-from-to 0 49)) - (for-each - (lambda (n) - (send fd (b-set1 12 (+ (* 40 n) 20) 1))) - (enum-from-to 0 19)) - (send-synth - fd "c" - (letc ((k 0) (t 0)) - (let ((i (impulse ar 1 0))) - (out 0 (mul (convolution2 i k t 2048) 0.5))))))) - -(define send-to - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m))))) - -(define async-to - (lambda (m) - (with-sc3 - (lambda (fd) - (async fd m))))) - -(send-to (s-new1 "c" 1001 1 1 "k" 10)) - -(send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(send-to (n-set1 1001 "k" 12)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(async-to (b-zero 12)) - -(for-each - (lambda (n) - (send-to (b-set1 12 (+ (* 20 n) 10) 1))) - (enum-from-to 0 39)) - -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))

    2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

    2.261 (pv-add bufferA bufferB)

    2.262 (pv-rand-comb buffer wipe trig)

    2.263 (pv-local-max buffer threshold)

    2.264 (pv-mag-mul bufferA bufferB)

    2.265 (pv-conformal-map buffer real imag)

    2.266 (pv-diffuser buffer trig)

    2.267 (pv-max bufferA bufferB)

    2.268 (Ifft buffer wintype)

    2.269 (pv-bin-scramble buffer wipe width trig)

    2.270 (pv-rand-wipe bufferA bufferB wipe trig)

    2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

    2.272 (pvcollect chain numframes func frombin tobin zeroothers)

    2.273 (PV_Magclip buffer threshold)

    2.274 (PV_Magfreeze buffer freeze)

    2.275 (pv-rect-comb buffer numTeeth phase width) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (x (mouse-x kr 0 0.5 0 0.1)) - (y (mouse-y kr 0 0.5 0 0.1)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 x y))) - (audition (out 0 (ifft* c)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) - (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))

    2.276 (pv-mag-shift buffer stretch shift)

    2.277 See allpass-n

    2.278 See comb-n

    2.279 See Bufallpass-c

    2.280 (free-verb in mix room damp)

    2.281 See freeVerb

    2.282 (play-buf numChannels bufnum rate trigger startPos loop)

    2.283 See buf-delay-c

    2.284 (delay2 in)

    2.285 (comb-n in maxDelayTime delayTime decayTime)

    2.286 See Bufallpass-c

    2.287 (allpass-n in maxDelayTime delayTime decayTime)

    2.288 See comb-n

    2.289 (buf-allpass-c buf in delaytime decaytime)

    2.290 See allpass-n

    2.291 See buf-delay-c

    2.292 (buf-delay-c buf in delaytime)

    2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

    2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

    2.295 See buf-comb-c

    2.296 (buf-comb-c buf in delaytime decaytime)

    2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

    2.298 (delay1 in)

    2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

    2.300 See delay-n

    2.301 See buf-comb-c

    2.302 See delay-n

    2.303 (delay-n in maxDelayTime delayTime)

    2.304 (ball in g damp friction)

    2.305 (dswitch1 index array)

    2.306 (t-duty rate duration reset doneAction level gap)

    2.307 See dwhite

    2.308 (dwhite length lo hi)

    2.309 (dbufrd bufnum phase loop)

    2.310 (demand-env-gen rate levels times shapes curves gate reset

    2.311 (demand trig reset ugens)

    2.312 (duty rate duration reset doneAction level)

    2.313 (dser length array)

    2.314 (dgeom length start grow)

    2.315 (drand length array)

    2.316 See drand

    2.317 (dseries length start step)

    2.318 (dswitch index array)

    2.319 See dbrown

    2.320 (dbrown length lo hi step)

    2.321 (dseq length array)

    2.322 See latoocarfian-c.

    2.323 (fb-sine-c rate freq im fb a c xi yi)

    2.324 See fb-sine-c

    2.325 (quad-n rate freq a b c xi)

    2.326 (lorenz-l rate freq s r b h xi yi zi)

    2.327 See standard-l.

    2.328 See quad-n

    2.329 See cusp-n

    2.330 See latoocarfian-c.

    2.331 (logistic rate chaosParam freq)

    2.332 See fb-sine-c

    2.333 (latoocarfian-c rate freq a b c d xi yi)

    2.334 (rossler rate chaosParam dt)

    2.335 (standard-l rate freq k xi yi)

    2.336 See quad-n

    2.337 (cusp-n rate freq a b xi)

    2.338 (lin-cong-c rate freq a c m xi)

    2.339 (crackle rate chaosParam)

    2.340 (henon-n rate freq a b x0 x1)

    2.341 See henon-n

    2.342 See lin-cong-c.

    2.343 See GbmanL.

    2.344 See GbmanL.

    2.345 See henon-n

    2.346 See lin-cong-c.

    2.347 (gbman-c rate freq xi yi)

    2.348 (lin-pan2 in pos level)

    2.349 (rotate2 x y pos)

    2.350 (decode-b2 numChannels w x y orientation)

    2.351 (pan2 in pos level)

    2.352 (pan-b2 in azimuth gain)

    2.353 (detect-silence in amp time doneAction)

    2.354 (line rate start end dur doneAction)

    2.355 (free trig nodeID)

    2.356 (pause-self-when-done src)

    2.357 (pause-self src)

    2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

    2.359 (free-self-when-done src)

    2.360 (pause gate nodeID)

    2.361 (x-line rate start end dur doneAction)

    2.362 (done src)

    2.363 (linen gate attackTime susLevel releaseTime doneAction)

    2.364 (free-self src)

filters

granular

disk-io

information

analysis

triggers

oscillators

io

composite

controls

ternary-ops

binary-ops

noise

unary-ops

fft

delays

physical-models

demand

chaos

panners

envelopes

2.1 (Rlpf in freq rq)

A resonant low pass filter.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth)) - (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) - (audition - (out 0 (rlpf (mul (saw ar 200) 0.1) f2 0.2))))

2.2 (fold in lo hi)

fold a signal outside given thresholds.

This differs from the BinaryOpUGen fold2 in that it allows one to +2 rsc3: ugens

rsc3:   ugens
On this page:
2.1 (Rlpf in freq rq)
2.2 (fold in lo hi)
2.3 (formlet in freq attack  Time decay  Time)
2.4 (lin-lin in srclo srchi dstlo dsthi)
2.5 (fos in a0 a1 b1)
2.6 (bpf in freq rq)
2.7 (wrap in lo hi)
2.8 (bpz2 in)
2.9 (amp-comp freq root exp)
2.10 (lag2 in lag  Time)
2.11 (one-zero in coef)
2.12 (klank in freq  Scale freq  Offset decay  Scale spec)
2.13 (lpz2 ar in)
2.14 (lin-exp in srclo srchi dstlo dsthi)
2.15 (hpz2 in)
2.16 (leak-dc in coef)
2.17 (hpf in freq)
2.18 (sos in a0 a1 a2 b1 b2)
2.19 (normalizer in level dur)
2.20 (two-zero in freq radius)
2.21 (clip in lo hi)
2.22 (limiter input level look  Ahead  Time)
2.23 (median length in)
2.24 (lag3 in lag  Time)
2.25 (amp-comp  A freq root min  Amp root  Amp)
2.26 (two-pole in freq radius)
2.27 (lpf in freq)
2.28 (hpz1 in)
2.29 (freq-shift input shift phase)
2.30 (lpz1 ar in)
2.31 (moog-ff in freq gain reset)
2.32 (resonz in freq bwr)
2.33 (brz2 in)
2.34 (Rhpf in freq rq)
2.35 (brf in freq rq)
2.36 (one-pole in coef)
2.37 (lag in lag  Time)
2.38 (ringz in freq decay  Time)
2.39 (dyn-klank in freq  Scale freq  Offset decay  Scale spec)
2.40 (Grainin nc tr dur in pan envbuf)
2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)
2.42 (grain-sin nc tr dur freq pan envbuf)
2.43 (warp1 nc buf ptr freq  Scale window  Size envbuf overlaps windowrand  Ratio interp)
2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)
2.45 (disk-in num-channels rate bufnum)
2.46 (disk-out bufnum channels)
2.47 num-input-buses
2.48 num-control-buses
2.49 num-buffers
2.50 num-output-buses
2.51 (buf-frames rate bufnum)
2.52 (buf-rate-scale rate bufnum)
2.53 sample-dur
2.54 sample-rate
2.55 radians-per-sample
2.56 (buf-dur rate bufnum)
2.57 (buf-channels rate bufnum)
2.58 (buf-sample-rate rate bufnum)
2.59 num-audio-buses
2.60 num-running-synths
2.61 subsample-offset
2.62 (zero-crossing in)
2.63 (slope in)
2.64 (running-sum in numsamp)
2.65 (pitch in init  Freq min  Freq max  Freq exec  Freq max  Bins  Per  Octave
2.66 (compander input control thresh slope  Below slope  Above clamp  Time relax  Time)
2.67 (amplitude rate in attack  Time release  Time)
2.68 (pulse-divider trig div start)
2.69 (gate in trig)
2.70 (poll trig in trigid label)
2.71 (most-change a b)
2.72 (trig in dur)
2.73 (pulse-count trig reset)
2.74 (stepper trig reset min max step resetval)
2.75 (last-value in diff)
2.76 (peak-follower in decay)
2.77 (running-max in trig)
2.78 (trig1 in dur)
2.79 (phasor trig rate start end resetpos)
2.80 (schmidt in lo hi)
2.81 (peak trig reset)
2.82 (toggle-ff trig)
2.83 (sweep trig rate)
2.84 (send-trig in id value)
2.85 (in-range in lo hi)
2.86 (timer trig)
2.87 (t-delay trigger delay  Time)
2.88 (running-min in trig)
2.89 (set-reset-ff trig reset)
2.90 (saw rate freq)
2.91 (pm-osc rate carfreq modfreq index modphase)
2.92 (lf-tri rate freq iphase)
2.93 (t-grains num  Channels trigger bufnum rate center  Pos dur pan amp interp)
2.94 (tw-index in normalize array)
2.95 (osc-n rate bufnum freq phase)
2.96 (osc rate bufnum freq phase)
2.97 (lf-saw rate freq iphase)
2.98 (tw-choose trig array weights normalize)
2.99 gendy1
2.100 (pulse rate freq width)
2.101 (shaper bufnum in)
2.102 SC2:   Note extra iphase argument.
2.103 (v-osc rate bufpos freq phase)
2.104 (var-saw rate freq iphasewidth)
2.105 buf-wr
2.106 impulse
2.107 blip
2.108 (select which array)
2.109 formant
2.110 c-osc
2.111 (v-osc3 rate bufpos freq1 freq2 freq3)
2.112 (lf-cub rate freq iphase)
2.113 (lf-pulse rate freq iphase width)
2.114 index
2.115 See lf-cub.
2.116 (sync-saw rate sync  Freq saw  Freq)
2.117 (t-choose trig array)
2.118 (sin-osc rate freq phase)
2.119 (klang rate freq  Scale freq  Offset spec)
2.120 (lag-in num-channels bus lag)
2.121 (sound-in channel)
2.122 (in num-channels rate bus)
2.123 (in-trig num-channels bus)
2.124 (replace-out bufferindex inputs)
2.125 (local-in num-channels rate)
2.126 (offset-out bufferindex inputs)
2.127 (in-feedback num-channels bus)
2.128 (x-out buffer-index xfade inputs)
2.129 (out bufferindex inputs)
2.130 (mix UGen)
2.131 (mix-fill n f)
2.132 (latch in trig)
2.133 (decay in decay  Time)
2.134 (wrap-index bufnum in)
2.135 (mouse-y rate minval maxval warp lag)
2.136 (degree-to-key bufnum in octave)
2.137 (key-state rate keynum minval maxval lag)
2.138 (mrg2 left right)
2.139 (mouse-button rate minval maxval lag)
2.140 (slew in up dn)
2.141 (mouse-x rate minval maxval warp lag)
2.142 (decay2 in attack  Time decay  Time)
2.143 (k2a in)
2.144 (mul-add a b c)
2.145 (clip2 a b)
2.146 (Atan2 x y)
2.147 (trunc a b)
2.148 (sub a b)
2.149 (round-up a b)
2.150 (ring4 a b)
2.151 (pow a b)
2.152 (ring1 a b)
2.153 (gt a b)
2.154 (add a b)
2.155 (abs-dif a b)
2.156 (am-clip a b)
2.157 (ge a b)
2.158 (max a b)
2.159 (ring3 a b)
2.160 (thresh a b)
2.161 (dif-sqr a b)
2.162 (excess a b)
2.163 (fold2 a b)
2.164 (sqr-dif a b)
2.165 (hypot x y)
2.166 (sqr-sum a b)
2.167 (sum-sqr a b)
2.168 (le a b)
2.169 eq
2.170 (scale-neg a b)
2.171 (ring2 a b)
2.172 (Mod a b)
2.173 (fdiv a b)
2.174 (mul a b)
2.175 (min a b)
2.176 (lt a b)
2.177 (wrap2 a b)
2.178 (round a b)
2.179 (hasher in)
2.180 (rand-seed rate trig seed)
2.181 (lfd-noise0 rate freq)
2.182 (lfclip-noise rate freq)
2.183 See lf-noise0
2.184 (clip-noise rate)
2.185 (ti-rand lo hi trig)
2.186 (lf-noise0 rate freq)
2.187 (pink-noise rate)
2.188 (rand lo hi)
2.189 (gray-noise rate)
2.190 See lfd-noise0
2.191 (i-rand lo hi)
2.192 (n-rand lo hi n)
2.193 (lfdclip-noise rate freq)
2.194 (coin-gate prob in)
2.195 (t-exp-rand lo hi trig)
2.196 (t-rand lo hi trig)
2.197 (white-noise rate)
2.198 (dust2 rate density)
2.199 See lfd-noise0
2.200 (rand-id rate id)
2.201 See lf-noise0
2.202 (mantissa-mask in bits)
2.203 (dust rate density)
2.204 (lin-rand lo hi minmax)
2.205 (exp-rand lo hi)
2.206 (brown-noise rate)
2.207 (u:  log a)
2.208 (frac a)
2.209 (arc-tan a)
2.210 (distort a)
2.211 (tan-h a)
2.212 (u:  floor a)
2.213 (cps-oct a)
2.214 (db-amp a)
2.215 (u:  sqrt a)
2.216 (soft-clip a)
2.217 (cps-midi a)
2.218 (is-strictly-positive a)
2.219 (u:  tan a)
2.220 (cos-h a)
2.221 (amp-db a)
2.222 (abs a)
2.223 (log10 a)
2.224 (midi-cps a)
2.225 (is-positive a)
2.226 (sign a)
2.227 (neg a)
2.228 (log2 a)
2.229 (ceil a)
2.230 (arc-cos a)
2.231 (exp a)
2.232 (squared a)
2.233 (arc-sin a)
2.234 (cubed a)
2.235 (is-negative a)
2.236 (oct-cps a)
2.237 (u:  sin a)
2.238 (sin-h a)
2.239 (cos a)
2.240 (pv-mul buffer  A buffer  B)
2.241 (pv-mag-squared buffer)
2.242 (pv-min buffer  A buffer  B)
2.243 (pv-mag-noise buffer)
2.244 (pv-mag-below buffer threshold)
2.245 (convolution in kernel framesize)
2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)
2.247 (pv-phase-shift270 buffer)
2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)
2.249 (pv-phase-shift buffer shift)
2.250 (pv-copy buffer  A buffer  B)
2.251 (pv-brick-wall buffer wipe)
2.252 (pv-mag-smear buffer bins)
2.253 (pv-mag-above buffer threshold)
2.254 (pv-bin-shift buffer stretch shift)
2.255 (fft buffer in hop wintype active)
2.256 (pv-bin-wipe buffer  A buffer  B wipe)
2.257 (pv-copy  Phase buffer  A buffer  B)
2.258 (pv-phase-shift90 buffer)
2.259 (convolution2 in bufnum trigger framesize)
2.260 (pv-rect-comb2 buffer  A buffer  B num  Teeth phase width)
2.261 (pv-add buffer  A buffer  B)
2.262 (pv-rand-comb buffer wipe trig)
2.263 (pv-local-max buffer threshold)
2.264 (pv-mag-mul buffer  A buffer  B)
2.265 (pv-conformal-map buffer real imag)
2.266 (pv-diffuser buffer trig)
2.267 (pv-max buffer  A buffer  B)
2.268 (Ifft buffer wintype)
2.269 (pv-bin-scramble buffer wipe width trig)
2.270 (pv-rand-wipe buffer  A buffer  B wipe trig)
2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)
2.272 (pvcollect chain numframes func frombin tobin zeroothers)
2.273 (PV_  Magclip buffer threshold)
2.274 (PV_  Magfreeze buffer freeze)
2.275 (pv-rect-comb buffer num  Teeth phase width)
2.276 (pv-mag-shift buffer stretch shift)
2.277 See allpass-n
2.278 See comb-n
2.279 See Bufallpass-c
2.280 (free-verb in mix room damp)
2.281 See free  Verb
2.282 (play-buf num  Channels bufnum rate trigger start  Pos loop)
2.283 See buf-delay-c
2.284 (delay2 in)
2.285 (comb-n in max  Delay  Time delay  Time decay  Time)
2.286 See Bufallpass-c
2.287 (allpass-n in max  Delay  Time delay  Time decay  Time)
2.288 See comb-n
2.289 (buf-allpass-c buf in delaytime decaytime)
2.290 See allpass-n
2.291 See buf-delay-c
2.292 (buf-delay-c buf in delaytime)
2.293 (pluck in tr maxdelaytime delaytime decaytime coef)
2.294 (pitch-shift in win  Size pch  Ratio pch  Dispersion time  Dispersion)
2.295 See buf-comb-c
2.296 (buf-comb-c buf in delaytime decaytime)
2.297 (buf-rd num  Channels rate bufnum phase loop interpolation)
2.298 (delay1 in)
2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)
2.300 See delay-n
2.301 See buf-comb-c
2.302 See delay-n
2.303 (delay-n in max  Delay  Time delay  Time)
2.304 (ball in g damp friction)
2.305 (dswitch1 index array)
2.306 (t-duty rate duration reset done  Action level gap)
2.307 See dwhite
2.308 (dwhite length lo hi)
2.309 (dbufrd bufnum phase loop)
2.310 (demand-env-gen rate levels times shapes curves gate reset
2.311 (demand trig reset ugens)
2.312 (duty rate duration reset done  Action level)
2.313 (dser length array)
2.314 (dgeom length start grow)
2.315 (drand length array)
2.316 See drand
2.317 (dseries length start step)
2.318 (dswitch index array)
2.319 See dbrown
2.320 (dbrown length lo hi step)
2.321 (dseq length array)
2.322 See latoocarfian-c.
2.323 (fb-sine-c rate freq im fb a c xi yi)
2.324 See fb-sine-c
2.325 (quad-n rate freq a b c xi)
2.326 (lorenz-l rate freq s r b h xi yi zi)
2.327 See standard-l.
2.328 See quad-n
2.329 See cusp-n
2.330 See latoocarfian-c.
2.331 (logistic rate chaos  Param freq)
2.332 See fb-sine-c
2.333 (latoocarfian-c rate freq a b c d xi yi)
2.334 (rossler rate chaos  Param dt)
2.335 (standard-l rate freq k xi yi)
2.336 See quad-n
2.337 (cusp-n rate freq a b xi)
2.338 (lin-cong-c rate freq a c m xi)
2.339 (crackle rate chaos  Param)
2.340 (henon-n rate freq a b x0 x1)
2.341 See henon-n
2.342 See lin-cong-c.
2.343 See Gbman  L.
2.344 See Gbman  L.
2.345 See henon-n
2.346 See lin-cong-c.
2.347 (gbman-c rate freq xi yi)
2.348 (lin-pan2 in pos level)
2.349 (rotate2 x y pos)
2.350 (decode-b2 num  Channels w x y orientation)
2.351 (pan2 in pos level)
2.352 (pan-b2 in azimuth gain)
2.353 (detect-silence in amp time done  Action)
2.354 (line rate start end dur done  Action)
2.355 (free trig node  ID)
2.356 (pause-self-when-done src)
2.357 (pause-self src)
2.358 (env-gen rate gate level  Scale level  Bias time  Scale done  Action envelope)
2.359 (free-self-when-done src)
2.360 (pause gate node  ID)
2.361 (x-line rate start end dur done  Action)
2.362 (done src)
2.363 (linen gate attack  Time sus  Level release  Time done  Action)
2.364 (free-self src)
8.6

2 rsc3: ugens

    2.1 (Rlpf in freq rq)

    2.2 (fold in lo hi)

    2.3 (formlet in freq attackTime decayTime)

    2.4 (lin-lin in srclo srchi dstlo dsthi)

    2.5 (fos in a0 a1 b1)

    2.6 (bpf in freq rq)

    2.7 (wrap in lo hi)

    2.8 (bpz2 in)

    2.9 (amp-comp freq root exp)

    2.10 (lag2 in lagTime)

    2.11 (one-zero in coef)

    2.12 (klank in freqScale freqOffset decayScale spec)

    2.13 (lpz2 ar in)

    2.14 (lin-exp in srclo srchi dstlo dsthi)

    2.15 (hpz2 in)

    2.16 (leak-dc in coef)

    2.17 (hpf in freq)

    2.18 (sos in a0 a1 a2 b1 b2)

    2.19 (normalizer in level dur)

    2.20 (two-zero in freq radius)

    2.21 (clip in lo hi)

    2.22 (limiter input level lookAheadTime)

    2.23 (median length in)

    2.24 (lag3 in lagTime)

    2.25 (amp-compA freq root minAmp rootAmp)

    2.26 (two-pole in freq radius)

    2.27 (lpf in freq)

    2.28 (hpz1 in)

    2.29 (freq-shift input shift phase)

    2.30 (lpz1 ar in)

    2.31 (moog-ff in freq gain reset)

    2.32 (resonz in freq bwr)

    2.33 (brz2 in)

    2.34 (Rhpf in freq rq)

    2.35 (brf in freq rq)

    2.36 (one-pole in coef)

    2.37 (lag in lagTime)

    2.38 (ringz in freq decayTime)

    2.39 (dyn-klank in freqScale freqOffset decayScale spec)

    2.40 (Grainin nc tr dur in pan envbuf)

    2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

    2.42 (grain-sin nc tr dur freq pan envbuf)

    2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

    2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

    2.45 (disk-in num-channels rate bufnum)

    2.46 (disk-out bufnum channels)

    2.47 num-input-buses

    2.48 num-control-buses

    2.49 num-buffers

    2.50 num-output-buses

    2.51 (buf-frames rate bufnum)

    2.52 (buf-rate-scale rate bufnum)

    2.53 sample-dur

    2.54 sample-rate

    2.55 radians-per-sample

    2.56 (buf-dur rate bufnum)

    2.57 (buf-channels rate bufnum)

    2.58 (buf-sample-rate rate bufnum)

    2.59 num-audio-buses

    2.60 num-running-synths

    2.61 subsample-offset

    2.62 (zero-crossing in)

    2.63 (slope in)

    2.64 (running-sum in numsamp)

    2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

    2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

    2.67 (amplitude rate in attackTime releaseTime)

    2.68 (pulse-divider trig div start)

    2.69 (gate in trig)

    2.70 (poll trig in trigid label)

    2.71 (most-change a b)

    2.72 (trig in dur)

    2.73 (pulse-count trig reset)

    2.74 (stepper trig reset min max step resetval)

    2.75 (last-value in diff)

    2.76 (peak-follower in decay)

    2.77 (running-max in trig)

    2.78 (trig1 in dur)

    2.79 (phasor trig rate start end resetpos)

    2.80 (schmidt in lo hi)

    2.81 (peak trig reset)

    2.82 (toggle-ff trig)

    2.83 (sweep trig rate)

    2.84 (send-trig in id value)

    2.85 (in-range in lo hi)

    2.86 (timer trig)

    2.87 (t-delay trigger delayTime)

    2.88 (running-min in trig)

    2.89 (set-reset-ff trig reset)

    2.90 (saw rate freq)

    2.91 (pm-osc rate carfreq modfreq index modphase)

    2.92 (lf-tri rate freq iphase)

    2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

    2.94 (tw-index in normalize array)

    2.95 (osc-n rate bufnum freq phase)

    2.96 (osc rate bufnum freq phase)

    2.97 (lf-saw rate freq iphase)

    2.98 (tw-choose trig array weights normalize)

    2.99 gendy1

    2.100 (pulse rate freq width)

    2.101 (shaper bufnum in)

    2.102 SC2: Note extra iphase argument.

    2.103 (v-osc rate bufpos freq phase)

    2.104 (var-saw rate freq iphasewidth)

    2.105 buf-wr

    2.106 impulse

    2.107 blip

    2.108 (select which array)

    2.109 formant

    2.110 c-osc

    2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

    2.112 (lf-cub rate freq iphase)

    2.113 (lf-pulse rate freq iphase width)

    2.114 index

    2.115 See lf-cub.

    2.116 (sync-saw rate syncFreq sawFreq)

    2.117 (t-choose trig array)

    2.118 (sin-osc rate freq phase)

    2.119 (klang rate freqScale freqOffset spec)

    2.120 (lag-in num-channels bus lag)

    2.121 (sound-in channel)

    2.122 (in num-channels rate bus)

    2.123 (in-trig num-channels bus)

    2.124 (replace-out bufferindex inputs)

    2.125 (local-in num-channels rate)

    2.126 (offset-out bufferindex inputs)

    2.127 (in-feedback num-channels bus)

    2.128 (x-out buffer-index xfade inputs)

    2.129 (out bufferindex inputs)

    2.130 (mix UGen)

    2.131 (mix-fill n f)

    2.132 (latch in trig)

    2.133 (decay in decayTime)

    2.134 (wrap-index bufnum in)

    2.135 (mouse-y rate minval maxval warp lag)

    2.136 (degree-to-key bufnum in octave)

    2.137 (key-state rate keynum minval maxval lag)

    2.138 (mrg2 left right)

    2.139 (mouse-button rate minval maxval lag)

    2.140 (slew in up dn)

    2.141 (mouse-x rate minval maxval warp lag)

    2.142 (decay2 in attackTime decayTime)

    2.143 (k2a in)

    2.144 (mul-add a b c)

    2.145 (clip2 a b)

    2.146 (Atan2 x y)

    2.147 (trunc a b)

    2.148 (sub a b)

    2.149 (round-up a b)

    2.150 (ring4 a b)

    2.151 (pow a b)

    2.152 (ring1 a b)

    2.153 (gt a b)

    2.154 (add a b)

    2.155 (abs-dif a b)

    2.156 (am-clip a b)

    2.157 (ge a b)

    2.158 (max a b)

    2.159 (ring3 a b)

    2.160 (thresh a b)

    2.161 (dif-sqr a b)

    2.162 (excess a b)

    2.163 (fold2 a b)

    2.164 (sqr-dif a b)

    2.165 (hypot x y)

    2.166 (sqr-sum a b)

    2.167 (sum-sqr a b)

    2.168 (le a b)

    2.169 eq

    2.170 (scale-neg a b)

    2.171 (ring2 a b)

    2.172 (Mod a b)

    2.173 (fdiv a b)

    2.174 (mul a b)

    2.175 (min a b)

    2.176 (lt a b)

    2.177 (wrap2 a b)

    2.178 (round a b)

    2.179 (hasher in)

    2.180 (rand-seed rate trig seed)

    2.181 (lfd-noise0 rate freq)

    2.182 (lfclip-noise rate freq)

    2.183 See lf-noise0

    2.184 (clip-noise rate)

    2.185 (ti-rand lo hi trig)

    2.186 (lf-noise0 rate freq)

    2.187 (pink-noise rate)

    2.188 (rand lo hi)

    2.189 (gray-noise rate)

    2.190 See lfd-noise0

    2.191 (i-rand lo hi)

    2.192 (n-rand lo hi n)

    2.193 (lfdclip-noise rate freq)

    2.194 (coin-gate prob in)

    2.195 (t-exp-rand lo hi trig)

    2.196 (t-rand lo hi trig)

    2.197 (white-noise rate)

    2.198 (dust2 rate density)

    2.199 See lfd-noise0

    2.200 (rand-id rate id)

    2.201 See lf-noise0

    2.202 (mantissa-mask in bits)

    2.203 (dust rate density)

    2.204 (lin-rand lo hi minmax)

    2.205 (exp-rand lo hi)

    2.206 (brown-noise rate)

    2.207 (u:log a)

    2.208 (frac a)

    2.209 (arc-tan a)

    2.210 (distort a)

    2.211 (tan-h a)

    2.212 (u:floor a)

    2.213 (cps-oct a)

    2.214 (db-amp a)

    2.215 (u:sqrt a)

    2.216 (soft-clip a)

    2.217 (cps-midi a)

    2.218 (is-strictly-positive a)

    2.219 (u:tan a)

    2.220 (cos-h a)

    2.221 (amp-db a)

    2.222 (abs a)

    2.223 (log10 a)

    2.224 (midi-cps a)

    2.225 (is-positive a)

    2.226 (sign a)

    2.227 (neg a)

    2.228 (log2 a)

    2.229 (ceil a)

    2.230 (arc-cos a)

    2.231 (exp a)

    2.232 (squared a)

    2.233 (arc-sin a)

    2.234 (cubed a)

    2.235 (is-negative a)

    2.236 (oct-cps a)

    2.237 (u:sin a)

    2.238 (sin-h a)

    2.239 (cos a)

    2.240 (pv-mul bufferA bufferB)

    2.241 (pv-mag-squared buffer)

    2.242 (pv-min bufferA bufferB)

    2.243 (pv-mag-noise buffer)

    2.244 (pv-mag-below buffer threshold)

    2.245 (convolution in kernel framesize)

    2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)

    2.247 (pv-phase-shift270 buffer)

    2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

    2.249 (pv-phase-shift buffer shift)

    2.250 (pv-copy bufferA bufferB)

    2.251 (pv-brick-wall buffer wipe)

    2.252 (pv-mag-smear buffer bins)

    2.253 (pv-mag-above buffer threshold)

    2.254 (pv-bin-shift buffer stretch shift)

    2.255 (fft buffer in hop wintype active)

    2.256 (pv-bin-wipe bufferA bufferB wipe)

    2.257 (pv-copyPhase bufferA bufferB)

    2.258 (pv-phase-shift90 buffer)

    2.259 (convolution2 in bufnum trigger framesize)

    2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

    2.261 (pv-add bufferA bufferB)

    2.262 (pv-rand-comb buffer wipe trig)

    2.263 (pv-local-max buffer threshold)

    2.264 (pv-mag-mul bufferA bufferB)

    2.265 (pv-conformal-map buffer real imag)

    2.266 (pv-diffuser buffer trig)

    2.267 (pv-max bufferA bufferB)

    2.268 (Ifft buffer wintype)

    2.269 (pv-bin-scramble buffer wipe width trig)

    2.270 (pv-rand-wipe bufferA bufferB wipe trig)

    2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

    2.272 (pvcollect chain numframes func frombin tobin zeroothers)

    2.273 (PV_Magclip buffer threshold)

    2.274 (PV_Magfreeze buffer freeze)

    2.275 (pv-rect-comb buffer numTeeth phase width)

    2.276 (pv-mag-shift buffer stretch shift)

    2.277 See allpass-n

    2.278 See comb-n

    2.279 See Bufallpass-c

    2.280 (free-verb in mix room damp)

    2.281 See freeVerb

    2.282 (play-buf numChannels bufnum rate trigger startPos loop)

    2.283 See buf-delay-c

    2.284 (delay2 in)

    2.285 (comb-n in maxDelayTime delayTime decayTime)

    2.286 See Bufallpass-c

    2.287 (allpass-n in maxDelayTime delayTime decayTime)

    2.288 See comb-n

    2.289 (buf-allpass-c buf in delaytime decaytime)

    2.290 See allpass-n

    2.291 See buf-delay-c

    2.292 (buf-delay-c buf in delaytime)

    2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

    2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

    2.295 See buf-comb-c

    2.296 (buf-comb-c buf in delaytime decaytime)

    2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

    2.298 (delay1 in)

    2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

    2.300 See delay-n

    2.301 See buf-comb-c

    2.302 See delay-n

    2.303 (delay-n in maxDelayTime delayTime)

    2.304 (ball in g damp friction)

    2.305 (dswitch1 index array)

    2.306 (t-duty rate duration reset doneAction level gap)

    2.307 See dwhite

    2.308 (dwhite length lo hi)

    2.309 (dbufrd bufnum phase loop)

    2.310 (demand-env-gen rate levels times shapes curves gate reset

    2.311 (demand trig reset ugens)

    2.312 (duty rate duration reset doneAction level)

    2.313 (dser length array)

    2.314 (dgeom length start grow)

    2.315 (drand length array)

    2.316 See drand

    2.317 (dseries length start step)

    2.318 (dswitch index array)

    2.319 See dbrown

    2.320 (dbrown length lo hi step)

    2.321 (dseq length array)

    2.322 See latoocarfian-c.

    2.323 (fb-sine-c rate freq im fb a c xi yi)

    2.324 See fb-sine-c

    2.325 (quad-n rate freq a b c xi)

    2.326 (lorenz-l rate freq s r b h xi yi zi)

    2.327 See standard-l.

    2.328 See quad-n

    2.329 See cusp-n

    2.330 See latoocarfian-c.

    2.331 (logistic rate chaosParam freq)

    2.332 See fb-sine-c

    2.333 (latoocarfian-c rate freq a b c d xi yi)

    2.334 (rossler rate chaosParam dt)

    2.335 (standard-l rate freq k xi yi)

    2.336 See quad-n

    2.337 (cusp-n rate freq a b xi)

    2.338 (lin-cong-c rate freq a c m xi)

    2.339 (crackle rate chaosParam)

    2.340 (henon-n rate freq a b x0 x1)

    2.341 See henon-n

    2.342 See lin-cong-c.

    2.343 See GbmanL.

    2.344 See GbmanL.

    2.345 See henon-n

    2.346 See lin-cong-c.

    2.347 (gbman-c rate freq xi yi)

    2.348 (lin-pan2 in pos level)

    2.349 (rotate2 x y pos)

    2.350 (decode-b2 numChannels w x y orientation)

    2.351 (pan2 in pos level)

    2.352 (pan-b2 in azimuth gain)

    2.353 (detect-silence in amp time doneAction)

    2.354 (line rate start end dur doneAction)

    2.355 (free trig nodeID)

    2.356 (pause-self-when-done src)

    2.357 (pause-self src)

    2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

    2.359 (free-self-when-done src)

    2.360 (pause gate nodeID)

    2.361 (x-line rate start end dur doneAction)

    2.362 (done src)

    2.363 (linen gate attackTime susLevel releaseTime doneAction)

    2.364 (free-self src)

filters

granular

disk-io

information

analysis

triggers

oscillators

io

composite

controls

ternary-ops

binary-ops

noise

unary-ops

fft

delays

physical-models

demand

chaos

panners

envelopes

2.1 (Rlpf in freq rq)

A resonant low pass filter.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth))
       (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000)))
  (audition
   (out 0 (rlpf (mul (saw ar 200) 0.1) f2 0.2))))

2.2 (fold in lo hi)

fold a signal outside given thresholds.

This differs from the BinaryOpUGen fold2 in that it allows one to set both low and high thresholds.

in - signal to be foldped lo - low threshold of foldping -hi - high threshold of foldping

(let ((o (mul (sin-osc ar 440 0) 0.2)) - (l (rand -0.175 -0.025)) - (r (rand 0.025 0.175))) - (audition (out 0 (fold o l r))))

lo and hi are i-rate only.

(let ((o (mul (sin-osc ar 440 0) 0.2)) - (x (mouse-x kr -0.175 -0.025 1 0.1)) - (y (mouse-y kr 0.025 0.175 1 0.1))) - (audition (out 0 (fold o x y))))

2.3 (formlet in freq attackTime decayTime)

FOF-like filter

(let ((i (impulse ar 20 0.5))) - (audition (out 0 (formlet i 1000 0.01 0.1))))

(let* ((f (x-line kr 10 400 8 remove-synth)) - (i (mul (blip ar f 1000) 0.1))) - (audition (out 0 (formlet i 1000 0.01 0.1))))

Modulating formant frequency.

(let ((i (mul (blip ar (mul-add (sin-osc kr 5 0) 20 300) 1000) 0.1)) - (f (x-line kr 1500 700 8 remove-synth))) - (audition (out 0 (formlet i f 0.005 0.04))))

2.4 (lin-lin in srclo srchi dstlo dsthi)

Map a linear range to another linear range.

in - input to convert - kr, ar +hi - high threshold of foldping

(let ((o (mul (sin-osc ar 440 0) 0.2))
      (l (rand -0.175 -0.025))
      (r (rand 0.025 0.175)))
  (audition (out 0 (fold o l r))))

lo and hi are i-rate only.

(let ((o (mul (sin-osc ar 440 0) 0.2))
      (x (mouse-x kr -0.175 -0.025 1 0.1))
      (y (mouse-y kr 0.025 0.175 1 0.1)))
  (audition (out 0 (fold o x y))))

2.3 (formlet in freq attackTime decayTime)

FOF-like filter

(let ((i (impulse ar 20 0.5)))
  (audition (out 0 (formlet i 1000 0.01 0.1))))
(let* ((f (x-line kr 10 400 8 remove-synth))
       (i (mul (blip ar f 1000) 0.1)))
  (audition (out 0 (formlet i 1000 0.01 0.1))))

Modulating formant frequency.

(let ((i (mul (blip ar (mul-add (sin-osc kr 5 0) 20 300) 1000) 0.1))
      (f (x-line kr 1500 700 8 remove-synth)))
  (audition (out 0 (formlet i f 0.005 0.04))))

2.4 (lin-lin in srclo srchi dstlo dsthi)

Map a linear range to another linear range.

in - input to convert - kr, ar srclo - lower limit of input range - ir srchi - upper limit of input range - ir dstlo - lower limit of output range - ir -dsthi - upper limit of output range - ir

(audition - (out 0 (mul (sin-osc ar (lin-lin (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0) - (lin-lin (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25))))

2.5 (fos in a0 a1 b1)

First order filter section.

Same as one-pole.

(let ((x (mul (lf-tri ar 0.4 0) 0.99)) - (i (mul (lf-saw ar 200 0) 0.2))) - (audition (out 0 (fos i (sub 1 (u:abs x)) 0 x))))

Same as one-zero

(let ((x (mul (lf-tri ar 0.4 0) 0.99)) - (i (mul (lf-saw ar 200 0) 0.2))) - (audition (out 0 (fos i (sub 1 (u:abs x)) x 0))))

2.6 (bpf in freq rq)

Second order Butterworth bandpass filter

in - input signal to be processed +dsthi - upper limit of output range - ir

(audition
 (out 0 (mul (sin-osc ar (lin-lin (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0)
             (lin-lin (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25))))

2.5 (fos in a0 a1 b1)

First order filter section.

Same as one-pole.

(let ((x (mul (lf-tri ar 0.4 0) 0.99))
      (i (mul (lf-saw ar 200 0) 0.2)))
  (audition (out 0 (fos i (sub 1 (u:abs x)) 0 x))))

Same as one-zero

(let ((x (mul (lf-tri ar 0.4 0) 0.99))
      (i (mul (lf-saw ar 200 0) 0.2)))
  (audition (out 0 (fos i (sub 1 (u:abs x)) x 0))))

2.6 (bpf in freq rq)

Second order Butterworth bandpass filter

in - input signal to be processed freq - cutoff frequency in Hertz. -rq - the reciprocal of Q. bandwidth / cutoffFreq.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth)) - (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) - (audition (out 0 (bpf (mul (saw ar 200) 0.25) f2 0.3))))

(let* ((f1 (mouse-x kr 220 440 0 0.1)) - (f2 (mce2 f1 (sub 550 f1))) - (rq (mouse-y kr 0 0.01 0 0.1))) - (audition (out 0 (bpf (white-noise ar) f2 rq))))

2.7 (wrap in lo hi)

wrap a signal outside given thresholds.

This differs from the BinaryOpUGen wrap2 in that it allows one to +rq - the reciprocal of Q. bandwidth / cutoffFreq.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth))
       (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000)))
  (audition (out 0 (bpf (mul (saw ar 200) 0.25) f2 0.3))))
(let* ((f1 (mouse-x kr 220 440 0 0.1))
       (f2 (mce2 f1 (sub 550 f1)))
       (rq (mouse-y kr 0 0.01 0 0.1)))
  (audition (out 0 (bpf (white-noise ar) f2 rq))))

2.7 (wrap in lo hi)

wrap a signal outside given thresholds.

This differs from the BinaryOpUGen wrap2 in that it allows one to set both low and high thresholds.

in - signal to be wrapped lo - low threshold of wrapping -hi - high threshold of wrapping

(let ((o (mul (sin-osc ar 440 0) 0.2)) - (l (rand -0.175 -0.025)) - (r (rand 0.025 0.175))) - (audition (out 0 (wrap o l r))))

lo and hi are i-rate only.

(let ((o (mul (sin-osc ar 440 0) 0.2)) - (x (mouse-x kr -0.175 -0.025 1 0.1)) - (y (mouse-y kr 0.025 0.175 1 0.1))) - (audition (out 0 (wrap o x y))))

2.8 (bpz2 in)

Two zero fixed midpass. This filter cuts out 0 Hz and the Nyquist -frequency.

(audition (out 0 (bpz2 (mul (white-noise ar) 0.25))))

2.9 (amp-comp freq root exp)

Basic psychoacoustic amplitude compensation.

Implements the (optimized) formula: compensationFactor = (root / +hi - high threshold of wrapping

(let ((o (mul (sin-osc ar 440 0) 0.2))
      (l (rand -0.175 -0.025))
      (r (rand 0.025 0.175)))
  (audition (out 0 (wrap o l r))))

lo and hi are i-rate only.

(let ((o (mul (sin-osc ar 440 0) 0.2))
      (x (mouse-x kr -0.175 -0.025 1 0.1))
      (y (mouse-y kr 0.025 0.175 1 0.1)))
  (audition (out 0 (wrap o x y))))

2.8 (bpz2 in)

Two zero fixed midpass. This filter cuts out 0 Hz and the Nyquist +frequency.

(audition (out 0 (bpz2 (mul (white-noise ar) 0.25))))

2.9 (amp-comp freq root exp)

Basic psychoacoustic amplitude compensation.

Implements the (optimized) formula: compensationFactor = (root / freq) ** exp. Higher frequencies are normally perceived as louder, which amp-comp compensates.

See also amp-compA

freq - input frequency value. For freq == root, the output is 1.0.

root - root freq relative to which the curve is calculated (usually lowest freq) default value: C (60.midicps)

exp - exponent. how steep the curve decreases for increasing freq (see plots below). default value 0.3333

Note that for frequencies very much smaller than root the amplitudes can become very high. in this case limit the freq with freq.max(minval), or use amp-compA.

compare a sine without compensation with one that uses amplitude -compensation

(let* ((x (mouse-x kr 300 15000 1 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (o (mul (sin-osc ar x 0) 0.1)) - (c (amp-comp x 300 0.333))) - (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

different sounds cause quite different loudness perception, and the -desired musical behavior can vary, so the exponent can be tuned:

(let* ((x (mouse-x kr 300 15000 1 0.1)) - (o (mul (pulse ar x 0.5) 0.1)) - (c (amp-comp x 300 1.3))) - (audition (out 0 (mul o c))))

amplitude compensation in frequency modulation

(let* ((x (mouse-x kr 300 15000 1 0.1)) - (y (mouse-y kr 3 200 1 0.1)) - (m (mul x (mul-add (sin-osc ar y 0) 0.5 1))) - (a (amp-comp m 300 0.333)) - (c (mul3 (sin-osc ar m 0) 0.1 a))) - (audition (out 0 c)))

2.10 (lag2 in lagTime)

lag2 is the same as (lag kr (Lag kr in time) time).

(let* ((x (mouse-x kr 220 440 0 0.1)) - (f (mce2 x (lag2 x 1)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.11 (one-zero in coef)

One zero filter

(audition - (out 0 (one-zero (mul (white-noise ar) 0.5) 0.5)))

(audition - (out 0 (one-zero (mul (white-noise ar) 0.5) -0.5)))

(audition - (out 0 (one-zero (mul (white-noise ar) 0.5) - (line kr -0.5 0.5 10 remove-synth))))

2.12 (klank in freqScale freqOffset decayScale spec)

klank is a bank of fixed frequency resonators which can be used to +compensation

(let* ((x (mouse-x kr 300 15000 1 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (o (mul (sin-osc ar x 0) 0.1))
       (c (amp-comp x 300 0.333)))
  (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

different sounds cause quite different loudness perception, and the +desired musical behavior can vary, so the exponent can be tuned:

(let* ((x (mouse-x kr 300 15000 1 0.1))
       (o (mul (pulse ar x 0.5) 0.1))
       (c (amp-comp x 300 1.3)))
  (audition (out 0 (mul o c))))

amplitude compensation in frequency modulation

(let* ((x (mouse-x kr 300 15000 1 0.1))
       (y (mouse-y kr 3 200 1 0.1))
       (m (mul x (mul-add (sin-osc ar y 0) 0.5 1)))
       (a (amp-comp m 300 0.333))
       (c (mul3 (sin-osc ar m 0) 0.1 a)))
  (audition (out 0 c)))

2.10 (lag2 in lagTime)

lag2 is the same as (lag kr (Lag kr in time) time).

(let* ((x (mouse-x kr 220 440 0 0.1))
       (f (mce2 x (lag2 x 1))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.11 (one-zero in coef)

One zero filter

(audition
 (out 0 (one-zero (mul (white-noise ar) 0.5) 0.5)))
(audition
 (out 0 (one-zero (mul (white-noise ar) 0.5) -0.5)))
(audition
 (out 0 (one-zero (mul (white-noise ar) 0.5)
                  (line kr -0.5 0.5 10 remove-synth))))

2.12 (klank in freqScale freqOffset decayScale spec)

klank is a bank of fixed frequency resonators which can be used to simulate the resonant modes of an object. Each mode is given a ring time, which is the time for the mode to decay by 60 dB.

The UGen assistant klank-data can help create the ’spec’ entry. Note that the SC3 language reorders the inputs, the RSC client does not.

input - the excitation input to the resonant filter bank.

freqscale - a scale factor multiplied by all frequencies at initialization time.

freqoffset - an offset added to all frequencies at initialization time.

decayscale - a scale factor multiplied by all ring times at - initialization time.

(let ((i (mul (impulse ar 2 0) 0.1)) - (d (klank-data ’(800 1071 1153 1723) - (replicate 5 1) - (replicate 5 1)))) - (audition (out 0 (klank i 1 0 1 d))))

(let ((i (mul (dust ar 8) 0.1)) - (d (klank-data ’(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) - (audition (out 0 (klank i 1 0 1 d))))

(let ((i (mul (pink-noise ar) 0.007)) - (d (klank-data ’(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) - (audition (out 0 (klank i 1 0 1 d))))

(let ((i (mul (pink-noise ar) (mce2 0.007 0.007))) - (d (klank-data ’(200 671 1153 1723) - (replicate 4 1) - (replicate 4 1)))) - (audition (out 0 (klank i 1 0 1 d))))

(let ((i (mul (decay (impulse ar 4 0) 0.03) (mul (clip-noise ar) 0.01))) - (d (klank-data (replicate-m 12 (rand 800 4000)) - (replicate 12 1) - (replicate-m 12 (rand 0.1 2))))) - (audition (out 0 (klank i 1 0 1 d))))

2.13 (lpz2 ar in)

Two zero fixed lowpass filter

(audition - (out 0 (lpz2 (mul (white-noise ar) 0.25))))

2.14 (lin-exp in srclo srchi dstlo dsthi)

Map a linear range to an exponential range.

in - input to convert - kr, ar + initialization time.

(let ((i (mul (impulse ar 2 0) 0.1))
      (d (klank-data '(800 1071 1153 1723)
                     (replicate 5 1)
                     (replicate 5 1))))
  (audition (out 0 (klank i 1 0 1 d))))
(let ((i (mul (dust ar 8) 0.1))
      (d (klank-data '(800 1071 1353 1723)
                     (replicate 4 1)
                     (replicate 4 1))))
  (audition (out 0 (klank i 1 0 1 d))))
(let ((i (mul (pink-noise ar) 0.007))
      (d (klank-data '(800 1071 1353 1723)
                     (replicate 4 1)
                     (replicate 4 1))))
  (audition (out 0 (klank i 1 0 1 d))))
(let ((i (mul (pink-noise ar) (mce2 0.007 0.007)))
      (d (klank-data '(200 671 1153 1723)
                     (replicate 4 1)
                     (replicate 4 1))))
  (audition (out 0 (klank i 1 0 1 d))))
(let ((i (mul (decay (impulse ar 4 0) 0.03) (mul (clip-noise ar) 0.01)))
      (d (klank-data (replicate-m 12 (rand 800 4000))
                     (replicate 12 1)
                     (replicate-m 12 (rand 0.1 2)))))
  (audition (out 0 (klank i 1 0 1 d))))

2.13 (lpz2 ar in)

Two zero fixed lowpass filter

(audition
 (out 0 (lpz2 (mul (white-noise ar) 0.25))))

2.14 (lin-exp in srclo srchi dstlo dsthi)

Map a linear range to an exponential range.

in - input to convert - kr, ar srclo - lower limit of input range - ir srchi - upper limit of input range - ir dstlo - lower limit of output range - ir -dsthi - upper limit of output range - ir

(audition - (out 0 (mul (sin-osc ar (lin-exp (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0) - (lin-exp (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25))))

2.15 (hpz2 in)

Two zero fixed highpass filter.

(audition (out 0 (hpz2 (mul (white-noise ar) 0.25))))

2.16 (leak-dc in coef)

Remove DC. This filter removes a DC offset from a signal.

in - input signal -coef - leak coefficient

(let ((a (mul (lf-pulse ar 800 0.5 0.5) 0.1))) - (audition (out 0 (mce2 a (leak-dc a 0.995)))))

2.17 (hpf in freq)

Second order Butterworth highpass filter.

(let* ((i (mul (saw ar 200) 0.1)) - (f1 (x-line kr 0.7 300 20 do-nothing)) - (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) - (audition (out 0 (mul (hpf i f2) 5))))

2.18 (sos in a0 a1 a2 b1 b2)

Second order filter section (biquad). A standard second order +dsthi - upper limit of output range - ir

(audition
 (out 0 (mul (sin-osc ar (lin-exp (mouse-x kr 0 1 0 0.1) 0 1 440 660) 0)
             (lin-exp (mouse-y kr 0 1 0 0.1) 0 1 0.01 0.25))))

2.15 (hpz2 in)

Two zero fixed highpass filter.

(audition (out 0 (hpz2 (mul (white-noise ar) 0.25))))

2.16 (leak-dc in coef)

Remove DC. This filter removes a DC offset from a signal.

in - input signal +coef - leak coefficient

(let ((a (mul (lf-pulse ar 800 0.5 0.5) 0.1)))
  (audition (out 0 (mce2 a (leak-dc a 0.995)))))

2.17 (hpf in freq)

Second order Butterworth highpass filter.

(let* ((i (mul (saw ar 200) 0.1))
       (f1 (x-line kr 0.7 300 20 do-nothing))
       (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000)))
  (audition (out 0 (mul (hpf i f2) 5))))

2.18 (sos in a0 a1 a2 b1 b2)

Second order filter section (biquad). A standard second order filter section. Filter coefficients are given directly rather than -calculated for you.

Same as two-pole

(let* ((theta (line kr (* 0.2 pi) pi 5 remove-synth)) - (rho (line kr 0.6 0.99 5 remove-synth)) - (b1 (mul 2 (mul rho (u:cos theta)))) - (b2 (neg (squared rho)))) - (audition (out 0 (sos (lf-saw ar 200 0.1) 1 0 0 b1 b2))))

2.19 (normalizer in level dur)

Flattens dynamics.

(let ((z (mul (decay2 (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7)) - 0.001 - 0.3) - (f-sin-osc ar 500 0)))) - (audition (out 0 (mce2 z (normalizer z 0.4 0.01)))))

2.20 (two-zero in freq radius)

Two zero filter

(audition - (out 0 (two-zero (mul (white-noise ar) 0.125) - (x-line kr 20 20000 8 remove-synth) - 1)))

2.21 (clip in lo hi)

clip ‘in’ to lie between ‘lo’ and ‘hi’, which are i-rate inputs.

(audition (out 0 (clip (mul (sin-osc ar 440 0) 0.4) -0.25 0.25)))

2.22 (limiter input level lookAheadTime)

peak limiter. Limits the input amplitude to the given +calculated for you.

Same as two-pole

(let* ((theta (line kr (* 0.2 pi) pi 5 remove-synth))
       (rho (line kr 0.6 0.99 5 remove-synth))
       (b1 (mul 2 (mul rho (u:cos theta))))
       (b2 (neg (squared rho))))
  (audition (out 0 (sos (lf-saw ar 200 0.1) 1 0 0 b1 b2))))

2.19 (normalizer in level dur)

Flattens dynamics.

(let ((z (mul (decay2 (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7))
                      0.001
                      0.3)
              (f-sin-osc ar 500 0))))
  (audition (out 0 (mce2 z (normalizer z 0.4 0.01)))))

2.20 (two-zero in freq radius)

Two zero filter

(audition
 (out 0 (two-zero (mul (white-noise ar) 0.125)
                  (x-line kr 20 20000 8 remove-synth)
                  1)))

2.21 (clip in lo hi)

clip ‘in’ to lie between ‘lo’ and ‘hi’, which are i-rate inputs.

(audition (out 0 (clip (mul (sin-osc ar 440 0) 0.4) -0.25 0.25)))

2.22 (limiter input level lookAheadTime)

peak limiter. Limits the input amplitude to the given level. limiter will not overshoot like compander will, but it needs to look ahead in the audio. Thus there is a delay equal to twice the lookAheadTime. limiter, unlike compander, is completely -transparent for an in range signal.

(let* ((t (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7))) - (i (mul (decay2 t 0.001 0.3) (f-sin-osc ar 500 0)))) - (audition (out 0 (mce2 (mul i 0.1) (limiter i 0.2 0.01)))))

2.23 (median length in)

median filter.

Signal with impulse noise.

(audition - (out 0 (median 3 (add (mul (saw ar 500) 0.1) (mul (dust2 ar 100) 0.9)))))

The median length can be increased for longer duration noise.

(audition - (out 0 (median 5 (add (mul (saw ar 500) 0.1) (lpz1 (mul (dust2 ar 100) 0.9))))))

Long median filters begin chopping off the peaks of the waveform

(audition - (out 0 (let ((x (mul (sin-osc ar 1000 0) 0.2))) - (mce2 x (median 31 x)))))

Another noise reduction application. Use median filter for high -frequency noise. Use leak-dc for low frequency noise.

(audition - (out 0 (let* ((s0 (mul-add (white-noise ar) 0.1 (mul (sin-osc ar 800 0) 0.1))) - (s1 (median 31 s0))) - (leak-dc s1 0.9))))

2.24 (lag3 in lagTime)

lag3 is the same as (lag (Lag (Lag in time) time) time).

(let* ((x (mouse-x kr 220 440 0 0.1)) - (f (mce2 x (lag3 x 1)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.25 (amp-compA freq root minAmp rootAmp)

ANSI A-weighting curve.

Basic psychoacoustic amplitude compensation

Higher frequencies are normally perceived as louder, which amp-compA +transparent for an in range signal.

(let* ((t (impulse ar 8 (mul (lf-saw kr 0.25 -0.6) 0.7)))
       (i (mul (decay2 t 0.001 0.3) (f-sin-osc ar 500 0))))
  (audition (out 0 (mce2 (mul i 0.1) (limiter i 0.2 0.01)))))

2.23 (median length in)

median filter.

Signal with impulse noise.

(audition
 (out 0 (median 3 (add (mul (saw ar 500) 0.1) (mul (dust2 ar 100) 0.9)))))

The median length can be increased for longer duration noise.

(audition
 (out 0 (median 5 (add (mul (saw ar 500) 0.1) (lpz1 (mul (dust2 ar 100) 0.9))))))

Long median filters begin chopping off the peaks of the waveform

(audition
 (out 0 (let ((x (mul (sin-osc ar 1000 0) 0.2)))
          (mce2 x (median 31 x)))))

Another noise reduction application. Use median filter for high +frequency noise. Use leak-dc for low frequency noise.

(audition
 (out 0 (let* ((s0 (mul-add (white-noise ar) 0.1 (mul (sin-osc ar 800 0) 0.1)))
               (s1 (median 31 s0)))
          (leak-dc s1 0.9))))

2.24 (lag3 in lagTime)

lag3 is the same as (lag (Lag (Lag in time) time) time).

(let* ((x (mouse-x kr 220 440 0 0.1))
       (f (mce2 x (lag3 x 1))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.25 (amp-compA freq root minAmp rootAmp)

ANSI A-weighting curve.

Basic psychoacoustic amplitude compensation

Higher frequencies are normally perceived as louder, which amp-compA compensates. Following the measurings by Fletcher and Munson, the ANSI standard describes a function for loudness vs. frequency. Note that this curve is only valid for standardized amplitude. @@ -713,48 +48,16 @@ For a simpler but more flexible curve, see amp-comp.

freq - input frequenc lowest freq) (default 0 Hz) default value: C (60.midicps)

minAmp - amplitude at the minimum point of the curve (around 2512 Hz) (default -10dB)

rootAmp - amplitude at the root frequency. (default 1) apart from freq, the values are not modulatable

compare a sine without compensation with one that uses amplitude -compensation

(let* ((x (mouse-x kr 300 15000 1 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (o (mul (sin-osc ar x 0) 0.1)) - (c (amp-comp-a x 300 (db-amp -10) 1))) - (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

adjust the minimum and root amp (in this way one can flatten out -the curve for higher amplitudes)

(let* ((x (mouse-x kr 300 18000 1 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (o (mul (formant ar 300 x 20) 0.1)) - (c (amp-comp-a x 300 0.6 0.3))) - (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

amplitude compensation in frequency modulation (using -Fletscher-Munson curve)

(let* ((x (mouse-x kr 300 15000 1 0.1)) - (y (mouse-y kr 3 200 1 0.1)) - (m (mul x (mul-add (sin-osc ar y 0) 0.5 1))) - (a (amp-comp-a m 300 (db-amp -10) 1)) - (c (mul3 (sin-osc ar m 0) 0.1 a))) - (audition (out 0 c)))

2.26 (two-pole in freq radius)

Two pole filter. This provides lower level access to setting of -pole location. For general purposes resonz is better.

(audition - (out 0 (two-pole (mul (white-noise ar) 0.005) 2000 0.95)))

(audition - (out 0 (two-pole (mul (white-noise ar) 0.005) - (x-line kr 800 8000 8 remove-synth) - 0.95)))

2.27 (lpf in freq)

Second order Butterworth lowpass filter.

(audition - (let ((f (x-line kr 0.7 300 20 remove-synth))) - (out 0 (lpf (mul (saw ar 200) 0.1) - (mul-add (f-sin-osc kr f 0) 3600 4000)))))

2.28 (hpz1 in)

Two point difference filter.

(audition (out 0 (hpz1 (mul (white-noise ar) 0.25))))

2.29 (freq-shift input shift phase)

freq-shift implements single sideband amplitude modulation, also +compensation

(let* ((x (mouse-x kr 300 15000 1 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (o (mul (sin-osc ar x 0) 0.1))
       (c (amp-comp-a x 300 (db-amp -10) 1)))
  (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

adjust the minimum and root amp (in this way one can flatten out +the curve for higher amplitudes)

(let* ((x (mouse-x kr 300 18000 1 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (o (mul (formant ar 300 x 20) 0.1))
       (c (amp-comp-a x 300 0.6 0.3)))
  (audition (out 0 (mce2 (mul o y) (mul3 o (sub 1 y) c)))))

amplitude compensation in frequency modulation (using +Fletscher-Munson curve)

(let* ((x (mouse-x kr 300 15000 1 0.1))
       (y (mouse-y kr 3 200 1 0.1))
       (m (mul x (mul-add (sin-osc ar y 0) 0.5 1)))
       (a (amp-comp-a m 300 (db-amp -10) 1))
       (c (mul3 (sin-osc ar m 0) 0.1 a)))
  (audition (out 0 c)))

2.26 (two-pole in freq radius)

Two pole filter. This provides lower level access to setting of +pole location. For general purposes resonz is better.

(audition
 (out 0 (two-pole (mul (white-noise ar) 0.005) 2000 0.95)))
(audition
 (out 0 (two-pole (mul (white-noise ar) 0.005)
                  (x-line kr 800 8000 8 remove-synth)
                  0.95)))

2.27 (lpf in freq)

Second order Butterworth lowpass filter.

(audition
 (let ((f (x-line kr 0.7 300 20 remove-synth)))
   (out 0 (lpf (mul (saw ar 200) 0.1)
               (mul-add (f-sin-osc kr f 0) 3600 4000)))))

2.28 (hpz1 in)

Two point difference filter.

(audition (out 0 (hpz1 (mul (white-noise ar) 0.25))))

2.29 (freq-shift input shift phase)

freq-shift implements single sideband amplitude modulation, also known as frequency shifting, but not to be confused with pitch shifting. Frequency shifting moves all the components of a signal by a fixed amount but does not preserve the original harmonic relationships.

input - audio input shift - amount of shift in cycles per second -phase - phase of the frequency shift (0 - 2pi)

shifting a 100Hz tone by 1 Hz rising to 500Hz

(let ((i (sin-osc ar 100 0)) - (s (x-line kr 1 500 5 remove-synth))) - (audition (out 0 (mul (freq-shift i s 0) 0.1))))

shifting a complex tone by 1 Hz rising to 500Hz

(let ((i (klang ar 1 0 (klang-data (list 101 303 606 808) - (replicate 4 1) - (replicate 4 1)))) - (s (x-line kr 1 500 5 remove-synth))) - (audition (out 0 (mul (freq-shift i s 0) 0.1))))

modulating shift and phase

(let ((i (sin-osc ar 10 0)) - (s (mul (lf-noise2 ar 0.3) 1500)) - (p (lin-lin (sin-osc ar 500 0) -1 1 0 (* 2 pi)))) - (audition (out 0 (mul (freq-shift i s p) 0.1))))

shifting bandpassed noise

(let ((i (bpf (white-noise ar) 1000 0.001)) - (s (mul (lf-noise0 ar 5.5) 1000))) - (audition (out 0 (mul (freq-shift i s 0) 32))))

2.30 (lpz1 ar in)

Two point average filter

(audition - (out 0 (lpz1 (mul (white-noise ar) 0.25))))

2.31 (moog-ff in freq gain reset)

Moog VCF implementation, designed by Federico Fontana. A digital +phase - phase of the frequency shift (0 - 2pi)

shifting a 100Hz tone by 1 Hz rising to 500Hz

(let ((i (sin-osc ar 100 0))
      (s (x-line kr 1 500 5 remove-synth)))
  (audition (out 0 (mul (freq-shift i s 0) 0.1))))

shifting a complex tone by 1 Hz rising to 500Hz

(let ((i (klang ar 1 0 (klang-data (list 101 303 606 808)
                                   (replicate 4 1)
                                   (replicate 4 1))))
      (s (x-line kr 1 500 5 remove-synth)))
  (audition (out 0 (mul (freq-shift i s 0) 0.1))))

modulating shift and phase

(let ((i (sin-osc ar 10 0))
      (s (mul (lf-noise2 ar 0.3) 1500))
      (p (lin-lin (sin-osc ar 500 0) -1 1 0 (* 2 pi))))
  (audition (out 0 (mul (freq-shift i s p) 0.1))))

shifting bandpassed noise

(let ((i (bpf (white-noise ar) 1000 0.001))
      (s (mul (lf-noise0 ar 5.5) 1000)))
  (audition (out 0 (mul (freq-shift i s 0) 32))))

2.30 (lpz1 ar in)

Two point average filter

(audition
 (out 0 (lpz1 (mul (white-noise ar) 0.25))))

2.31 (moog-ff in freq gain reset)

Moog VCF implementation, designed by Federico Fontana. A digital implementation of the Moog VCF (filter).

in - the input signal freq - the cutoff frequency gain - the filter resonance gain, between zero and 4 @@ -762,140 +65,38 @@ reset - when greater than zero, this will reset the state of the digital filters at the beginning of a computational block.

The design of this filter is described in the conference paper Fontana, F. (2007) Preserving the Digital Structure of the Moog -VCF. in Proc. ICMC07, Copenhagen, 25-31 August 2007

(let ((n (mul (white-noise ar) 0.1)) - (y (mouse-y kr 100 10000 1 0.1)) - (x (mouse-x kr 0 4 0 0.1))) - (audition (out 0 (moog-ff n y x 0))))

(let* ((p (pulse ar (mce2 40 121) (mce2 0.3 0.7))) - (f0 (lin-lin (lf-noise0 kr 0.43) -1 1 0.001 2.2)) - (f1 (lin-lin (sin-osc kr f0 0) -1 1 30 4200)) - (y (mouse-y kr 1 4 0 0.1))) - (audition (out 0 (moog-ff p f1 (mul 0.83 y) 0))))

2.32 (resonz in freq bwr)

Resonant filter.

A two pole resonant filter with zeroes at z = +/- 1. Based on +VCF. in Proc. ICMC07, Copenhagen, 25-31 August 2007

(let ((n (mul (white-noise ar) 0.1))
      (y (mouse-y kr 100 10000 1 0.1))
      (x (mouse-x kr 0 4 0 0.1)))
  (audition (out 0 (moog-ff n y x 0))))
(let* ((p (pulse ar (mce2 40 121) (mce2 0.3 0.7)))
       (f0 (lin-lin (lf-noise0 kr 0.43) -1 1 0.001 2.2))
       (f1 (lin-lin (sin-osc kr f0 0) -1 1 30 4200))
       (y (mouse-y kr 1 4 0 0.1)))
  (audition (out 0 (moog-ff p f1 (mul 0.83 y) 0))))

2.32 (resonz in freq bwr)

Resonant filter.

A two pole resonant filter with zeroes at z = +/- 1. Based on K. Steiglitz, "A Note on Constant-Gain Digital Resonators," Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994. The reciprocal of Q is used rather than Q because it saves a divide operation inside the unit generator.

in - input signal to be processed freq - resonant frequency in Hertz -rq - bandwidth ratio (reciprocal of Q). rq = bandwidth / centerFreq

(audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 0.1)))

Modulate frequency

(let ((f (x-line kr 1000 8000 10 remove-synth))) - (audition (out 0 (resonz (mul (white-noise ar) 0.5) f 0.05))))

Modulate bandwidth

(let ((rq (x-line kr 1 0.001 8 remove-synth))) - (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq))))

Modulate bandwidth opposite direction

(let ((rq (x-line kr 0.001 1 8 remove-synth))) - (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq))))

random resonator at a random location, run as often as you like...

(let ((freq (choose (map (lambda (z) (* z 120)) (enum-from-to 1 16)))) - (bw 1/4) - (gain 8)) - (audition (out 0 (pan2 (resonz (white-noise ar) freq (/ bw freq)) - (rand -1 1) - gain))))

2.33 (brz2 in)

A two zero fixed midcut filter. A special case fixed +rq - bandwidth ratio (reciprocal of Q). rq = bandwidth / centerFreq

(audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 0.1)))

Modulate frequency

(let ((f (x-line kr 1000 8000 10 remove-synth)))
  (audition (out 0 (resonz (mul (white-noise ar) 0.5) f 0.05))))

Modulate bandwidth

(let ((rq (x-line kr 1 0.001 8 remove-synth)))
  (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq))))

Modulate bandwidth opposite direction

(let ((rq (x-line kr 0.001 1 8 remove-synth)))
  (audition (out 0 (resonz (mul (white-noise ar) 0.5) 2000 rq))))

random resonator at a random location, run as often as you like...

(let ((freq (choose (map (lambda (z) (* z 120)) (enum-from-to 1 16))))
      (bw 1/4)
      (gain 8))
  (audition (out 0 (pan2 (resonz (white-noise ar) freq (/ bw freq))
                         (rand -1 1)
                         gain))))

2.33 (brz2 in)

A two zero fixed midcut filter. A special case fixed filter. Implements the formula:

out(i) = 0.5 * (in(i) + in(i-2))

This filter cuts out frequencies around 1/2 of the Nyquist -frequency.

Compare:

(audition (out 0 (mul (white-noise ar) 0.15)))

(audition (out 0 (brz2 (mul (white-noise ar) 0.15))))

2.34 (Rhpf in freq rq)

A resonant high pass filter.

(audition - (out - 0 - (rhpf (mul (saw ar 200) 0.1) - (mul-add (f-sin-osc kr (x-line kr 0.7 300 20 remove-synth) 0) 3600 4000) - 0.2)))

2.35 (brf in freq rq)

Second order Butterworth band reject filter.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth)) - (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000))) - (audition (out 0 (brf (mul (saw ar 200) 0.1) f2 0.3))))

2.36 (one-pole in coef)

A one pole filter. Implements the formula: out(i) = ((1 - +frequency.

Compare:

(audition (out 0 (mul (white-noise ar) 0.15)))

(audition (out 0 (brz2 (mul (white-noise ar) 0.15))))

2.34 (Rhpf in freq rq)

A resonant high pass filter.

(audition
 (out
  0
  (rhpf (mul (saw ar 200) 0.1)
        (mul-add (f-sin-osc kr (x-line kr 0.7 300 20 remove-synth) 0) 3600 4000)
        0.2)))

2.35 (brf in freq rq)

Second order Butterworth band reject filter.

(let* ((f1 (x-line kr 0.7 300 20 remove-synth))
       (f2 (mul-add (f-sin-osc kr f1 0) 3600 4000)))
  (audition (out 0 (brf (mul (saw ar 200) 0.1) f2 0.3))))

2.36 (one-pole in coef)

A one pole filter. Implements the formula: out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1)).

in - input signal to be processed -coef - feedback coefficient. Should be between -1 and +1

(audition - (out 0 (one-pole (mul (white-noise ar) 0.5) 0.95)))

(audition - (out 0 (one-pole (mul (white-noise ar) 0.5) -0.95)))

(audition - (out 0 (one-pole (mul (white-noise ar) 0.5) - (line kr -0.99 0.99 10 remove-synth))))

2.37 (lag in lagTime)

A simple averaging filter.

(let* ((x (mouse-x kr 220 440 0 0.1)) - (f (mce2 x (lag x 1)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.38 (ringz in freq decayTime)

Ringing filter. This is the same as resonz, except that instead of +coef - feedback coefficient. Should be between -1 and +1

(audition
 (out 0 (one-pole (mul (white-noise ar) 0.5) 0.95)))
(audition
 (out 0 (one-pole (mul (white-noise ar) 0.5) -0.95)))
(audition
 (out 0 (one-pole (mul (white-noise ar) 0.5)
                  (line kr -0.99 0.99 10 remove-synth))))

2.37 (lag in lagTime)

A simple averaging filter.

(let* ((x (mouse-x kr 220 440 0 0.1))
       (f (mce2 x (lag x 1))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.38 (ringz in freq decayTime)

Ringing filter. This is the same as resonz, except that instead of a resonance parameter, the bandwidth is specified in a 60dB ring decay time. One ringz is equivalent to one component of the klank -UGen.

(audition - (out 0 (ringz (mul (dust ar 3) 0.3) 2000 2)))

(audition - (out 0 (ringz (mul (white-noise ar) 0.005) 2000 0.5)))

Modulate frequency

(audition - (out 0 (ringz (mul (white-noise ar) 0.005) - (x-line kr 100 3000 10 do-nothing) - 0.5)))

(audition - (out 0 (ringz (mul (impulse ar 6 0) 0.3) - (x-line kr 100 3000 10 do-nothing) - 0.5)))

Modulate ring time

(audition - (out 0 (ringz (mul (impulse ar 6 0) 0.3) - 2000 - (x-line kr 4 0.04 8 do-nothing))))

Modulate ring time opposite direction

(audition - (out 0 (ringz (mul (impulse ar 6 0) 0.3) - 2000 - (x-line kr 0.04 4 8 do-nothing))))

(audition - (out 0 (let ((n (mul (white-noise ar) 0.001))) - (mix-fill - 10 - (lambda (_) - (let ((f (x-line kr (rand 100 5000) (rand 100 5000) 20 do-nothing))) - (ringz n f 0.5)))))))

2.39 (dyn-klank in freqScale freqOffset decayScale spec)

Dynklank is a bank of frequency resonators which can be used to +UGen.

(audition
 (out 0 (ringz (mul (dust ar 3) 0.3) 2000 2)))
(audition
 (out 0 (ringz (mul (white-noise ar) 0.005) 2000 0.5)))

Modulate frequency

(audition
 (out 0 (ringz (mul (white-noise ar) 0.005)
               (x-line kr 100 3000 10 do-nothing)
               0.5)))
(audition
 (out 0 (ringz (mul (impulse ar 6 0) 0.3)
               (x-line kr 100 3000 10 do-nothing)
               0.5)))

Modulate ring time

(audition
 (out 0 (ringz (mul (impulse ar 6 0) 0.3)
               2000
               (x-line kr 4 0.04 8 do-nothing))))

Modulate ring time opposite direction

(audition
 (out 0 (ringz (mul (impulse ar 6 0) 0.3)
               2000
               (x-line kr 0.04 4 8 do-nothing))))
(audition
 (out 0 (let ((n (mul (white-noise ar) 0.001)))
          (mix-fill
           10
           (lambda (_)
             (let ((f (x-line kr (rand 100 5000) (rand 100 5000) 20 do-nothing)))
               (ringz n f 0.5)))))))

2.39 (dyn-klank in freqScale freqOffset decayScale spec)

Dynklank is a bank of frequency resonators which can be used to simulate the resonant modes of an object. Each mode is given a ring time, which is the time for the mode to decay by 60 dB.

Unlike klank, the parameters in specificationsArrayRef can be -changed after it has been started.

(let ((i (mul (impulse ar 2 0) 0.1)) - (d (klank-data ’(800 1071 1153 1723) - (replicate 4 1) - (replicate 4 1)))) - (audition (out 0 (dyn-klank i 1 0 1 d))))

(let ((i (mul (dust ar 8) 0.1)) - (d (klank-data ’(800 1071 1353 1723) - (replicate 4 1) - (replicate 4 1)))) - (audition (out 0 (dyn-klank i 1 0 1 d))))

(let* ((i (mul (impulse ar 3 0) 0.1)) - (f (list 800 1071 1153 1723)) - (r (list 1 1 1 1)) - (x (mouse-x kr 0.5 2 1 0.1)) - (y (mouse-y kr 0.1 10 1 0.1)) - (d (klank-data (map (lambda (e) (mul e x)) f) - (replicate 4 1) - (map (lambda (e) (mul e y)) r)))) - (audition (out 0 (dyn-klank i 1 0 1 d))))

(let* ((i (lambda (f) - (mul (impulse ar (lin-lin (lf-noise0 kr f) -1 1 3 12) 0) 0.1))) - (t (lambda (i d l r) - (map (lambda (e) (mul e (t-rand l r i))) d))) - (d (lambda (i f r) - (klank-data (t i f 0.5 2) - (replicate 4 1) - (t i r 0.1 10)))) - (f1 (list 800 1071 1153 1723)) - (f2 (list 786 1083 1169 1715)) - (r1 (list 1 0.95 0.75 1.25)) - (r2 (list 1 1.35 0.95 1.15)) - (i1 (i 1.5)) - (i2 (i 1.25))) - (audition (out 0 (mce2 (dyn-klank i1 1 0 1 (d i1 f1 r1)) - (dyn-klank i2 1 0 1 (d i2 f2 r2))))))

2.40 (Grainin nc tr dur in pan envbuf)

Granulate an input signal

nc - the number of channels to output. If 1, mono is +changed after it has been started.

(let ((i (mul (impulse ar 2 0) 0.1))
      (d (klank-data '(800 1071 1153 1723)
                     (replicate 4 1)
                     (replicate 4 1))))
  (audition (out 0 (dyn-klank i 1 0 1 d))))
(let ((i (mul (dust ar 8) 0.1))
      (d (klank-data '(800 1071 1353 1723)
                     (replicate 4 1)
                     (replicate 4 1))))
  (audition (out 0 (dyn-klank i 1 0 1 d))))
(let* ((i (mul (impulse ar 3 0) 0.1))
       (f (list 800 1071 1153 1723))
       (r (list 1 1 1 1))
       (x (mouse-x kr 0.5 2 1 0.1))
       (y (mouse-y kr 0.1 10 1 0.1))
       (d (klank-data (map (lambda (e) (mul e x)) f)
                      (replicate 4 1)
                      (map (lambda (e) (mul e y)) r))))
  (audition (out 0 (dyn-klank i 1 0 1 d))))
(let* ((i (lambda (f)
            (mul (impulse ar (lin-lin (lf-noise0 kr f) -1 1 3 12) 0) 0.1)))
       (t (lambda (i d l r)
            (map (lambda (e) (mul e (t-rand l r i))) d)))
       (d (lambda (i f r)
            (klank-data (t i f 0.5 2)
                        (replicate 4 1)
                        (t i r 0.1 10))))
       (f1 (list 800 1071 1153 1723))
       (f2 (list 786 1083 1169 1715))
       (r1 (list 1 0.95 0.75 1.25))
       (r2 (list 1 1.35 0.95 1.15))
       (i1 (i 1.5))
       (i2 (i 1.25)))
  (audition (out 0 (mce2 (dyn-klank i1 1 0 1 (d i1 f1 r1))
                         (dyn-klank i2 1 0 1 (d i2 f2 r2))))))

2.40 (Grainin nc tr dur in pan envbuf)

Granulate an input signal

nc - the number of channels to output. If 1, mono is returned and pan is ignored.

tr - a kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate.

The following args are polled at grain creation time

dur - size of the grain.

in - the input to granulate

pan - a value from -1 to 1. Determines where to pan the output in the same manner as pan-az.

envbuf - the buffer number containing a singal to use for the - grain envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1)) - (y (mouse-y kr 5 25 0 0.1)) - (n (pink-noise ar)) - (t (impulse kr y 0))) - (audition (out 0 (mul (grain-in 2 t 0.1 n x -1) 0.1))))

2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

Granular synthesis with sound stored in a buffer

nc - the number of channels to output. If 1, mono is returned and + grain envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1))
       (y (mouse-y kr 5 25 0 0.1))
       (n (pink-noise ar))
       (t (impulse kr y 0)))
  (audition (out 0 (mul (grain-in 2 t 0.1 n x -1) 0.1))))

2.41 (grain-buf nc tr dur sndbuf rate pos interp pan envbuf)

Granular synthesis with sound stored in a buffer

nc - the number of channels to output. If 1, mono is returned and pan is ignored.

tr - a kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate.

The following args are polled at grain creation time

dur - size of the grain.

sndbuf - the buffer holding an audio signal

rate - the playback rate of the sampled sound

pos - the playback position for the grain to start with (0 is beginning, 1 is end of file)

interp - the interpolation method used for pitchshifting grains. 1 = no interpolation. 2 = linear. 4 = cubic interpolation (more computationally intensive).

pan - a value from -1 to 1. Determines where to pan the output in the same manner as pan-az.

envb - the buffer number containing a singal to use for the - grain envelope. -1 uses a built-in Hanning envelope.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0)) - (let ((g (letc ((gate 1) - (amp 1) - (sndbuf 0) - (envbuf -1)) - (let* ((x (mouse-x kr -1 1 0 0.1)) - (y (mouse-y kr 10 45 0 0.1)) - (i (impulse kr y 0)) - (r (lin-lin (lf-noise1 kr 500) -1 1 0.5 2)) - (p (lin-lin (lf-noise2 kr 0.1) -1 1 0 1))) - (out 0 (grain-buf 2 i 0.1 sndbuf r p 2 x envbuf)))))) - (send-synth fd "g" g) - (send fd (s-new2 "g" -1 add-to-tail 1 "sndbuf" 10 "envbuf" -1)))))

2.42 (grain-sin nc tr dur freq pan envbuf)

Granular synthesis with sine tones

nc - the number of channels to output. If 1, mono is returned and + grain envelope. -1 uses a built-in Hanning envelope.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))
   (let ((g (letc ((gate 1)
                   (amp 1)
                   (sndbuf 0)
                   (envbuf -1))
              (let* ((x (mouse-x kr -1 1 0 0.1))
                     (y (mouse-y kr 10 45 0 0.1))
                     (i (impulse kr y 0))
                     (r (lin-lin (lf-noise1 kr 500) -1 1 0.5 2))
                     (p (lin-lin (lf-noise2 kr 0.1) -1 1 0 1)))
                (out 0 (grain-buf 2 i 0.1 sndbuf r p 2 x envbuf))))))
     (send-synth fd "g" g)
     (send fd (s-new2 "g" -1 add-to-tail 1 "sndbuf" 10 "envbuf" -1)))))

2.42 (grain-sin nc tr dur freq pan envbuf)

Granular synthesis with sine tones

nc - the number of channels to output. If 1, mono is returned and pan is ignored.

tr - a kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate.

The following args are polled at grain creation time

dur - size of the grain.

freq - the input to granulate

pan - a value from -1 to 1. Determines where to pan the output in the same manner as pan-az.

envbuf - the buffer number containing a singal to use for the grain - envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1)) - (y (mouse-y kr 0 400 0 0.1)) - (n (white-noise kr)) - (f (add 440 (mul n y))) - (t (impulse kr 10 0))) - (audition (out 0 (mul (grain-sin 2 t 0.1 f x -1) 0.1))))

2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

Warp a buffer with a time pointer

inspired by Chad Kirby’s SuperCollider2 warp1 class, which was + envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1))
       (y (mouse-y kr 0 400 0 0.1))
       (n (white-noise kr))
       (f (add 440 (mul n y)))
       (t (impulse kr 10 0)))
  (audition (out 0 (mul (grain-sin 2 t 0.1 f x -1) 0.1))))

2.43 (warp1 nc buf ptr freqScale windowSize envbuf overlaps windowrandRatio interp)

Warp a buffer with a time pointer

inspired by Chad Kirby’s SuperCollider2 warp1 class, which was inspired by Richard Karpen’s sndwarp for CSound. A granular time strecher and pitchshifter.

nc - the number of channels in the soundfile used in bufnum.

buf - the buffer number of a mono soundfile.

ptr - the position in the buffer. The value should be between 0 and 1, with 0 being the begining of the buffer, and 1 the @@ -906,151 +107,45 @@ strecher and pitchshifter.

nc - the number of channels in the soundfile us function. Must be between 0 (no randomness) to 1.0 (probably to random actually)

interp - the interpolation method used for pitchshifting grains. 1 = no interpolation. 2 = linear. 4 = cubic interpolation - (more computationally intensive).

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((p (lin-lin (lf-saw kr 0.05 0) -1 1 0 1)) - (x (mouse-x kr 0.5 2 0 0.1)) - (w (warp1 1 10 p x 0.1 -1 8 0.1 2))) - (audition (out 0 w)))

2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

Granular synthesis with frequency modulated sine tones

nc - the number of channels to output. If 1, mono is returned and + (more computationally intensive).

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((p (lin-lin (lf-saw kr 0.05 0) -1 1 0 1))
       (x (mouse-x kr 0.5 2 0 0.1))
       (w (warp1 1 10 p x 0.1 -1 8 0.1 2)))
  (audition (out 0 w)))

2.44 (grain-fm nc tr dur carfreq modfreq index pan envbuf)

Granular synthesis with frequency modulated sine tones

nc - the number of channels to output. If 1, mono is returned and pan is ignored.

tr - a kr or ar trigger to start a new grain. If ar, grains after the start of the synth are sample accurate.

The following args are polled at grain creation time

dur - size of the grain.

carfreq - the carrier freq of the grain generators internal oscillator

modfreq - the modulating freq of the grain generators internal oscillator

index - the index of modulation

pan - a value from -1 to 1. Determines where to pan the output in the same manner as pan-az.

envbuf - the buffer number containing a singal to use for the grain - envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1)) - (y (mouse-y kr 0 400 0 0.1)) - (n (white-noise kr)) - (fd (add 440 (mul n y))) - (t (impulse kr 10 0)) - (i (lin-lin (lf-noise1 kr 500) -1 1 1 10))) - (audition (out 0 (mul (grain-fm 2 t 0.1 fd 200 i x -1) 0.1))))

2.45 (disk-in num-channels rate bufnum)

Continously play a soundfile from disk. This requires a buffer to + envelope. -1 uses a built-in Hanning envelope.

(let* ((x (mouse-x kr -0.5 0.5 0 0.1))
       (y (mouse-y kr 0 400 0 0.1))
       (n (white-noise kr))
       (fd (add 440 (mul n y)))
       (t (impulse kr 10 0))
       (i (lin-lin (lf-noise1 kr 500) -1 1 1 10)))
  (audition (out 0 (mul (grain-fm 2 t 0.1 fd 200 i x -1) 0.1))))

2.45 (disk-in num-channels rate bufnum)

Continously play a soundfile from disk. This requires a buffer to be preloaded with one buffer size of sound. The buffer size must be a multiple of twice the synth block size. The default block size is 64.

Note that disk-in reads the number of outputs to create from what looks like an input, but it is not an input, and cannot be set -using a control.

(let ((f "/home/rohan/audio/metal.wav") - (n 1)) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 8192 n)) - (async fd (b-read 0 f 0 -1 0 1)) - (play fd (out 0 (disk-in n ar 0))))))

(with-sc3 reset)

(with-sc3 - (lambda (fd) - (async fd (b-close 0)) - (async fd (b-free 0))))

2.46 (disk-out bufnum channels)

Note: There are constraints on the size of the buffer, it must be +using a control.

(let ((f "/home/rohan/audio/metal.wav")
      (n 1))
  (with-sc3
   (lambda (fd)
     (async fd (b-alloc 0 8192 n))
     (async fd (b-read 0 f 0 -1 0 1))
     (play fd (out 0 (disk-in n ar 0))))))

(with-sc3 reset)

(with-sc3
 (lambda (fd)
   (async fd (b-close 0))
   (async fd (b-free 0))))

2.46 (disk-out bufnum channels)

Note: There are constraints on the size of the buffer, it must be greater than or equal to twice the size of the audio bus. There must be the same number of channels at the buffer and the disk-out -ugen.

(let ((bus-size 1024) - (bufferexpt 15)) - (= 0 (fxand (expt 2 bufferexpt) - (- (fxarithmetic-shift bus-size 1) 1))))

(let ((g (letc ((bufnum 0)) - (let ((z (clip2 - (rlpf - (lf-pulse ar - (mul-add (sin-osc kr 0.2 0) 10 21) - (mce2 0 0.1) - 0.1) - 100 - 0.1) - 0.4))) - (mrg2 (disk-out bufnum z) - (out 0 z)))))) - (with-sc3 - (lambda (fd) - (send-synth fd "disk-out-help" g) - (async fd (b-alloc 10 32768 2)) - (async fd (b-write 10 - "/tmp/test.aiff" - "aiff" - "float" - 32768 - 0 - 1)) - (send fd (s-new1 "disk-out-help" 1001 1 1 "bufnum" 10)))))

(with-sc3 - (lambda (fd) - (send fd (n-free1 1001)) - (async fd (b-close 10)) - (async fd (b-free 10))))

(system "sndfile-info /tmp/test.aiff") -(system "jack.play /tmp/test.aiff")

2.47 num-input-buses

The number of audio buses allocated to input. input buses follow -output buses which begin at zero.

(let ((bus (add num-output-buses num-input-buses))) - (audition (mrg2 (out 0 (in 1 ar bus)) - (out bus (mul (sin-osc ar 440 0) 0.1)))))

2.48 num-control-buses

2.49 num-buffers

2.50 num-output-buses

The number of audio buses allocated to output.

(let ((bus num-output-buses)) - (audition (out 0 (mul (pulse ar 90 0.3) - (amplitude kr (lag (in 1 ar bus) 0.1) 0.01 0.01)))))

2.51 (buf-frames rate bufnum)

Current duration of buffer.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(let ((p (phasor ar 0 (buf-rate-scale kr 0) 0 (buf-frames kr 0) 0))) - (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

(let ((p (k2a (mouse-x kr 0 (buf-frames kr 0) 0 0.1)))) - (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.52 (buf-rate-scale rate bufnum)

Buffer rate scaling in respect to server samplerate. Returns a -ratio by which the playback of a soundfile is to be scaled.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((r (mul (rand 0.5 2) (buf-rate-scale kr 0))) - (p (phasor ar 0 r 0 (buf-frames kr 0) 0))) - (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.53 sample-dur

Duration of one sample. Equivalent to 1 / sample-rate.

Compare a sine tone derived from sample rate with a 440Hz tone.

(let ((freq (mce2 (mul (recip sample-dur) 0.01) 440))) - (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.54 sample-rate

Server sample rate.

Compare a sine tone derived from sample rate with a 440Hz tone.

(let ((freq (mce2 (mul sample-rate 0.01) 440))) - (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.55 radians-per-sample

2.56 (buf-dur rate bufnum)

Current duration of buffer.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((t (impulse ar (recip (buf-dur kr 0)) 0)) - (p (sweep t (buf-sample-rate kr 0)))) - (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.57 (buf-channels rate bufnum)

Current number of channels of buffer. Using at .ir is not the +ugen.

(let ((bus-size 1024)
      (bufferexpt 15))
  (= 0 (fxand (expt 2 bufferexpt)
              (- (fxarithmetic-shift bus-size 1) 1))))
(let ((g (letc ((bufnum 0))
           (let ((z (clip2
                     (rlpf
                      (lf-pulse ar
                                (mul-add (sin-osc kr 0.2 0) 10 21)
                                (mce2 0 0.1)
                                0.1)
                      100
                      0.1)
                     0.4)))
             (mrg2 (disk-out bufnum z)
                   (out 0 z))))))
  (with-sc3
   (lambda (fd)
     (send-synth fd "disk-out-help" g)
     (async fd (b-alloc 10 32768 2))
     (async fd (b-write 10
                       "/tmp/test.aiff"
                       "aiff"
                       "float"
                       32768
                       0
                       1))
     (send fd (s-new1 "disk-out-help" 1001 1 1 "bufnum" 10)))))
(with-sc3
 (lambda (fd)
   (send fd (n-free1 1001))
   (async fd (b-close 10))
   (async fd (b-free 10))))

(system "sndfile-info /tmp/test.aiff")

(system "jack.play /tmp/test.aiff")

2.47 num-input-buses

The number of audio buses allocated to input. input buses follow +output buses which begin at zero.

(let ((bus (add num-output-buses num-input-buses)))
  (audition (mrg2 (out 0 (in 1 ar bus))
                  (out bus (mul (sin-osc ar 440 0) 0.1)))))

2.48 num-control-buses

2.49 num-buffers

2.50 num-output-buses

The number of audio buses allocated to output.

(let ((bus num-output-buses))
  (audition (out 0 (mul (pulse ar 90 0.3)
                        (amplitude kr (lag (in 1 ar bus) 0.1) 0.01 0.01)))))

2.51 (buf-frames rate bufnum)

Current duration of buffer.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))
(let ((p (phasor ar 0 (buf-rate-scale kr 0) 0 (buf-frames kr 0) 0)))
  (audition (out 0 (buf-rd 1 ar 0 p 0 2))))
(let ((p (k2a (mouse-x kr 0 (buf-frames kr 0) 0 0.1))))
  (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.52 (buf-rate-scale rate bufnum)

Buffer rate scaling in respect to server samplerate. Returns a +ratio by which the playback of a soundfile is to be scaled.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((r (mul (rand 0.5 2) (buf-rate-scale kr 0)))
       (p (phasor ar 0 r 0 (buf-frames kr 0) 0)))
  (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.53 sample-dur

Duration of one sample. Equivalent to 1 / sample-rate.

Compare a sine tone derived from sample rate with a 440Hz tone.

(let ((freq (mce2 (mul (recip sample-dur) 0.01) 440)))
  (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.54 sample-rate

Server sample rate.

Compare a sine tone derived from sample rate with a 440Hz tone.

(let ((freq (mce2 (mul sample-rate 0.01) 440)))
  (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.55 radians-per-sample

2.56 (buf-dur rate bufnum)

Current duration of buffer.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((t (impulse ar (recip (buf-dur kr 0)) 0))
       (p (sweep t (buf-sample-rate kr 0))))
  (audition (out 0 (buf-rd 1 ar 0 p 0 2))))

2.57 (buf-channels rate bufnum)

Current number of channels of buffer. Using at .ir is not the safest choice. Since a buffer can be reallocated at any time, using -ir will not track the changes.

2.58 (buf-sample-rate rate bufnum)

Buffer sample rate.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

Compare a sine tone derived from sample rate of a buffer with a -440Hz tone.

(let ((freq (mce2 (mul (buf-sample-rate ir 0) 0.01) 440))) - (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.59 num-audio-buses

2.60 num-running-synths

Number of currently running synths.

(audition - (out 0 (mul (sin-osc ar (mul-add num-running-synths 200 400) 0) - 0.1)))

2.61 subsample-offset

Offset from synth start within one sample.

When a synth is created from a time stamped osc-bundle, it starts +ir will not track the changes.

2.58 (buf-sample-rate rate bufnum)

Buffer sample rate.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

Compare a sine tone derived from sample rate of a buffer with a +440Hz tone.

(let ((freq (mce2 (mul (buf-sample-rate ir 0) 0.01) 440)))
  (audition (out 0 (mul (sin-osc ar freq 0) 0.1))))

2.59 num-audio-buses

2.60 num-running-synths

Number of currently running synths.

(audition
 (out 0 (mul (sin-osc ar (mul-add num-running-synths 200 400) 0)
             0.1)))

2.61 subsample-offset

Offset from synth start within one sample.

When a synth is created from a time stamped osc-bundle, it starts calculation at the next possible block (normally 64 samples). Using an offset-out ugen, one can delay the audio so that it matches sample accurately. For some synthesis methods, one needs subsample accuracy. subsample-offset provides the information where, within the current sample, the synth was scheduled. It can be used to offset envelopes or resample the audio output.

See also offset-out.

Demonstrate cubic subsample interpolation. An impulse train that -can be moved between samples.

(with-sc3 - (lambda (fd) - (send-synth - fd - "s" - (letc ((out 0) - (add-offset 0)) - (let* ((i (mul (impulse ar 2000 0) 0.3)) - (d sample-dur) - (x 4) - (o (add (sub 1 subsample-offset) - (mouse-x kr 0 add-offset 0 0.1))) - (r (delay-c i (mul d (add 1 x)) (mul d (add o x))))) - (offset-out out r))))))

Create two pulse trains one sample apart, move one relative to the +can be moved between samples.

(with-sc3
 (lambda (fd)
   (send-synth
    fd
    "s"
    (letc ((out 0)
           (add-offset 0))
      (let* ((i (mul (impulse ar 2000 0) 0.3))
             (d sample-dur)
             (x 4)
             (o (add (sub 1 subsample-offset)
                     (mouse-x kr 0 add-offset 0 0.1)))
             (r (delay-c i (mul d (add 1 x)) (mul d (add o x)))))
        (offset-out out r))))))

Create two pulse trains one sample apart, move one relative to the other. When cursor is at the left, the impulses are adjacent, on the right, they are exactly 1 sample apart. View this with an -oscilloscope.

(with-sc3 - (lambda (fd) - (let ((t (utc)) - (dt (/ 1 (server-sample-rate-actual fd)))) - (send fd (bundle (+ t 0.2) - (list (s-new1 "s" -1 1 1 "addOffset" 3)))) - (send fd (bundle (+ t 0.2 dt) - (list (s-new1 "s" -1 1 1 "addOffset" 0)))))))

2.62 (zero-crossing in)

Zero crossing frequency follower.

outputs a frequency based upon the distance between interceptions +oscilloscope.

(with-sc3
 (lambda (fd)
   (let ((t (utc))
         (dt (/ 1 (server-sample-rate-actual fd))))
     (send fd (bundle (+ t 0.2)
                      (list (s-new1 "s" -1 1 1 "addOffset" 3))))
     (send fd (bundle (+ t 0.2 dt)
                      (list (s-new1 "s" -1 1 1 "addOffset" 0)))))))

2.62 (zero-crossing in)

Zero crossing frequency follower.

outputs a frequency based upon the distance between interceptions of the X axis. The X intercepts are determined via linear interpolation so this gives better than just integer wavelength resolution. This is a very crude pitch follower, but can be useful -in some situations.

in - input signal.

(let* ((a (mul (sin-osc ar (mul-add (sin-osc kr 1 0) 600 700) 0) 0.1)) - (b (mul (impulse ar (zero-crossing a) 0) 0.25))) - (audition (out 0 (mce2 a b))))

2.63 (slope in)

slope of signal. Measures the rate of change per second of a +in some situations.

in - input signal.

(let* ((a (mul (sin-osc ar (mul-add (sin-osc kr 1 0) 600 700) 0) 0.1))
       (b (mul (impulse ar (zero-crossing a) 0) 0.25)))
  (audition (out 0 (mce2 a b))))

2.63 (slope in)

slope of signal. Measures the rate of change per second of a signal. Formula implemented is:

out[i] = (in[i] - in[i-1]) * sampling_rate

in - input signal to measure.

a = quadratic noise, b = first derivative line segments, c = second -derivative constant segments

(let* ((r 2) - (a (lf-noise2 kr r)) - (scale (recip r)) - (b (mul (slope a) scale)) - (c (mul (slope b) (squared scale))) - (o (sin-osc ar (mul-add (mce3 a b c) 220 220) 0))) - (audition (out 0 (mix (mul o 1/3)))))

2.64 (running-sum in numsamp)

A running sum over a user specified number of samples, useful for +derivative constant segments

(let* ((r 2)
       (a (lf-noise2 kr r))
       (scale (recip r))
       (b (mul (slope a) scale))
       (c (mul (slope b) (squared scale)))
       (o (sin-osc ar (mul-add (mce3 a b c) 220 220) 0)))
  (audition (out 0 (mix (mul o 1/3)))))

2.64 (running-sum in numsamp)

A running sum over a user specified number of samples, useful for running RMS power windowing.

in - input signal numsamp - How many samples to take the running sum over - (initialisation rate)

(let ((n 40)) - (audition - (out 0 (foldl1 mul (list (sin-osc ar 440 0) - (running-sum (sound-in (mce2 0 1)) n) - (recip n))))))

2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

median ampThreshold peakThreshold downSample)

Autocorrelation pitch follower

This is a better pitch follower than zero-crossing, but more costly + (initialisation rate)

(let ((n 40))
  (audition
   (out 0 (foldl1 mul (list (sin-osc ar 440 0)
                            (running-sum (sound-in (mce2 0 1)) n)
                            (recip n))))))

2.65 (pitch in initFreq minFreq maxFreq execFreq maxBinsPerOctave

median ampThreshold peakThreshold downSample)

Autocorrelation pitch follower

This is a better pitch follower than zero-crossing, but more costly of CPU. For most purposes the default settings can be used and only in needs to be supplied. pitch returns two values (via an Array of outputProxys, see the outputProxy help file), a freq which is the @@ -1061,19 +156,7 @@ mouth sound somewhere between a low pitched short ’a’ sound as in energy to confuse the algorithm.

sclang default argument values are: in = 0.0, initFreq = 440.0, minFreq = 60.0, maxFreq = 4000.0, execFreq = 100.0, maxBinsPerOctave = 16, median = 1, ampThreshold = 0.01, -peakThreshold = 0.5, downSample = 1.

(define (pitch* in median ampThreshold) - (pitch in 444.0 60.0 4000.0 100.0 16 median ampThreshold 0.5 1))

(let* ((in (mul (sin-osc ar (mouse-x kr 220 660 0 0.1) 0) - (mouse-y kr 0.05 0.25 0 0.1))) - (amp (amplitude kr in 0.05 0.05)) - (freq+ (pitch* in 7 0.02)) - (f (fdiv (car (mce-channels freq+)) 2)) - (o (mul (sin-osc ar f 0) amp))) - (audition (out 0 (mce2 in o))))

(let* ((in (sound-in 0)) - (amp (amplitude kr in 0.05 0.05)) - (freq+ (pitch* in 7 0.02)) - (f (car (mce-channels freq+))) - (o (mul (sin-osc ar f 0) amp))) - (audition (out 0 (mce2 in o))))

2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

Compressor, expander, limiter, gate, ducker. General purpose +peakThreshold = 0.5, downSample = 1.

(define (pitch* in median ampThreshold)
  (pitch in 444.0 60.0 4000.0 100.0 16 median ampThreshold 0.5 1))
(let* ((in (mul (sin-osc ar (mouse-x kr 220 660 0 0.1) 0)
                (mouse-y kr 0.05 0.25 0 0.1)))
       (amp (amplitude kr in 0.05 0.05))
       (freq+ (pitch* in 7 0.02))
       (f (fdiv (car (mce-channels freq+)) 2))
       (o (mul (sin-osc ar f 0) amp)))
  (audition (out 0 (mce2 in o))))
(let* ((in (sound-in 0))
       (amp (amplitude kr in 0.05 0.05))
       (freq+ (pitch* in 7 0.02))
       (f (car (mce-channels freq+)))
       (o (mul (sin-osc ar f 0) amp)))
  (audition (out 0 (mce2 in o))))

2.66 (compander input control thresh slopeBelow slopeAbove clampTime relaxTime)

Compressor, expander, limiter, gate, ducker. General purpose dynamics processor.

input: The signal to be compressed / expanded / gated.

control: The signal whose amplitude determines the gain applied to the input signal. Often the same as in (for standard gating or compression) but should be different for @@ -1095,236 +178,60 @@ dynamics processor.

input: The signal to be compressed / expanded / gated. more than 10 milliseconds (the default value).

relaxTime: The amount of time for the amplitude adjustment to be released. Usually a bit longer than clampTime if both times are too short, you can get some (possibly - unwanted) artifacts.

Example signal to process.

(define z - (mul (decay2 (mul (impulse ar 8 0) (mul (lf-saw kr 0.3 0) 0.3)) 0.001 0.3) - (mix (pulse ar (mce2 80 81) 0.3))))

(audition (out 0 z))

Noise gate

(let ((x (mouse-x kr 0.01 1 0 0.1))) - (audition (out 0 (mce2 z (compander z z x 10 1 0.01 0.01)))))

Compressor

(let ((x (mouse-x kr 0.01 1 0 0.1))) - (audition (out 0 (mce2 z (compander z z x 1 0.5 0.01 0.01)))))

limiter

(let ((x (mouse-x kr 0.01 1 0 0.1))) - (audition (out 0 (mce2 z (compander z z x 1 0.1 0.01 0.01)))))

Sustainer

(let ((x (mouse-x kr 0.01 1 0 0.1))) - (audition (out 0 (mce2 z (compander z z x 0.1 1.0 0.01 0.01)))))

2.67 (amplitude rate in attackTime releaseTime)

Amplitude follower. Tracks the peak amplitude of a signal.

(audition - (out 0 (mul (pulse ar 90 0.3) - (amplitude kr (in 1 ar num-output-buses) 0.01 0.01))))

(let* ((a (amplitude kr (in 1 ar num-output-buses) 0.01 0.01)) - (f (mul-add a 1200 400))) - (audition (out 0 (mul (sin-osc ar f 0) 0.3))))

2.68 (pulse-divider trig div start)

outputs one impulse each time it receives a certain number of + unwanted) artifacts.

Example signal to process.

(define z
  (mul (decay2 (mul (impulse ar 8 0) (mul (lf-saw kr 0.3 0) 0.3)) 0.001 0.3)
       (mix (pulse ar (mce2 80 81) 0.3))))

(audition (out 0 z))

Noise gate

(let ((x (mouse-x kr 0.01 1 0 0.1)))
  (audition (out 0 (mce2 z (compander z z x 10 1 0.01 0.01)))))

Compressor

(let ((x (mouse-x kr 0.01 1 0 0.1)))
  (audition (out 0 (mce2 z (compander z z x 1 0.5 0.01 0.01)))))

limiter

(let ((x (mouse-x kr 0.01 1 0 0.1)))
  (audition (out 0 (mce2 z (compander z z x 1 0.1 0.01 0.01)))))

Sustainer

(let ((x (mouse-x kr 0.01 1 0 0.1)))
  (audition (out 0 (mce2 z (compander z z x 0.1 1.0 0.01 0.01)))))

2.67 (amplitude rate in attackTime releaseTime)

Amplitude follower. Tracks the peak amplitude of a signal.

(audition
 (out 0 (mul (pulse ar 90 0.3)
             (amplitude kr (in 1 ar num-output-buses) 0.01 0.01))))
(let* ((a (amplitude kr (in 1 ar num-output-buses) 0.01 0.01))
       (f (mul-add a 1200 400)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.3))))

2.68 (pulse-divider trig div start)

outputs one impulse each time it receives a certain number of triggers at its input. A trigger happens when the signal changes -from non-positive to positive.

(let* ((p (impulse ar 8 0)) - (d (pulse-divider p (mce2 4 7) 0)) - (a (mul (sin-osc ar 1200 0) (decay2 p 0.005 0.1))) - (b (mul (sin-osc ar 600 0) (decay2 d 0.005 0.5)))) - (audition (out 0 (mul (add a b) 0.4))))

2.69 (gate in trig)

The signal at ‘in’ is passed while ‘trig’ is greater than zero.

(let ((s (mul (f-sin-osc ar 500 0) 1/4)) - (t (lf-pulse ar 1 0 1/10))) - (audition (out 0 (gate s t))))

2.70 (poll trig in trigid label)

Print/query the current output value of a UGen.

trig - a non-positive to positive transition telling poll to return +from non-positive to positive.

(let* ((p (impulse ar 8 0))
       (d (pulse-divider p (mce2 4 7) 0))
       (a (mul (sin-osc ar 1200 0) (decay2 p 0.005 0.1)))
       (b (mul (sin-osc ar 600 0)  (decay2 d 0.005 0.5))))
  (audition (out 0 (mul (add a b) 0.4))))

2.69 (gate in trig)

The signal at ‘in’ is passed while ‘trig’ is greater than zero.

(let ((s (mul (f-sin-osc ar 500 0) 1/4))
      (t (lf-pulse ar 1 0 1/10)))
  (audition (out 0 (gate s t))))

2.70 (poll trig in trigid label)

Print/query the current output value of a UGen.

trig - a non-positive to positive transition telling poll to return a value

in - the signal you want to poll

trigid - if greater then 0, a ’/tr’ message is sent back to the client (similar to send-trig)

label - a string or symbol to be printed with the polled value

poll returns its in signal (and is therefore transparent). WARNING: Printing values from the Server in intensive for the -CPU. poll should be used for debugging purposes.

(define (string->ugen s) - (make-mce - (cons (string-length s) - (map char->integer (string->list s)))))

(let ((t (impulse kr 2 0)) - (i (line kr 0 1 5 remove-synth))) - (audition (poll t i 0 (string->ugen "Test"))))

(with-sc3 - (lambda (fd) - (letrec ((print (lambda (e) (display e) (newline))) - (showing (lambda (f) (lambda () (let ((v (f))) (print v) v)))) - (repeat (lambda (f) (if (f) (repeat f) #f)))) - (async fd (/notify 1)) - (repeat (showing (lambda () (wait fd "/tr")))) - (async fd (/notify 0)))))

multichannel Expansion (Broken...)

(define (poll* trig in trigId label) - (poll trig in trigId (string->ugen label)))

(poll* (impulse kr (mce2 10 5) 0) - (line kr 0 (mce2 1 5) (mce2 1 2) do-nothing) - 0 - "Test")

(with-sc3 server-status)

2.71 (most-change a b)

output the input that changed most.

(let* ((x (mouse-x kr 200 300 0 0.1)) - (f (most-change (mul-add (lf-noise0 kr 1) 400 900) x))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.72 (trig in dur)

When ‘in’ is trigerred output the trigger value for ‘dur’ seconds.

(let ((s (f-sin-osc ar 800 0)) - (g (trig (dust ar 1) 0.2))) - (audition (out 0 (mul3 s g 0.5))))

(audition (out 0 (trig (dust ar 4) 0.1)))

2.73 (pulse-count trig reset)

This outputs the number of pulses received at ‘trig’ and outputs -that value until ‘reset’ is triggered.

(let ((f (mul (pulse-count (impulse ar 10 0) (impulse ar 0.4 0)) 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.05))))

2.74 (stepper trig reset min max step resetval)

stepper pulse counter. Each trigger increments a counter which is -output as a signal. The counter wraps between min and max.

(with-sc3 - (lambda (fd) - (let ((a (list 97.999 195.998 523.251 466.164 195.998 - 233.082 87.307 391.995 87.307 261.626 - 195.998 77.782 233.082 195.998 97.999 - 155.563))) - (async fd (b-alloc 10 128 1)) - (send fd (b-setn1 10 0 a)))))

Function composition...

(define (seq s l) - (if (null? l) - s - (seq ((car l) s) (cdr l))))

(let* ((rate (mouse-x kr 1 5 1 0.1)) - (clock (impulse kr rate 0)) - (env (decay2 clock 0.002 2.5)) - (index (stepper clock 0 0 15 1 0)) - (freq (buf-rd 1 kr 10 index 1 1)) - (ffreq (add (if #t - (lag2 freq 0.1) - (mul (mouse-y kr 80 1600 1 0.1) (add (Mul env 4) 2))) - (mce2 0 0.3))) - (lfo (sin-osc kr 0.2 (mce4 0 (/ pi 2) 0.0024 0.0025))) - (rvb (lambda (s) (allpass-n s - 0.05 - (clone 2 (rand 0 0.05)) - (rand 1.5 2.0)))) - (proc (list - (lambda (s) (mul (rlpf s ffreq 0.3) env)) - (lambda (s) (mul (rlpf s ffreq 0.3) env)) - (lambda (s) (mul s 0.2)) - Echo - (lambda (s) (mul-add (comb-l s 1 (fdiv 0.66 rate) 2) 0.8 s)) - Reverb - (lambda (s) (add s (mul (seq s (replicate 5 rvb)) 0.3))) - (lambda (s) (leak-dc s 0.1)) - Flanger - (lambda (s) (add (delay-l s 0.1 lfo) s)) - Slight bass emphasis - (lambda (s) (one-pole s 0.9)))) - (init (mix (lf-pulse ar (mul freq (mce3 1 3/2 2)) 0 0.3)))) - (audition (out 0 (seq init proc))))

Pattern randomizer....

(with-sc3 - (lambda (fd) - (let ((p (map (lambda (e) - (midi-cps (+ 36 (s:degree-to-key e (list 0 3 5 7 10) 12)))) - (map floor (replicate-m 16 (random 0 15)))))) - (send fd (b-setn1 10 0 p)))))

A shorter variant, using some simple syntax...

(define-syntax seq* - (syntax-rules () - ((_ i s f ...) - (seq i (list (lambda (s) f) ...)))))

(let* ((rate (mouse-x kr 1 5 1 0.1)) - (clock (impulse kr rate 0)) - (env (decay2 clock 0.002 2.5)) - (index (stepper clock 0 0 15 1 0)) - (freq (buf-rd 1 kr 10 index 1 1)) - (ffreq (add (lag2 freq 0.1) (mce2 0 0.3))) - (lfo (sin-osc kr 0.2 (mce4 0 (/ pi 2) 0.0024 0.0025))) - (rvb (lambda (s) (allpass-n s - 0.05 - (clone 2 (rand 0 0.05)) - (rand 1.5 2.0)))) - (init (mix (lf-pulse ar (mul freq (mce3 1 3/2 2)) 0 0.3))) - (proc (seq* init - s - (mul (rlpf s ffreq 0.3) env) - (mul (rlpf s ffreq 0.3) env) - (mul s 0.2) - (mul-add (comb-l s 1 (fdiv 0.66 rate) 2) 0.8 s) - (add s (mul (seq s (replicate 5 rvb)) 0.3)) - (leak-dc s 0.1) - (add (delay-l s 0.1 lfo) s) - (one-pole s 0.9)))) - (audition (out 0 proc)))

2.75 (last-value in diff)

output the last value before the input changed more than a -threshhold.

(let ((f (last-value (mouse-x kr 100 400 0 0.1) 40))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

(let* ((x (mouse-x kr 0.1 4 0 0.1)) - (f (mul-add (u:abs (sub x (last-value x 0.5))) 400 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.76 (peak-follower in decay)

Track peak signal amplitude. outputs the peak amplitude of the +CPU. poll should be used for debugging purposes.

(define (string->ugen s)
  (make-mce
   (cons (string-length s)
         (map char->integer (string->list s)))))
(let ((t (impulse kr 2 0))
      (i (line kr 0 1 5 remove-synth)))
  (audition (poll t i 0 (string->ugen "Test"))))
(with-sc3
 (lambda (fd)
   (letrec ((print (lambda (e) (display e) (newline)))
            (showing (lambda (f) (lambda () (let ((v (f))) (print v) v))))
            (repeat (lambda (f) (if (f) (repeat f) #f))))
     (async fd (/notify 1))
     (repeat (showing (lambda () (wait fd "/tr"))))
     (async fd (/notify 0)))))

multichannel Expansion (Broken...)

(define (poll* trig in trigId label)
  (poll trig in trigId (string->ugen label)))
(poll* (impulse kr (mce2 10 5) 0)
       (line kr 0 (mce2 1 5) (mce2 1 2) do-nothing)
       0
       "Test")

(with-sc3 server-status)

2.71 (most-change a b)

output the input that changed most.

(let* ((x (mouse-x kr 200 300 0 0.1))
       (f (most-change (mul-add (lf-noise0 kr 1) 400 900) x)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.72 (trig in dur)

When ‘in’ is trigerred output the trigger value for ‘dur’ seconds.

(let ((s (f-sin-osc ar 800 0))
      (g (trig (dust ar 1) 0.2)))
  (audition (out 0 (mul3 s g 0.5))))

(audition (out 0 (trig (dust ar 4) 0.1)))

2.73 (pulse-count trig reset)

This outputs the number of pulses received at ‘trig’ and outputs +that value until ‘reset’ is triggered.

(let ((f (mul (pulse-count (impulse ar 10 0) (impulse ar 0.4 0)) 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.05))))

2.74 (stepper trig reset min max step resetval)

stepper pulse counter. Each trigger increments a counter which is +output as a signal. The counter wraps between min and max.

(with-sc3
 (lambda (fd)
   (let ((a (list 97.999 195.998 523.251 466.164 195.998
                  233.082 87.307 391.995 87.307 261.626
                  195.998 77.782 233.082 195.998 97.999
                  155.563)))
     (async fd (b-alloc 10 128 1))
     (send fd (b-setn1 10 0 a)))))

Function composition...

(define (seq s l)
  (if (null? l)
      s
      (seq ((car l) s) (cdr l))))
(let* ((rate (mouse-x kr 1 5 1 0.1))
       (clock (impulse kr rate 0))
       (env (decay2 clock 0.002 2.5))
       (index (stepper clock 0 0 15 1 0))
       (freq (buf-rd 1 kr 10 index 1 1))
       (ffreq (add (if #t
                       (lag2 freq 0.1)
                       (mul (mouse-y kr 80 1600 1 0.1) (add (Mul env 4) 2)))
                   (mce2 0 0.3)))
       (lfo (sin-osc kr 0.2 (mce4 0 (/ pi 2) 0.0024 0.0025)))
       (rvb (lambda (s) (allpass-n s
                                  0.05
                                  (clone 2 (rand 0 0.05))
                                  (rand 1.5 2.0))))
       (proc (list
              (lambda (s) (mul (rlpf s ffreq 0.3) env))
              (lambda (s) (mul (rlpf s ffreq 0.3) env))
              (lambda (s) (mul s 0.2))
 
              (lambda (s) (mul-add (comb-l s 1 (fdiv 0.66 rate) 2) 0.8 s))
 
              (lambda (s) (add s (mul (seq s (replicate 5 rvb)) 0.3)))
              (lambda (s) (leak-dc s 0.1))
 
              (lambda (s) (add (delay-l s 0.1 lfo) s))
 
              (lambda (s) (one-pole s 0.9))))
       (init (mix (lf-pulse ar (mul freq (mce3 1 3/2 2)) 0 0.3))))
  (audition (out 0 (seq init proc))))

Pattern randomizer....

(with-sc3
 (lambda (fd)
   (let ((p (map (lambda (e)
                   (midi-cps (+ 36 (s:degree-to-key e (list 0 3 5 7 10) 12))))
                 (map floor (replicate-m 16 (random 0 15))))))
     (send fd (b-setn1 10 0 p)))))

A shorter variant, using some simple syntax...

(define-syntax seq*
  (syntax-rules ()
    ((_ i s f ...)
     (seq i (list (lambda (s) f) ...)))))
(let* ((rate (mouse-x kr 1 5 1 0.1))
       (clock (impulse kr rate 0))
       (env (decay2 clock 0.002 2.5))
       (index (stepper clock 0 0 15 1 0))
       (freq (buf-rd 1 kr 10 index 1 1))
       (ffreq (add (lag2 freq 0.1) (mce2 0 0.3)))
       (lfo (sin-osc kr 0.2 (mce4 0 (/ pi 2) 0.0024 0.0025)))
       (rvb (lambda (s) (allpass-n s
                                  0.05
                                  (clone 2 (rand 0 0.05))
                                  (rand 1.5 2.0))))
       (init (mix (lf-pulse ar (mul freq (mce3 1 3/2 2)) 0 0.3)))
       (proc (seq* init
                   s
                   (mul (rlpf s ffreq 0.3) env)
                   (mul (rlpf s ffreq 0.3) env)
                   (mul s 0.2)
                   (mul-add (comb-l s 1 (fdiv 0.66 rate) 2) 0.8 s)
                   (add s (mul (seq s (replicate 5 rvb)) 0.3))
                   (leak-dc s 0.1)
                   (add (delay-l s 0.1 lfo) s)
                   (one-pole s 0.9))))
  (audition (out 0 proc)))

2.75 (last-value in diff)

output the last value before the input changed more than a +threshhold.

(let ((f (last-value (mouse-x kr 100 400 0 0.1) 40)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))
(let* ((x (mouse-x kr 0.1 4 0 0.1))
       (f (mul-add (u:abs (sub x (last-value x 0.5))) 400 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.76 (peak-follower in decay)

Track peak signal amplitude. outputs the peak amplitude of the signal received at the input. If level is below maximum, the level decreases by the factor given in decay.

in - input signal. decay - decay factor.

internally, the absolute value of the signal is used, to prevent underreporting the peak value if there is a negative DC offset. To obtain the minimum and maximum values of the signal as is, use the -running-min and running-max UGens.

No decay

(let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) - (f (mul-add (peak-follower s 1.0) 1500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

A little decay

(let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) - (f (mul-add (peak-follower s 0.999) 1500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Mouse x controls decay

(let* ((x (mouse-x kr 0.99 1.0001 1 0.1)) - (s (mul (dust ar 20) (line kr 0 1 4 do-nothing))) - (f (mul-add (peak-follower s (u:min x 1.0)) 1500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Follow a sine lfo

(let* ((x (mouse-x kr 0.99 1.0001 1 0.1)) - (s (sin-osc kr 0.2 0)) - (f (mul-add (peak-follower s (u:min x 1.0)) 200 500))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.77 (running-max in trig)

Track maximum level. outputs the maximum value received at the +running-min and running-max UGens.

No decay

(let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing)))
       (f (mul-add (peak-follower s 1.0) 1500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

A little decay

(let* ((s (mul (dust ar 20) (line kr 0 1 4 do-nothing)))
       (f (mul-add (peak-follower s 0.999) 1500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Mouse x controls decay

(let* ((x (mouse-x kr 0.99 1.0001 1 0.1))
       (s (mul (dust ar 20) (line kr 0 1 4 do-nothing)))
       (f (mul-add (peak-follower s (u:min x 1.0)) 1500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Follow a sine lfo

(let* ((x (mouse-x kr 0.99 1.0001 1 0.1))
       (s (sin-osc kr 0.2 0))
       (f (mul-add (peak-follower s (u:min x 1.0)) 200 500)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.77 (running-max in trig)

Track maximum level. outputs the maximum value received at the input. When triggered, the maximum output value is reset to the current value.

in - input signal -trig - reset the output value to the current input value

(let* ((t (impulse ar 0.4 0)) - (f (mul-add (running-max (dust ar 20) t) 500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

(let* ((t (impulse kr (mouse-x kr 0.01 2 1 0.1) 0)) - (f (mul-add (running-max (sin-osc kr 2 0) t) 500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.78 (trig1 in dur)

When ‘in’ is trigered output a unit signal for ‘dur’ seconds.

(let ((a (trig1 (dust ar 1) 0.2))) - (audition (out 0 (mul3 (f-sin-osc ar 800 0) a 0.2))))

2.79 (phasor trig rate start end resetpos)

triggered linear ramp between two levels. Starts a linear ramp +trig - reset the output value to the current input value

(let* ((t (impulse ar 0.4 0))
       (f (mul-add (running-max (dust ar 20) t) 500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((t (impulse kr (mouse-x kr 0.01 2 1 0.1) 0))
       (f (mul-add (running-max (sin-osc kr 2 0) t) 500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.78 (trig1 in dur)

When ‘in’ is trigered output a unit signal for ‘dur’ seconds.

(let ((a (trig1 (dust ar 1) 0.2)))
  (audition (out 0 (mul3 (f-sin-osc ar 800 0) a 0.2))))

2.79 (phasor trig rate start end resetpos)

triggered linear ramp between two levels. Starts a linear ramp when trig input crosses from non-positive to positive.

trig - sets phase to resetPos (default: 0, equivalent to start) rate - rate value in 1 / frameDur (at 44.1 kHz sample rate: rate 1 is eqivalent to 44100/sec) start, end - start and end points of ramp resetPos - determines where to jump to on recieving a trigger. the value at that position can be calculated as follows: - (end - start) * resetPos

phasor controls sine frequency: end frequency matches a second sine wave.

(let* ((r (mouse-x kr 0.2 2 1 0.1)) - (t (impulse ar r 0)) - (x (phasor ar t (fdiv r sample-rate) 0 1 0)) - (f (mce2 (lin-lin x 0 1 600 1000) 1000))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.80 (schmidt in lo hi)

schmidt trigger. When in crosses to greater than hi, output 1.0, + (end - start) * resetPos

phasor controls sine frequency: end frequency matches a second sine wave.

(let* ((r (mouse-x kr 0.2 2 1 0.1))
       (t (impulse ar r 0))
       (x (phasor ar t (fdiv r sample-rate) 0 1 0))
       (f (mce2 (lin-lin x 0 1 600 1000) 1000)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.80 (schmidt in lo hi)

schmidt trigger. When in crosses to greater than hi, output 1.0, then when signal crosses lower than lo output 0.0. output is initially zero.

in - signal to be tested lo - low threshold -hi - high threshold

(let* ((in (lf-noise1 kr 3)) - (octave (add (schmidt in -0.15 0.15) 1)) - (f (add (mul in 200) (mul 500 octave)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.81 (peak trig reset)

outputs the maximum value read at the ‘trig’ input until ‘reset’ is -triggered.

(let* ((p (peak (dust ar 20) (impulse ar 0.4 0))) - (f (mul-add p 500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.82 (toggle-ff trig)

Toggle flip flop. Toggles between zero and one upon receiving a trigger.

trig - trigger input

(let* ((t (dust ar (x-line kr 1 1000 60 do-nothing))) - (s (sin-osc ar (mul-add (toggle-ff t) 400 800) 0))) - (audition (out 0 (mul s 0.1))))

2.83 (sweep trig rate)

triggered linear ramp. Starts a linear raise by rate/sec from zero -when trig input crosses from non-positive to positive.

Using sweep to modulate sine frequency

(let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0)) - (f (add (sweep t 700) 500))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Using sweep to index into a buffer

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((t (impulse ar (mouse-x kr 0.5 20 1 0.1) 0)) - (i (sweep t (buf-sample-rate ir 0)))) - (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

Backwards, variable offset

(let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0)) - (r (buf-sample-rate ir 0)) - (i (add (sweep t (neg r)) (mul (buf-frames ir 0) (lf-noise0 kr 15))))) - (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

Raising rate

(let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0)) - (r (add (sweep t 2) 0.5)) - (i (sweep t (mul (buf-sample-rate ir 0) r)))) - (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

2.84 (send-trig in id value)

On receiving a trigger (0 to non-zero transition), send a trigger +hi - high threshold

(let* ((in (lf-noise1 kr 3))
       (octave (add (schmidt in -0.15 0.15) 1))
       (f (add (mul in 200) (mul 500 octave))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.81 (peak trig reset)

outputs the maximum value read at the ‘trig’ input until ‘reset’ is +triggered.

(let* ((p (peak (dust ar 20) (impulse ar 0.4 0)))
       (f (mul-add p 500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.82 (toggle-ff trig)

Toggle flip flop. Toggles between zero and one upon receiving a trigger.

trig - trigger input

(let* ((t (dust ar (x-line kr 1 1000 60 do-nothing)))
       (s (sin-osc ar (mul-add (toggle-ff t) 400 800) 0)))
  (audition (out 0 (mul s 0.1))))

2.83 (sweep trig rate)

triggered linear ramp. Starts a linear raise by rate/sec from zero +when trig input crosses from non-positive to positive.

Using sweep to modulate sine frequency

(let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0))
       (f (add (sweep t 700) 500)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

Using sweep to index into a buffer

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((t (impulse ar (mouse-x kr 0.5 20 1 0.1) 0))
       (i (sweep t (buf-sample-rate ir 0))))
  (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

Backwards, variable offset

(let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0))
       (r (buf-sample-rate ir 0))
       (i (add (sweep t (neg r)) (mul (buf-frames ir 0) (lf-noise0 kr 15)))))
  (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

Raising rate

(let* ((t (impulse ar (mouse-x kr 0.5 10 1 0.1) 0))
       (r (add (sweep t 2) 0.5))
       (i (sweep t (mul (buf-sample-rate ir 0) r))))
  (audition (out 0 (buf-rd 1 ar 0 i 0 2))))

2.84 (send-trig in id value)

On receiving a trigger (0 to non-zero transition), send a trigger message from the server back to all registered clients. Clients register by sending a /notify message to the server.

input - the trigger

id - an integer that will be passed with the trigger message. This is useful if you have more than one send-trig in a SynthDef

value - a UGen or float that will be polled at the time of trigger, - and its value passed with the trigger message

(let ((s (lf-noise0 kr 10))) - (audition (mrg2 (send-trig s 0 s) - (out 0 (mul (sin-osc ar (mul-add s 200 500) 0) 0.1)))))

(with-sc3 - (lambda (fd) - (async fd (notify 1)) - (sleep 2.0) - (let ((r (wait fd "/tr"))) - (async fd (notify 0)) - r)))

2.85 (in-range in lo hi)

Tests if a signal is within a given range.

If in is >= lo and <= hi output 1.0, otherwise output 0.0. output + and its value passed with the trigger message

(let ((s (lf-noise0 kr 10)))
  (audition (mrg2 (send-trig s 0 s)
                  (out 0 (mul (sin-osc ar (mul-add s 200 500) 0) 0.1)))))
(with-sc3
 (lambda (fd)
   (async fd (notify 1))
   (sleep 2.0)
   (let ((r (wait fd "/tr")))
     (async fd (notify 0))
     r)))

2.85 (in-range in lo hi)

Tests if a signal is within a given range.

If in is >= lo and <= hi output 1.0, otherwise output 0.0. output is initially zero.

in - signal to be tested lo - low threshold -hi - high threshold

(let ((a (in-range (mul (sin-osc kr 1 0) 0.2) -0.15 0.15))) - (audition (out 0 (mul a (mul (brown-noise ar) 0.1)))))

2.86 (timer trig)

Returns time since last triggered

Using timer to modulate sine frequency: the slower the trigger is -the higher the frequency

(let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0)) - (s (sin-osc ar (mul-add (timer t) 500 500) 0))) - (audition (out 0 (mul s 0.2))))

2.87 (t-delay trigger delayTime)

Delays a trigger by a given time. Any triggers which arrive in the +hi - high threshold

(let ((a (in-range (mul (sin-osc kr 1 0) 0.2) -0.15 0.15)))
  (audition (out 0 (mul a (mul (brown-noise ar) 0.1)))))

2.86 (timer trig)

Returns time since last triggered

Using timer to modulate sine frequency: the slower the trigger is +the higher the frequency

(let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0))
       (s (sin-osc ar (mul-add (timer t) 500 500) 0)))
  (audition (out 0 (mul s 0.2))))

2.87 (t-delay trigger delayTime)

Delays a trigger by a given time. Any triggers which arrive in the time between an input trigger and its delayed output, are ignored.

trigger - input trigger signal. -delayTime - delay time in seconds.

(let* ((s (mul (sin-osc ar 440 0) 0.1)) - (z (impulse ar 2 0)) - (l (mul z 0.1)) - (r (mul (toggle-ff (t-delay z 0.5)) s))) - (audition (out 0 (mce2 l r))))

2.88 (running-min in trig)

Track minimum level. outputs the minimum value received at the +delayTime - delay time in seconds.

(let* ((s (mul (sin-osc ar 440 0) 0.1))
       (z (impulse ar 2 0))
       (l (mul z 0.1))
       (r (mul (toggle-ff (t-delay z 0.5)) s)))
  (audition (out 0 (mce2 l r))))

2.88 (running-min in trig)

Track minimum level. outputs the minimum value received at the input. When triggered, the minimum output value is reset to the current value.

in - input signal -trig - reset the output value to the current input value

(let* ((t (impulse ar 2.0 0)) - (f (mul-add (running-min (sub 1 (dust ar 20)) t) 500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

(let* ((t (impulse kr (mouse-x kr 0.5 4 1 0.1) 0)) - (f (mul-add (running-min (sub 2 (sin-osc kr 2 0)) t) 500 200))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.89 (set-reset-ff trig reset)

Set-reset flip flop. output is set to 1.0 upon receiving a trigger +trig - reset the output value to the current input value

(let* ((t (impulse ar 2.0 0))
       (f (mul-add (running-min (sub 1 (dust ar 20)) t) 500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((t (impulse kr (mouse-x kr 0.5 4 1 0.1) 0))
       (f (mul-add (running-min (sub 2 (sin-osc kr 2 0)) t) 500 200)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.89 (set-reset-ff trig reset)

Set-reset flip flop. output is set to 1.0 upon receiving a trigger in the set input, and to 0.0 upon receiving a trigger in the reset input. Once the flip flop is set to zero or one further triggers in the same input are have no effect. One use of this is to have some precipitating event cause something to happen until you reset it.

trig - trigger sets output to one -reset - trigger resets output to zero

(let ((n (brown-noise ar)) - (g (set-reset-ff (dust ar 5) (dust ar 5)))) - (audition (out 0 (mul3 n g 0.2))))

2.90 (saw rate freq)

Band limited sawtooth wave generator.

(let ((f (x-line kr 40 4000 6 do-nothing))) - (audition (out 0 (mul (saw ar f) 0.2))))

Two band limited sawtooth waves thru a resonant low pass filter

(let ((f (x-line kr 8000 400 5 do-nothing))) - (audition (out 0 (rlpf (mul (saw ar (mce2 100 250)) 0.1) f 0.05))))

2.91 (pm-osc rate carfreq modfreq index modphase)

Phase modulation oscillator pair.

carfreq - carrier frequency in cycles per second. +reset - trigger resets output to zero

(let ((n (brown-noise ar))
      (g (set-reset-ff (dust ar 5) (dust ar 5))))
  (audition (out 0 (mul3 n g 0.2))))

2.90 (saw rate freq)

Band limited sawtooth wave generator.

(let ((f (x-line kr 40 4000 6 do-nothing)))
  (audition (out 0 (mul (saw ar f) 0.2))))

Two band limited sawtooth waves thru a resonant low pass filter

(let ((f (x-line kr 8000 400 5 do-nothing)))
  (audition (out 0 (rlpf (mul (saw ar (mce2 100 250)) 0.1) f 0.05))))

2.91 (pm-osc rate carfreq modfreq index modphase)

Phase modulation oscillator pair.

carfreq - carrier frequency in cycles per second. modfreq - modulator frequency in cycles per second. index - modulation index in radians. -modphase - a modulation input for the modulator’s phase in radians

(let* ((f (line kr 600 900 5 remove-synth)) - (o (mul (pm-osc ar f 600 3 0) 0.1))) - (audition (out 0 o)))

(let* ((mf (line kr 600 900 5 remove-synth)) - (o (mul (pm-osc ar 300 mf 3 0) 0.1))) - (audition (out 0 o)))

(let* ((i (line kr 0 20 8 remove-synth)) - (o (mul (pm-osc ar 300 550 i 0) 0.1))) - (audition (out 0 o)))

2.92 (lf-tri rate freq iphase)

A non-band-limited triangular waveform oscillator. output ranges -from -1 to +1.

(audition (out 0 (mul (lf-tri ar 500 1) 0.1)))

Used as both oscillator and LFO.

(let ((f (mul-add (lf-tri kr 4 0) 400 400))) - (audition (out 0 (mul (lf-tri ar f 0) 0.1))))

2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

Buffer granulator. triggers generate grains from a buffer. Each +modphase - a modulation input for the modulator’s phase in radians

(let* ((f (line kr 600 900 5 remove-synth))
       (o (mul (pm-osc ar f 600 3 0) 0.1)))
  (audition (out 0 o)))
(let* ((mf (line kr 600 900 5 remove-synth))
       (o (mul (pm-osc ar 300 mf 3 0) 0.1)))
  (audition (out 0 o)))
(let* ((i (line kr 0 20 8 remove-synth))
       (o (mul (pm-osc ar 300 550 i 0) 0.1)))
  (audition (out 0 o)))

2.92 (lf-tri rate freq iphase)

A non-band-limited triangular waveform oscillator. output ranges +from -1 to +1.

(audition (out 0 (mul (lf-tri ar 500 1) 0.1)))

Used as both oscillator and LFO.

(let ((f (mul-add (lf-tri kr 4 0) 400 400)))
  (audition (out 0 (mul (lf-tri ar f 0) 0.1))))

2.93 (t-grains numChannels trigger bufnum rate centerPos dur pan amp interp)

Buffer granulator. triggers generate grains from a buffer. Each grain has a Hanning envelope (sin^2(x) for x from 0 to pi) and is panned between two channels of multiple outputs.

numChannels - number of output channels.

trigger - at each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs @@ -1338,50 +245,10 @@ panned between two channels of multiple outputs.

numChannels - number of o grain envelope will reach maximum amplitude.

dur - duration of the grain in seconds.

pan - a value from -1 to 1. Determines where to pan the output in the same manner as pan-az.

amp - amplitude of the grain.

interp - 1, 2, or 4. Determines whether the grain uses (1) no interpolation, (2) linear interpolation, or (4) cubic - interpolation.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))

(audition - (let* ((b 10) - (trate (mouse-y kr 2 200 1 0.1)) - (dur (fdiv 4 trate)) - (t (impulse ar trate 0)) - (i (mouse-x kr 0 (buf-dur kr b) 0 0.1))) - (out 0 (t-grains 2 t b 1 i dur 0 0.1 2))))

(audition - (let* ((b 10) - (trate (mouse-y kr 8 120 1 0.1)) - (dur (fdiv 12 trate)) - (clk (impulse ar trate 0)) - (x (mouse-x kr 0 (buf-dur kr b) 0 0.1)) - (pos (add x (t-rand 0 0.01 clk))) - (pan (mul (white-noise kr) 0.6))) - (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2))))

(audition - (let* ((b 10) - (trate (mouse-y kr 8 120 1 0.1)) - (dur (fdiv 4 trate)) - (clk (dust ar trate)) - (x (mouse-x kr 0 (buf-dur kr b) 0 0.1)) - (pos (add x (t-rand 0 0.01 clk))) - (pan (mul (white-noise kr) 0.6))) - (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2))))

The SC3 ** operator is the ShiftLeft binary UGen.

(audition - (let* ((b 10) - (trate (mouse-y kr 2 120 1 0.1)) - (dur (fdiv 1.2 trate)) - (clk (impulse ar trate 0)) - (pos (mouse-x kr 0 (buf-dur kr b) 0 0.1)) - (pan (mul (white-noise kr) 0.6)) - (rate (shift-left 1.2 (u:round (mul (white-noise kr) 3) 1)))) - (out 0 (t-grains 2 clk b rate pos dur pan 0.1 2))))

2.94 (tw-index in normalize array)

triggered windex. When triggered, returns a random index value + interpolation.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))
(audition
 (let* ((b 10)
        (trate (mouse-y kr 2 200 1 0.1))
        (dur (fdiv 4 trate))
        (t (impulse ar trate 0))
        (i (mouse-x kr 0 (buf-dur kr b) 0 0.1)))
  (out 0 (t-grains 2 t b 1 i dur 0 0.1 2))))
(audition
 (let* ((b 10)
        (trate (mouse-y kr 8 120 1 0.1))
        (dur (fdiv 12 trate))
        (clk (impulse ar trate 0))
        (x (mouse-x kr 0 (buf-dur kr b) 0 0.1))
        (pos (add x (t-rand 0 0.01 clk)))
        (pan (mul (white-noise kr) 0.6)))
   (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2))))
(audition
 (let* ((b 10)
        (trate (mouse-y kr 8 120 1 0.1))
        (dur (fdiv 4 trate))
        (clk (dust ar trate))
        (x (mouse-x kr 0 (buf-dur kr b) 0 0.1))
        (pos (add x (t-rand 0 0.01 clk)))
        (pan (mul (white-noise kr) 0.6)))
   (out 0 (t-grains 2 clk b 1 pos dur pan 0.1 2))))

The SC3 ** operator is the ShiftLeft binary UGen.

(audition
 (let* ((b 10)
        (trate (mouse-y kr 2 120 1 0.1))
        (dur (fdiv 1.2 trate))
        (clk (impulse ar trate 0))
        (pos (mouse-x kr 0 (buf-dur kr b) 0 0.1))
        (pan (mul (white-noise kr) 0.6))
        (rate (shift-left 1.2 (u:round (mul (white-noise kr) 3) 1))))
   (out 0 (t-grains 2 clk b rate pos dur pan 0.1 2))))

2.94 (tw-index in normalize array)

triggered windex. When triggered, returns a random index value based on array as a list of probabilities. By default the list of probabilities should sum to 1.0, when the normalize flag is set to -1, the values get normalized by the ugen (less efficient)

Assuming normalized values

(audition - (let* ((prob (mce3 1/5 2/5 2/5)) - (freq (mce3 400 500 600)) - (f (select (tw-index (impulse kr 6 0) 0.0 prob) freq))) - (out 0 (mul (sin-osc ar f 0) 0.2))))

Modulating probability values

(audition - (let* ((t (impulse kr 6 0)) - (a (mce3 1/4 1/2 (mul-add (sin-osc kr 0.3 0) 0.5 0.5))) - (f (select (tw-index t 1.0 a) (mce3 400 500 600)))) - (out 0 (mul (sin-osc ar f 0) 0.2))))

2.95 (osc-n rate bufnum freq phase)

Noninterpolating wavetable lookup oscillator with frequency and +1, the values get normalized by the ugen (less efficient)

Assuming normalized values

(audition
 (let* ((prob (mce3 1/5 2/5 2/5))
        (freq (mce3 400 500 600))
        (f (select (tw-index (impulse kr 6 0) 0.0 prob) freq)))
   (out 0 (mul (sin-osc ar f 0) 0.2))))

Modulating probability values

(audition
 (let* ((t (impulse kr 6 0))
        (a (mce3 1/4 1/2 (mul-add (sin-osc kr 0.3 0) 0.5 0.5)))
        (f (select (tw-index t 1.0 a) (mce3 400 500 600))))
   (out 0 (mul (sin-osc ar f 0) 0.2))))

2.95 (osc-n rate bufnum freq phase)

Noninterpolating wavetable lookup oscillator with frequency and phase modulation inputs. It is usually better to use the interpolating oscillator.

The buffer size must be a power of 2. The buffer should NOT be filled using Wavetable format (b_gen commands should set wavetable @@ -1392,133 +259,21 @@ be used efficiently by the oscillator. The buffer size must be a power of 2.

This can be acheived by creating a Buffer object and sending it one of the "b_gen" messages ( sine1, sine2, sine3 ) with the wavetable flag set to true.

Note about wavetables: oscN requires the b_gen sine1 wavetable flag -to be OFF. osc requires the b_gen sine1 wavetable flag to be ON.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5)))))

(audition (out 0 (mul (osc ar 10 220 0) 0.1)))

Modulate freq

(let ((f (x-line kr 2000 200 1 remove-synth))) - (audition (out 0 (mul (osc ar 10 f 0) 0.5))))

Modulate freq

(let* ((f1 (x-line kr 1 1000 9 remove-synth)) - (f2 (mul-add (osc ar 10 f1 0) 200 800))) - (audition (out 0 (mul (osc ar 10 f2 0) 0.25))))

Modulate phase

(let* ((f (x-line kr 20 8000 10 remove-synth)) - (p (mul (osc ar 10 f 0) (* 2 pi)))) - (audition (out 0 (mul (osc ar 10 800 p) 0.25))))

Change the buffer while its playing

(audition (out 0 (mul (osc ar 10 220 0) 0.1)))

(with-sc3 - (lambda (fd) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 (random 0 1) 1/4)))))

2.97 (lf-saw rate freq iphase)

sawtooth oscillator. A non-band-limited sawtooth +to be OFF. osc requires the b_gen sine1 wavetable flag to be ON.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 512 1))
   (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5)))))

(audition (out 0 (mul (osc ar 10 220 0) 0.1)))

Modulate freq

(let ((f (x-line kr 2000 200 1 remove-synth)))
  (audition (out 0 (mul (osc ar 10 f 0) 0.5))))

Modulate freq

(let* ((f1 (x-line kr 1 1000 9 remove-synth))
       (f2 (mul-add (osc ar 10 f1 0) 200 800)))
  (audition (out 0 (mul (osc ar 10 f2 0) 0.25))))

Modulate phase

(let* ((f (x-line kr 20 8000 10 remove-synth))
       (p (mul (osc ar 10 f 0) (* 2 pi))))
  (audition (out 0 (mul (osc ar 10 800 p) 0.25))))

Change the buffer while its playing

(audition (out 0 (mul (osc ar 10 220 0) 0.1)))

(with-sc3
 (lambda (fd)
   (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 (random 0 1) 1/4)))))

2.97 (lf-saw rate freq iphase)

sawtooth oscillator. A non-band-limited sawtooth oscillator. output ranges from -1 to +1.

freq - frequency in Hertz -iphase - phase in radians

(audition (out 0 (mul (lf-saw ar 500 1) 0.1)))

Used as both oscillator and LFO.

(let ((f (mul-add (lf-saw kr 4 0) 400 400))) - (audition (out 0 (mul (lf-saw ar f 0) 0.1))))

2.98 (tw-choose trig array weights normalize)

The output is selected randomly on recieving a trigger from an +iphase - phase in radians

(audition (out 0 (mul (lf-saw ar 500 1) 0.1)))

Used as both oscillator and LFO.

(let ((f (mul-add (lf-saw kr 4 0) 400 400)))
  (audition (out 0 (mul (lf-saw ar f 0) 0.1))))

2.98 (tw-choose trig array weights normalize)

The output is selected randomly on recieving a trigger from an array of inputs. The weights of this choice are determined from the weights array. If normalize is set to 1 the weights are continuously normalized, which means an extra calculation overhead. When using fixed values the normalizeSum method can be used to normalize the values. TWChoose is a composite of TWindex and -select

(let ((a (mce3 (sin-osc ar 220 0) - (saw ar 440) - (pulse ar 110 0.1))) - (t (dust ar (mouse-x kr 1 1000 1 0.1))) - (w (mce3 0.6 0.15 0.05))) - (audition (out 0 (mul (tw-choose t a w 1) 0.1))))

Note: all the ugens are continously running. This may not be the -most efficient way if each input is cpu-expensive.

2.99 (import (rsc3))

sclang defaults -(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 12) 0 0.15)))

Wandering bass -(audition (out 0 (pan2 (gendy1 ar 1 1 1.0 1.0 30 100 0.3 0.05 5 5) 0 0.15)))

Play me -(let* ((x (mouse-x* kr 100 1000 1 0.1)) - (g (gendy1 ar 2 3 1 1 20 x 0.5 0.0 40 40))) - (audition (out 0 (pan2 (mul (rlpf g 500 0.3) 0.2) 0.0 0.25))))

Scream! -(let ((x (mouse-x kr 220 440 1 0.1)) - (y (mouse-y kr 0.0 1.0 0 0.1))) - (audition (out 0 (pan2 (gendy1 ar 2 3 1 1 x (mul 8 x) y y 7 7) 0.0 0.3))))

1 CP = random noise -(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 1 1) 0 0.15)))

2 CPs = an oscillator -(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 2 2) 0 0.15)))

Used as an LFO -(let* ((ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51)) - (dd (mul-add (sin-osc kr 0.13 0) 0.49 0.51)) - (as (mul-add (sin-osc kr 0.17 0) 0.49 0.51)) - (ds (mul-add (sin-osc kr 0.19 0) 0.49 0.51)) - (g (gendy1 kr 2 4 ad dd 3.4 3.5 as ds 10 10))) - (audition (out 0 (pan2 (sin-osc ar (mul-add g 50 350) 0) 0.0 0.3))))

Wasp -(let ((ad (mul-add (sin-osc kr 0.1 0) 0.1 0.9))) - (audition (out 0 (pan2 (gendy1 ar 0 0 ad 1.0 50 1000 1 0.005 12 12) 0.0 0.2))))

Modulate distributions. Change of pitch as distributions change -the duration structure and spectrum -(let* ((x (mouse-x* kr 0 7 0 0.1)) - (y (mouse-y* kr 0 7 0 0.1)) - (g (gendy1 ar x y 1 1 440 660 0.5 0.5 12 12))) - (audition (out 0 (pan2 g 0 0.2))))

Modulate number of CPs. -(let* ((x (mouse-x* kr 1 13 0 0.1)) - (g (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 x))) - (audition (out 0 (pan2 g 0 0.2))))

Self modulation. -(let* ((x (mouse-x* kr 1 13 0 0.1)) - (y (mouse-y* kr 0.1 10 0 0.1)) - (g0 (gendy1 kr 5 4 0.3 0.7 0.1 y 1.0 1.0 5 5)) - (g1 (gendy1 ar 1 1 1 1 440 (mul-add g0 500 600) 0.5 0.5 12 x))) - (audition (out 0 (pan2 g1 0.0 0.2))))

Use SINUS to track any oscillator and take CP positions from it use -adparam and ddparam as the inputs to sample. -(let* ((p (lf-pulse kr 100 0 0.4)) - (s (mul (sin-osc kr 30 0) 0.5)) - (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12))) - (audition (out 0 (pan2 g 0.0 0.2))))

Near the corners are interesting. -(let* ((x (mouse-x* kr 0 200 0 0.1)) - (y (mouse-y* kr 0 200 0 0.1)) - (p (lf-pulse kr x 0 0.4)) - (s (mul (sin-osc kr y 0) 0.5)) - (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12))) - (audition (out 0 (pan2 g 0.0 0.2))))

Texture -(let* - ((o (let* ((f (rand 130.0 160.3)) - (ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51)) - (dd (mul-add (sin-osc kr 0.13 0) 0.49 0.51)) - (as (mul-add (sin-osc kr 0.17 0) 0.49 0.51)) - (ds (mul-add (sin-osc kr 0.19 0) 0.49 0.51)) - (g (gendy1 ar (rand 0 6) (rand 0 6) ad dd f f as ds 12 12))) - (pan2 (sin-osc ar (mul-add g 200 400) 0) - (rand -1 1) - 0.1))) - (x (mix-fill 10 (lambda (_) o)))) - (audition (out 0 x)))

Try durscale 10.0 and 0.0 too. -(let* ((x (mouse-x* kr 10 700 0 0.1)) - (y (mouse-y* kr 50 1000 0 0.1)) - (g (gendy1 ar 2 3 1 1 1 x 0.5 0.1 10 10))) - (audition (out 0 (pan2 (comb-n (resonz g y 0.1) 0.1 0.1 5) 0.0 0.6))))

Overkill -(define (overkill i) - (mix-fill - i - (lambda (_) - (let* ((f (rand 50 560.3)) - (n (rand 2 20)) - (k (mul-add (sin-osc kr (exp-rand 0.02 0.2) 0) - (fdiv n 2) - (fdiv n 2))) - (g (gendy1 ar - (rand 0 6) (rand 0 6) (rand 0 1) (rand 0 1) f f - (rand 0 1) (rand 0 1) n k))) - (pan2 g (rand -1 1) (fdiv 0.5 (sqrt i)))))))

(audition (out 0 (overkill 10)))

Another traffic moment -(let ((x (mouse-x* kr 100 2000 0 0.1)) - (y (mouse-y* kr 0.01 1.0 0 0.1))) - (audition (out 0 (resonz (overkill 10) x y))))

2.100 (pulse rate freq width)

Bandlimited pulse wave generator.

Modulate frequency

(audition - (let ((f (x-line kr 40 4000 6 remove-synth))) - (out 0 (mul (pulse ar f 0.1) 0.2))))

modulate pulse width

(audition - (let ((w (line kr 0.01 0.99 8 remove-synth))) - (out 0 (mul (pulse ar 200 w) 0.2))))

two band limited square waves thru a resonant low pass filter

(audition - (out 0 (rlpf (mul (pulse ar (mce2 100 250) 0.5) 0.1) - (x-line kr 8000 400 5 remove-synth) - 0.05)))

2.101 (shaper bufnum in)

Wave shaper. Performs waveshaping on the input signal by indexing +select

(let ((a (mce3 (sin-osc ar 220 0)
               (saw ar 440)
               (pulse ar 110 0.1)))
      (t (dust ar (mouse-x kr 1 1000 1 0.1)))
      (w (mce3 0.6 0.15 0.05)))
  (audition (out 0 (mul (tw-choose t a w 1) 0.1))))

Note: all the ugens are continously running. This may not be the +most efficient way if each input is cpu-expensive.

2.99 gendy1

sclang defaults

(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 12) 0 0.15)))

Wandering bass

(audition (out 0 (pan2 (gendy1 ar 1 1 1.0 1.0 30 100 0.3 0.05 5 5) 0 0.15)))

Play me

(let* ((x (mouse-x* kr 100 1000 1 0.1))
       (g (gendy1 ar 2 3 1 1 20 x 0.5 0.0 40 40)))
  (audition (out 0 (pan2 (mul (rlpf g 500 0.3) 0.2) 0.0 0.25))))

Scream!

(let ((x (mouse-x kr 220 440 1 0.1))
      (y (mouse-y kr 0.0 1.0 0 0.1)))
 (audition (out 0 (pan2 (gendy1 ar 2 3 1 1 x (mul 8 x) y y 7 7) 0.0 0.3))))

1 CP = random noise

(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 1 1) 0 0.15)))

2 CPs = an oscillator

(audition (out 0 (pan2 (gendy1 ar 1 1 1 1 440 660 0.5 0.5 2 2) 0 0.15)))

Used as an LFO

(let* ((ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51))
       (dd (mul-add (sin-osc kr 0.13 0) 0.49 0.51))
       (as (mul-add (sin-osc kr 0.17 0) 0.49 0.51))
       (ds (mul-add (sin-osc kr 0.19 0) 0.49 0.51))
       (g  (gendy1 kr 2 4 ad dd 3.4 3.5 as ds 10 10)))
  (audition (out 0 (pan2 (sin-osc ar (mul-add g 50 350) 0) 0.0 0.3))))

Wasp

(let ((ad (mul-add (sin-osc kr 0.1 0) 0.1 0.9)))
  (audition (out 0 (pan2 (gendy1 ar 0 0 ad 1.0 50 1000 1 0.005 12 12) 0.0 0.2))))

Modulate distributions. Change of pitch as distributions change +the duration structure and spectrum

(let* ((x (mouse-x* kr 0 7 0 0.1))
       (y (mouse-y* kr 0 7 0 0.1))
       (g (gendy1 ar x y 1 1 440 660 0.5 0.5 12 12)))
  (audition (out 0 (pan2 g 0 0.2))))

Modulate number of CPs.

(let* ((x (mouse-x* kr 1 13 0 0.1))
       (g (gendy1 ar 1 1 1 1 440 660 0.5 0.5 12 x)))
  (audition (out 0 (pan2 g 0 0.2))))

Self modulation.

(let* ((x  (mouse-x* kr 1 13 0 0.1))
       (y  (mouse-y* kr 0.1 10 0 0.1))
       (g0 (gendy1 kr 5 4 0.3 0.7 0.1 y 1.0 1.0 5 5))
       (g1 (gendy1 ar 1 1 1 1 440 (mul-add g0 500 600) 0.5 0.5 12 x)))
  (audition (out 0 (pan2 g1 0.0 0.2))))

Use SINUS to track any oscillator and take CP positions from it use +adparam and ddparam as the inputs to sample.

(let* ((p (lf-pulse kr 100 0 0.4))
       (s (mul (sin-osc kr 30 0) 0.5))
       (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12)))
  (audition (out 0 (pan2 g 0.0 0.2))))

Near the corners are interesting.

(let* ((x (mouse-x* kr 0 200 0 0.1))
       (y (mouse-y* kr 0 200 0 0.1))
       (p (lf-pulse kr x 0 0.4))
       (s (mul (sin-osc kr y 0) 0.5))
       (g (gendy1 ar 6 6 p s 440 660 0.5 0.5 12 12)))
  (audition (out 0 (pan2 g 0.0 0.2))))

Texture

(let*
    ((o (let* ((f (rand 130.0 160.3))
               (ad (mul-add (sin-osc kr 0.1 0) 0.49 0.51))
               (dd (mul-add (sin-osc kr 0.13 0) 0.49 0.51))
               (as (mul-add (sin-osc kr 0.17 0) 0.49 0.51))
               (ds (mul-add (sin-osc kr 0.19 0) 0.49 0.51))
               (g  (gendy1 ar (rand 0 6) (rand 0 6) ad dd f f as ds 12 12)))
          (pan2 (sin-osc ar (mul-add g 200 400) 0)
                (rand -1 1)
                0.1)))
     (x (mix-fill 10 (lambda (_) o))))
  (audition (out 0 x)))

Try durscale 10.0 and 0.0 too.

(let* ((x (mouse-x* kr 10 700 0 0.1))
       (y (mouse-y* kr 50 1000 0 0.1))
       (g (gendy1 ar 2 3 1 1 1 x 0.5 0.1 10 10)))
  (audition (out 0 (pan2 (comb-n (resonz g y 0.1) 0.1 0.1 5) 0.0 0.6))))

Overkill

(define (overkill i)
  (mix-fill
   i
   (lambda (_)
     (let* ((f (rand 50 560.3))
            (n (rand 2 20))
            (k (mul-add (sin-osc kr (exp-rand 0.02 0.2) 0)
                        (fdiv n 2)
                        (fdiv n 2)))
            (g (gendy1 ar
                       (rand 0 6) (rand 0 6) (rand 0 1) (rand 0 1) f f
                       (rand 0 1) (rand 0 1) n k)))
       (pan2 g (rand -1 1) (fdiv 0.5 (sqrt i)))))))

(audition (out 0 (overkill 10)))

Another traffic moment

(let ((x (mouse-x* kr 100 2000 0 0.1))
      (y (mouse-y* kr 0.01 1.0 0 0.1)))
  (audition (out 0 (resonz (overkill 10) x y))))

2.100 (pulse rate freq width)

Bandlimited pulse wave generator.

Modulate frequency

(audition
 (let ((f (x-line kr 40 4000 6 remove-synth)))
   (out 0 (mul (pulse ar f 0.1) 0.2))))

modulate pulse width

(audition
 (let ((w (line kr 0.01 0.99 8 remove-synth)))
   (out 0 (mul (pulse ar 200 w) 0.2))))

two band limited square waves thru a resonant low pass filter

(audition
 (out 0 (rlpf (mul (pulse ar (mce2 100 250) 0.5) 0.1)
              (x-line kr 8000 400 5 remove-synth)
              0.05)))

2.101 (shaper bufnum in)

Wave shaper. Performs waveshaping on the input signal by indexing into the table.

bufnum - the number of a buffer filled in wavetable format containing the transfer function. -in - the input signal.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "cheby" (list 0 1 0 1 1 0 1)))))

(audition - (let* ((a (line kr 0 1 6 remove-synth)) - (s (mul (sin-osc ar 300 0) a))) - (out 0 (mul (shaper 10 s) 0.5))))

2.102 SC2: Note extra iphase argument. - -(import (rsc3)) - -(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05))) - -(let ((f (x-line kr 200 4000 1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

Loses amplitude towards the end -(let ((f (mul-add (f-sin-osc ar (x-line kr 4 401 8 remove-synth) 0) - 200 - 800))) - (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

2.103 (v-osc rate bufpos freq phase)

Variable wavetable oscillator. A wavetable lookup oscillator which +in - the input signal.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 512 1))
   (async fd (b-gen1 10 "cheby" (list 0 1 0 1 1 0 1)))))
(audition
 (let* ((a (line kr 0 1 6 remove-synth))
        (s (mul (sin-osc ar 300 0) a)))
   (out 0 (mul (shaper 10 s) 0.5))))

2.102 SC2: Note extra iphase argument.

(import (rsc3))

(audition (out 0 (mul (f-sin-osc ar (mce2 440 550) 0) 0.05)))

(let ((f (x-line kr 200 4000 1 remove-synth)))
  (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

Loses amplitude towards the end

(let ((f (mul-add (f-sin-osc ar (x-line kr 4 401 8 remove-synth) 0)
                  200
                  800)))
  (audition (out 0 (mul (f-sin-osc ar f 0) 0.25))))

2.103 (v-osc rate bufpos freq phase)

Variable wavetable oscillator. A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will interpolate between two adjacent tables.

This oscillator requires a buffer to be filled with a wavetable @@ -1529,102 +284,10 @@ of the "b_gen" messages ( sine1, sine2, sine3 ) with the wavetable flag set to true.

This can also be acheived by creating a Signal object and sending it the ’asWavetable’ message, saving it to disk, and having the server load it from there.

Note about wavetables: Vosc requires the b_gen sine1 wavetable flag -to be ON.

Allocate and fill tables 0 to 7 [see also Vosc3]

(with-sc3 - (lambda (fd) - (let* ((square - (lambda (a) (* a a))) - (nth - (lambda (i) - (async fd (b-alloc i 1024 1)) - (let* ((n (expt (+ i 1) 2)) - (a (map1 (lambda (j) (square (/ (- n j) n))) - (enum-from-to 0 (- n 1))))) - (async fd (b-gen1 i "sine1" (cons 7 a))))))) - (for-each nth (enum-from-to 0 7)))))

oscillator at buffers 0 through 7.

(let ((b (mouse-x kr 0 7 0 0.1)) - (f (mce2 120 121))) - (audition (out 0 (mul (v-osc ar b f 0) 0.3))))

Reallocate buffers while oscillator is running.

(with-sc3 - (lambda (fd) - (for-each - (lambda (i) - (async fd (b-gen1 i "sine1" (cons 7 (replicate-m 16 (random 0 1)))))) - (enum-from-to 0 7))))

2.104 (var-saw rate freq iphasewidth)

Variable duty saw

freq - frequency in Hertz +to be ON.

Allocate and fill tables 0 to 7 [see also Vosc3]

(with-sc3
 (lambda (fd)
   (let* ((square
           (lambda (a) (* a a)))
          (nth
           (lambda (i)
             (async fd (b-alloc i 1024 1))
             (let* ((n (expt (+ i 1) 2))
                    (a (map1 (lambda (j) (square (/ (- n j) n)))
                             (enum-from-to 0 (- n 1)))))
               (async fd (b-gen1 i "sine1" (cons 7 a)))))))
     (for-each nth (enum-from-to 0 7)))))

oscillator at buffers 0 through 7.

(let ((b (mouse-x kr 0 7 0 0.1))
      (f (mce2 120 121)))
  (audition (out 0 (mul (v-osc ar b f 0) 0.3))))

Reallocate buffers while oscillator is running.

(with-sc3
 (lambda (fd)
   (for-each
    (lambda (i)
      (async fd (b-gen1  i "sine1" (cons 7 (replicate-m 16 (random 0 1))))))
    (enum-from-to 0 7))))

2.104 (var-saw rate freq iphasewidth)

Variable duty saw

freq - frequency in Hertz iphase - initial phase offset in cycles ( 0..1 ) -width - duty cycle from zero to one.

(let ((f (mul-add (lf-pulse kr (mce2 3 3.03) 0 0.3) 200 200)) - (w (lin-lin (lf-tri kr 1 0) -1 1 0 1))) - (audition (out 0 (mul (var-saw ar f 0 w) 0.1))))

2.105 (import (sosc) (rsc3)) - -(let ((a (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)) - (f (mul-add (lf-noise1 kr 2) 300 400)) - (i (mul (sin-osc ar f 0) 0.1))) - (mrg2 (buf-wr 0 p 1 i) - (out 0 0.0))))) - (b (letc ((r 1)) - (let* ((r* (mul (buf-rate-scale kr 0) r)) - (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))) - (out 0 (buf-rd 1 ar 0 p 1 2)))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 (* 44100 2) 1)) - (send-synth fd "a" a) - (send-synth fd "b" b) - (send fd (s-new0 "a" 1001 1 0)) - (send fd (s-new0 "b" 1002 1 0))))) - -(define (do-send m) - (with-sc3 (lambda (fd) (send fd m)))) - -(do-send (n-set1 1002 "r" 5)) - -(do-send (n-set1 1001 "r" (random 0 2))) - -(do-send (n-set1 1002 "r" 2))

2.106 (import (rsc3)) - -(audition (out 0 (mul (impulse ar 800 0) 0.1))) - -(let ((f (x-line kr 800 10 5 remove-synth))) - (audition (out 0 (mul (impulse ar f 0.0) 0.5)))) - -(let ((f (mouse-y* kr 4 8 0 0.1)) - (p (mouse-x* kr 0 1 0 0.1))) - (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))

2.107 (import (rsc3)) - -(audition (out 0 (mul (blip ar 440 200) 0.15)))

Modulate frequency -(let ((f (x-line kr 20000 200 6 remove-synth))) - (audition (out 0 (mul (blip ar f 100) 0.2))))

Modulate number of harmonics. -(let ((h (line kr 1 100 20 remove-synth))) - (audition (out 0 (mul (blip ar 200 h) 0.2))))

2.108 (select which array)

The output is selected from an array of inputs.

(audition - (let* ((a (mce3 (sin-osc ar 440 0) (saw ar 440) (pulse ar 440 0.1))) - (cycle 3/2) - (w (mul-add (lf-saw kr 1 0) cycle cycle))) - (out 0 (mul (select w a) 0.2))))

Note: all the ugens are continously running. This may not be the -most efficient way if each input is cpu-expensive.

Here used as a sequencer:

(audition - (let* ((n 32) - (a (make-mce (map (compose midi-cps u:floor) - (replicate-m n (rand 30 80))))) - (cycle (/ n 2)) - (w (mul-add (lf-saw kr 1/2 0) cycle cycle))) - (out 0 (mul (saw ar (select w a)) 0.2))))

2.109 (import (rsc3))

Modulate fundamental frequency, formant frequency stays constant. -(audition - (let ((f (x-line kr 400 1000 8 remove-synth))) - (out 0 (mul (formant ar f 2000 800) 0.125))))

Modulate formant frequency, fundamental frequency stays constant. -(audition - (let ((f (x-line kr 400 4000 8 remove-synth))) - (out 0 (mul (formant ar (mce2 200 300) f 200) 0.125))))

Modulate width frequency, other frequencies stay constant. -(audition - (let ((w (x-line kr 800 8000 8 remove-synth))) - (out 0 (mul (formant ar 400 2000 w) 0.125))))

2.110 (import (rsc3)) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 512 1)) - (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10))))) - -(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25))) - -(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))

Compare with: -(audition (out 0 (mul (osc ar 10 200 0.0) 0.25)))

2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

Three variable wavetable oscillators.

A wavetable lookup oscillator which can be swept smoothly across +width - duty cycle from zero to one.

(let ((f (mul-add (lf-pulse kr (mce2 3 3.03) 0 0.3) 200 200))
      (w (lin-lin (lf-tri kr 1 0) -1 1 0 1)))
  (audition (out 0 (mul (var-saw ar f 0 w) 0.1))))

2.105 buf-wr

(let ((a (letc ((r 1))
           (let* ((r* (mul (buf-rate-scale kr 0) r))
                  (p (phasor ar 0 r* 0 (buf-frames kr 0) 0))
                  (f (mul-add (lf-noise1 kr 2) 300 400))
                  (i (mul (sin-osc ar f 0) 0.1)))
             (mrg2 (buf-wr 0 p 1 i)
                   (out 0 0.0)))))
      (b (letc ((r 1))
           (let* ((r* (mul (buf-rate-scale kr 0) r))
                  (p (phasor ar 0 r* 0 (buf-frames kr 0) 0)))
             (out 0 (buf-rd 1 ar 0 p 1 2))))))
  (with-sc3
   (lambda (fd)
     (async fd (b-alloc 0 (* 44100 2) 1))
     (send-synth fd "a" a)
     (send-synth fd "b" b)
     (send fd (s-new0 "a" 1001 1 0))
     (send fd (s-new0 "b" 1002 1 0)))))
(define (do-send m)
  (with-sc3 (lambda (fd) (send fd m))))

(do-send (n-set1 1002 "r" 5))

(do-send (n-set1 1001 "r" (random 0 2)))

(do-send (n-set1 1002 "r" 2))

2.106 impulse

(import (rsc3))

(audition (out 0 (mul (impulse ar 800 0) 0.1)))

(let ((f (x-line kr 800 10 5 remove-synth)))
  (audition (out 0 (mul (impulse ar f 0.0) 0.5))))
(let ((f (mouse-y* kr 4 8 0 0.1))
      (p (mouse-x* kr 0 1 0 0.1)))
  (audition (out 0 (mul (impulse ar f (mce2 0 p)) 0.2))))

2.107 blip

(import (rsc3))

(audition (out 0 (mul (blip ar 440 200) 0.15)))

Modulate frequency

(let ((f (x-line kr 20000 200 6 remove-synth)))
  (audition (out 0 (mul (blip ar f 100) 0.2))))

Modulate number of harmonics.

(let ((h (line kr 1 100 20 remove-synth)))
  (audition (out 0 (mul (blip ar 200 h) 0.2))))

2.108 (select which array)

The output is selected from an array of inputs.

(audition
 (let* ((a (mce3 (sin-osc ar 440 0) (saw ar 440) (pulse ar 440 0.1)))
        (cycle 3/2)
        (w (mul-add (lf-saw kr 1 0) cycle cycle)))
   (out 0 (mul (select w a) 0.2))))

Note: all the ugens are continously running. This may not be the +most efficient way if each input is cpu-expensive.

Here used as a sequencer:

(audition
 (let* ((n 32)
        (a (make-mce (map (compose midi-cps u:floor)
                          (replicate-m n (rand 30 80)))))
        (cycle (/ n 2))
        (w (mul-add (lf-saw kr 1/2 0) cycle cycle)))
   (out 0 (mul (saw ar (select w a)) 0.2))))

2.109 formant

(import (rsc3))

Modulate fundamental frequency, formant frequency stays constant.

(audition
 (let ((f (x-line kr 400 1000 8 remove-synth)))
   (out 0 (mul (formant ar f 2000 800) 0.125))))

Modulate formant frequency, fundamental frequency stays constant.

(audition
 (let ((f (x-line kr 400 4000 8 remove-synth)))
   (out 0 (mul (formant ar (mce2 200 300) f 200) 0.125))))

Modulate width frequency, other frequencies stay constant.

(audition
 (let ((w (x-line kr 800 8000 8 remove-synth)))
   (out 0 (mul (formant ar 400 2000 w) 0.125))))

2.110 c-osc

(import (rsc3))

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 512 1))
   (async fd (b-gen1 10 "sine1" (list (+ 1 2 4) 1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10)))))

(audition (out 0 (mul (c-osc ar 10 200 0.7) 0.25)))

(audition (out 0 (mul (c-osc ar 10 200 (mouse-x* kr 0 4 0 0.1)) 0.25)))

Compare with:

(audition (out 0 (mul (osc ar 10 200 0.0) 0.25)))

2.111 (v-osc3 rate bufpos freq1 freq2 freq3)

Three variable wavetable oscillators.

A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will interpolate between two adjacent tables. This unit generator contains three oscillators at @@ -1635,116 +298,31 @@ power of 2.

This can be acheived by creating a Buffer object and sending i of the "b_gen" messages ( sine1, sine2, sine3 ) with the wavetable flag set to true.

Note about wavetables: Vosc3 requires the b_gen sine1 wavetable flag to be ON.

Allocate and fill tables 0 to 7 with a generated list of harmonic -amplitudes.

(with-sc3 - (lambda (fd) - (let* ((square - (lambda (a) (* a a))) - (nth - (lambda (i) - (async fd (b-alloc i 1024 1)) - (let* ((n (expt (+ i 1) 2)) - (a (map (lambda (j) - (square (/ (- n j) n))) - (enum-from-to 0 (- n 1))))) - (async fd (b-gen1 i "sine1" (cons 7 a))))))) - (for-each nth (enum-from-to 0 7)))))

oscillator at buffers 0 through 7.

(let ((p (mouse-x kr 0 7 0 0.1)) - (f1 (mce2 240 241)) - (f2 (mce2 240.27 241.1)) - (f3 (mce2 240.43 239.71))) - (audition (out 0 (mul (v-osc3 ar p f1 f2 f3) 0.2))))

Reallocate buffers while oscillator is running.

(with-sc3 - (lambda (fd) - (for-each - (lambda (i) - (async fd (b-gen1 i "sine1" (cons 7 (replicate-m 16 (random 0 1)))))) - (enum-from-to 0 7))))

2.112 (lf-cub rate freq iphase)

a sine like shape made of two cubic pieces. smoother than lf-par.

(let ((f (mul-add (lf-cub kr (mul-add (lf-cub kr 0.2 0) 8 10) 0) 400 800))) - (mul (lf-cub ar f 0) 0.1))

(mul (lf-cub ar (mul-add (lf-cub kr 0.2 0) 400 800) 0) 0.1) -(mul (lf-cub ar 800 0) 0.1) -(mul (lf-cub ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (lf-par kr (mul-add (lf-par kr 0.2 0) 8 10) 0) 400 800))) - (mul (lf-par ar f 0) 0.1))

(mul (lf-par ar (mul-add (lf-par kr 0.2 0) 400 800) 0) 0.1) -(mul (lf-par ar 800 0) 0.1) -(mul (lf-par ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (sin-osc kr (mul-add (sin-osc kr 0.2 0) 8 10) 0) 400 800))) - (mul (sin-osc ar f 0) 0.1))

(mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 800) 0) 0.1) -(mul (sin-osc ar 800 0) 0.1) -(mul (sin-osc ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (lf-tri kr (mul-add (lf-tri kr 0.2 0) 8 10) 0) 400 800))) - (mul (lf-tri ar f 0) 0.1))

(mul (lf-tri ar (mul-add (lf-tri kr 0.2 0) 400 800) 0) 0.1) -(mul (lf-tri ar 800 0) 0.1) -(mul (lf-tri ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

2.113 (lf-pulse rate freq iphase width)

A non-band-limited pulse oscillator. outputs a high value of one +amplitudes.

(with-sc3
 (lambda (fd)
   (let* ((square
           (lambda (a) (* a a)))
          (nth
           (lambda (i)
             (async fd (b-alloc i 1024 1))
             (let* ((n (expt (+ i 1) 2))
                    (a (map (lambda (j)
                              (square (/ (- n j) n)))
                            (enum-from-to 0 (- n 1)))))
               (async fd (b-gen1 i "sine1" (cons 7 a)))))))
     (for-each nth (enum-from-to 0 7)))))

oscillator at buffers 0 through 7.

(let ((p (mouse-x kr 0 7 0 0.1))
      (f1 (mce2 240 241))
      (f2 (mce2 240.27 241.1))
      (f3 (mce2 240.43 239.71)))
  (audition (out 0 (mul (v-osc3 ar p f1 f2 f3) 0.2))))

Reallocate buffers while oscillator is running.

(with-sc3
 (lambda (fd)
   (for-each
    (lambda (i)
      (async fd (b-gen1  i "sine1" (cons 7 (replicate-m 16 (random 0 1))))))
    (enum-from-to 0 7))))

2.112 (lf-cub rate freq iphase)

a sine like shape made of two cubic pieces. smoother than lf-par.

(let ((f (mul-add (lf-cub kr (mul-add (lf-cub kr 0.2 0) 8 10) 0) 400 800)))
  (mul (lf-cub ar f 0) 0.1))

(mul (lf-cub ar (mul-add (lf-cub kr 0.2 0) 400 800) 0) 0.1)

(mul (lf-cub ar 800 0) 0.1)

(mul (lf-cub ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (lf-par kr (mul-add (lf-par kr 0.2 0) 8 10) 0) 400 800)))
  (mul (lf-par ar f 0) 0.1))

(mul (lf-par ar (mul-add (lf-par kr 0.2 0) 400 800) 0) 0.1)

(mul (lf-par ar 800 0) 0.1)

(mul (lf-par ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (sin-osc kr (mul-add (sin-osc kr 0.2 0) 8 10) 0) 400 800)))
  (mul (sin-osc ar f 0) 0.1))

(mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 800) 0) 0.1)

(mul (sin-osc ar 800 0) 0.1)

(mul (sin-osc ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

compare:

(let ((f (mul-add (lf-tri kr (mul-add (lf-tri kr 0.2 0) 8 10) 0) 400 800)))
  (mul (lf-tri ar f 0) 0.1))

(mul (lf-tri ar (mul-add (lf-tri kr 0.2 0) 400 800) 0) 0.1)

(mul (lf-tri ar 800 0) 0.1)

(mul (lf-tri ar (x-line kr 100 8000 30 do-nothing) 0) 0.1)

2.113 (lf-pulse rate freq iphase width)

A non-band-limited pulse oscillator. outputs a high value of one and a low value of zero. Note that the iphase argument was not present in SC2.

freq - frequency in Hertz iphase - initial phase offset in cycles ( 0..1 ) -width - pulse width duty cycle from zero to one.

(let ((f (mul-add (lf-pulse kr 3 0 0.3) 200 200))) - (audition (out 0 (mul (lf-pulse ar f 0 0.2) 0.1))))

2.114 (import (sosc) (rsc3))

Allocate and set values at buffer 10. -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 6 1)) - (send fd (b-setn1 10 0 (list 50 100 200 400 800 1600)))))

Index into the above buffer for frequency values. -(let ((f (mul (index 10 (mul (lf-saw kr 2 3) 4)) (mce2 1 9)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

Free buffer -(with-sc3 - (lambda (fd) - (async fd (b-free 10))))

2.115 See lf-cub.

A sine-like shape made of two parabolas. Has audible odd harmonics.

2.116 (sync-saw rate syncFreq sawFreq)

A sawtooth wave that is hard synched to a fundamental pitch. This +width - pulse width duty cycle from zero to one.

(let ((f (mul-add (lf-pulse kr 3 0 0.3) 200 200)))
  (audition (out 0 (mul (lf-pulse ar f 0 0.2) 0.1))))

2.114 index

(import (sosc) (rsc3))

Allocate and set values at buffer 10.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 6 1))
   (send fd (b-setn1 10 0 (list 50 100 200 400 800 1600)))))

Index into the above buffer for frequency values.

(let ((f (mul (index 10 (mul (lf-saw kr 2 3) 4)) (mce2 1 9))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

Free buffer

(with-sc3
 (lambda (fd)
   (async fd (b-free 10))))

2.115 See lf-cub.

A sine-like shape made of two parabolas. Has audible odd harmonics.

2.116 (sync-saw rate syncFreq sawFreq)

A sawtooth wave that is hard synched to a fundamental pitch. This produces an effect similar to moving formants or pulse width modulation. The sawtooth oscillator has its phase reset when the sync oscillator completes a cycle. This is not a band limited waveform, so it may alias.

The frequency of the slave synched sawtooth wave should always be -greater than the syncFreq.

(audition - (let ((f (line kr 100 800 12 remove-synth))) - (out 0 (mul (sync-saw ar 100 f) 0.1))))

2.117 (t-choose trig array)

The output is selected randomly on recieving a trigger from an -array of inputs. t-choose is a composite of ti-rand and select.

(audition - (let* ((t (dust ar (mouse-x kr 1 1000 1 0.1))) - (f (midi-cps (ti-rand 48 60 t))) - (a (mce3 (sin-osc ar f 0) - (saw ar (mul f 2)) - (pulse ar (mul f 0.5) 0.1)))) - (out 0 (mul (t-choose t a) 0.1))))

Note: all the ugens are continously running. This may not be the +greater than the syncFreq.

(audition
 (let ((f (line kr 100 800 12 remove-synth)))
   (out 0 (mul (sync-saw ar 100 f) 0.1))))

2.117 (t-choose trig array)

The output is selected randomly on recieving a trigger from an +array of inputs. t-choose is a composite of ti-rand and select.

(audition
 (let* ((t (dust ar (mouse-x kr 1 1000 1 0.1)))
        (f (midi-cps (ti-rand 48 60 t)))
        (a (mce3 (sin-osc ar f 0)
                 (saw ar (mul f 2))
                 (pulse ar (mul f 0.5) 0.1))))
   (out 0 (mul (t-choose t a) 0.1))))

Note: all the ugens are continously running. This may not be the most efficient way if each input is cpu-expensive.

2.118 (sin-osc rate freq phase)

interpolating sine wavetable oscillator. This is the same as osc except that the table is a sine table of 8192 entries.

freq - frequency in Hertz -phase - phase offset or modulator in radians

(audition (out 0 (mul (sin-osc ar 440 0) (mce2 0.15 0.25))))

Modulate freq

(let ((f (x-line kr 2000 200 1 remove-synth))) - (audition (out 0 (mul (sin-osc ar f 0) 0.5))))

Modulate freq

(let* ((f1 (x-line kr 1 1000 9 remove-synth)) - (f2 (mul-add (sin-osc ar f1 0) 200 800))) - (audition (out 0 (mul (sin-osc ar f2 0) 0.25))))

Modulate phase

(let* ((f (x-line kr 20 8000 10 remove-synth)) - (p (mul (sin-osc ar f 0) (* pi 2)))) - (audition (out 0 (mul (sin-osc ar 800 p) 0.25))))

2.119 (klang rate freqScale freqOffset spec)

Bank of fixed oscillators. The UGen assistant klang.spec can help +phase - phase offset or modulator in radians

(audition (out 0 (mul (sin-osc ar 440 0) (mce2 0.15 0.25))))

Modulate freq

(let ((f (x-line kr 2000 200 1 remove-synth)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.5))))

Modulate freq

(let* ((f1 (x-line kr 1 1000 9 remove-synth))
       (f2 (mul-add (sin-osc ar f1 0) 200 800)))
  (audition (out 0 (mul (sin-osc ar f2 0) 0.25))))

Modulate phase

(let* ((f (x-line kr 20 8000 10 remove-synth))
       (p (mul (sin-osc ar f 0) (* pi 2))))
  (audition (out 0 (mul (sin-osc ar 800 p) 0.25))))

2.119 (klang rate freqScale freqOffset spec)

Bank of fixed oscillators. The UGen assistant klang.spec can help create the ’spec’ entry. Note that the SC3 language reorders the -inputs, the rsc3 client does not.

(let ((d (klang-data ’(440 550 660 770 880 990 1000) - ’(0.05 0.02 0.07 0.04 0.05 0.02 0.03) - (replicate 7 0)))) - (audition (out 0 (klang ar 1 0 d))))

2.120 (lag-in num-channels bus lag)

Set bus 10.

(with-sc3 - (lambda (fd) - (send fd (c-set1 10 (random 200 8000)))))

Smooth a control rate input signal.

(audition (out 0 (mul (sin-osc ar (lag-in 1 10 1) 0) 0.1)))

2.121 (sound-in channel)

Read audio from the sound input hardware.

channel - input channel number to read, - indexed from zero, can be mce.

(audition (out 0 (sound-in 0)))

(audition (out 0 (sound-in (mce2 0 1))))

(audition (out 0 (sound-in (mce4 0 2 1 3))))

2.122 (in num-channels rate bus)

Read signal from an audio or control bus.

Patching input to output.

(audition (out 0 (in 2 ar num-output-buses)))

Patching input to output, with summed delay.

(let ((i (in 2 ar num-input-buses))) - (audition (out 0 (add i (delay-n i 0.5 0.5)))))

Write noise to bus 10, then read it out. The Mrg is ordered.

(audition (mrg2 (out 0 (in 1 ar 10)) - (out 10 (mul (pink-noise ar) 0.3))))

Reading a control bus.

(with-sc3 - (lambda (fd) - (send fd (c-set1 0 (random 200 5000)))))

(audition (out 0 (mul (sin-osc ar (in 1 kr 0) 0) 0.1)))

2.123 (in-trig num-channels bus)

Generate a trigger anytime a bus is set.

Any time the bus is "touched" ie. has its value set (using "/c_set" +inputs, the rsc3 client does not.

(let ((d (klang-data '(440 550 660 770 880 990 1000)
                     '(0.05 0.02 0.07 0.04 0.05 0.02 0.03)
                     (replicate 7 0))))
  (audition (out 0 (klang ar 1 0 d))))

2.120 (lag-in num-channels bus lag)

Set bus 10.

(with-sc3
 (lambda (fd)
   (send fd (c-set1 10 (random 200 8000)))))

Smooth a control rate input signal.

(audition (out 0 (mul (sin-osc ar (lag-in 1 10 1) 0) 0.1)))

2.121 (sound-in channel)

Read audio from the sound input hardware.

channel - input channel number to read, + indexed from zero, can be mce.

(audition (out 0 (sound-in 0)))

(audition (out 0 (sound-in (mce2 0 1))))

(audition (out 0 (sound-in (mce4 0 2 1 3))))

2.122 (in num-channels rate bus)

Read signal from an audio or control bus.

Patching input to output.

(audition (out 0 (in 2 ar num-output-buses)))

Patching input to output, with summed delay.

(let ((i (in 2 ar num-input-buses)))
  (audition (out 0 (add i (delay-n i 0.5 0.5)))))

Write noise to bus 10, then read it out. The Mrg is ordered.

(audition (mrg2 (out 0 (in 1 ar 10))
                (out 10 (mul (pink-noise ar) 0.3))))

Reading a control bus.

(with-sc3
 (lambda (fd)
   (send fd (c-set1 0 (random 200 5000)))))

(audition (out 0 (mul (sin-osc ar (in 1 kr 0) 0) 0.1)))

2.123 (in-trig num-channels bus)

Generate a trigger anytime a bus is set.

Any time the bus is "touched" ie. has its value set (using "/c_set" etc.), a single impulse trigger will be generated. Its amplitude -is the value that the bus was set to.

Run an oscillator with the trigger at bus 10.

(let* ((t (in-trig 1 10)) - (p (env-perc 0.01 1 1 (list -4 -4))) - (e (env-gen kr t t 0 1 do-nothing p)) - (f (mul-add (latch t t) 440 880))) - (audition (out 0 (mul (sin-osc ar f 0) e))))

Set bus 10.

(with-sc3 - (lambda (fd) - (send fd (c-set1 10 0.5))))

2.124 (replace-out bufferindex inputs)

Send signal to a bus, overwrite existing signal.

(audition - (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)) - (replace-out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1)) - (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1))))

Compare to:

(audition - (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)) - (out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1)) - (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1))))

2.125 (local-in num-channels rate)

Define and read from buses local to a SynthDef

num-channels - the number of channels of local buses.

Localin defines buses that are local to the SynthDef. These are +is the value that the bus was set to.

Run an oscillator with the trigger at bus 10.

(let* ((t (in-trig 1 10))
       (p (env-perc 0.01 1 1 (list -4 -4)))
       (e (env-gen kr t t 0 1 do-nothing p))
       (f (mul-add (latch t t) 440 880)))
  (audition (out 0 (mul (sin-osc ar f 0) e))))

Set bus 10.

(with-sc3
 (lambda (fd)
   (send fd (c-set1 10 0.5))))

2.124 (replace-out bufferindex inputs)

Send signal to a bus, overwrite existing signal.

(audition
 (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1))
       (replace-out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1))
       (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1))))

Compare to:

(audition
 (mrg3 (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1))
       (out 0 (mul (sin-osc ar (mce2 880 881) 0) 0.1))
       (out 0 (mul (sin-osc ar (mce2 120 121) 0) 0.1))))

2.125 (local-in num-channels rate)

Define and read from buses local to a SynthDef

num-channels - the number of channels of local buses.

Localin defines buses that are local to the SynthDef. These are like the global buses, but are more convenient if you want to implement a self contained effect that uses a feedback processing loop. There can only be one audio rate and one control rate Localin per SynthDef. The audio can be written to the bus using -local-out.

(let* ((a0 (mul (decay (impulse ar 0.3 0) 0.1) (mul (white-noise ar) 0.2))) - (a1 (add (local-in 2 ar) (mce2 a0 0))) - (a2 (delay-n a1 0.2 0.2))) - (audition (mrg2 (local-out (mul (mce-reverse a2) 0.8)) - (out 0 a2))))

2.126 (offset-out bufferindex inputs)

output signal to a bus, the sample offset within the bus is kept -exactly. This ugen is used where sample accurate output is needed.

(audition - (mrg2 (offset-out 0 (impulse ar 5 0)) - (out 0 (mul (sin-osc ar 60 0) 0.1))))

(audition - (mrg2 (out 0 (impulse ar 5 0)) - (out 0 (mul (sin-osc ar 60 0) 0.1))))

2.127 (in-feedback num-channels bus)

Read signal from a bus without erasing it, audio rate.

The output (out) ugens overwrite data on the bus, giving this bus a +local-out.

(let* ((a0 (mul (decay (impulse ar 0.3 0) 0.1) (mul (white-noise ar) 0.2)))
       (a1 (add (local-in 2 ar) (mce2 a0 0)))
       (a2 (delay-n a1 0.2 0.2)))
  (audition (mrg2 (local-out (mul (mce-reverse a2) 0.8))
                  (out 0 a2))))

2.126 (offset-out bufferindex inputs)

output signal to a bus, the sample offset within the bus is kept +exactly. This ugen is used where sample accurate output is needed.

(audition
 (mrg2 (offset-out 0 (impulse ar 5 0))
       (out 0 (mul (sin-osc ar 60 0) 0.1))))
(audition
 (mrg2 (out 0 (impulse ar 5 0))
       (out 0 (mul (sin-osc ar 60 0) 0.1))))

2.127 (in-feedback num-channels bus)

Read signal from a bus without erasing it, audio rate.

The output (out) ugens overwrite data on the bus, giving this bus a new timestamp so that any input (in) ugen can check if the data was written within the current cycle. The next cycle this data is still there, but in case of audio one normally doesn’t want an in ugen to @@ -1759,317 +337,66 @@ timestamp that is one cycle old. Now in some cases we want to be able to read audio from a bus independant of the current node order, which is the use of inFeedback. The delay introduced by this is at a maximum one block size, which equals about 0.0014 sec -at the default block size and sample rate.

Audio feedback modulation.

(let ((f (mul-add (in-feedback 1 0) 1300 300))) - (audition (out 0 (mul (sin-osc ar f 0) 0.4))))

Evaluate these in either order and hear both tones.

(let ((b (add num-input-buses num-output-buses))) - (audition (out 0 (in-feedback 1 b))))

(let ((b (add num-input-buses num-output-buses))) - (audition (mrg2 (out b (mul (sin-osc ar 440 0) 0.1)) - (out 0 (mul (sin-osc ar 660 0) 0.1)))))

Doubters consult this.

(let ((b (add num-input-buses num-output-buses))) - (audition (out 0 (in 1 ar b))))

Resonator, see localout for variant.

(let* ((b (add num-input-buses num-output-buses)) - (p (in-feedback 1 b)) - (i (impulse ar 1 0)) - (d (delay-c (add i (mul p 0.995)) - 1 - (sub (recip 440) (recip control-rate))))) - (audition (mrg2 (offset-out b d) (offset-out 0 p))))

Compare with oscillator.

(audition (out 1 (mul (sin-osc ar 440 0) 0.2)))

2.128 (x-out buffer-index xfade inputs)

Send signal to a bus, crossfading with existing contents.

(let ((pair (lambda (a b) (mul (sin-osc ar (mce2 a b) 0) 0.1)))) - (audition - (mrg4 (out 0 (pair 220 221)) - (x-out 0 (mouse-x kr 0 1 0 0.1) (pair 330 331)) - (x-out 0 (mouse-y kr 0 1 0 0.1) (pair 440 441)) - (out 0 (pair 120 121)))))

2.129 (out bufferindex inputs)

Send signal to an audio or control buss, mix with existing signal. +at the default block size and sample rate.

Audio feedback modulation.

(let ((f (mul-add (in-feedback 1 0) 1300 300)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.4))))

Evaluate these in either order and hear both tones.

(let ((b (add num-input-buses num-output-buses)))
  (audition (out 0 (in-feedback 1 b))))
(let ((b (add num-input-buses num-output-buses)))
  (audition (mrg2 (out b (mul (sin-osc ar 440 0) 0.1))
                  (out 0 (mul (sin-osc ar 660 0) 0.1)))))

Doubters consult this.

(let ((b (add num-input-buses num-output-buses)))
  (audition (out 0 (in 1 ar b))))

Resonator, see localout for variant.

(let* ((b (add num-input-buses num-output-buses))
       (p (in-feedback 1 b))
       (i (impulse ar 1 0))
       (d (delay-c (add i (mul p 0.995))
                   1
                   (sub (recip 440) (recip control-rate)))))
  (audition (mrg2 (offset-out b d) (offset-out 0 p))))

Compare with oscillator.

(audition (out 1 (mul (sin-osc ar 440 0) 0.2)))

2.128 (x-out buffer-index xfade inputs)

Send signal to a bus, crossfading with existing contents.

(let ((pair (lambda (a b) (mul (sin-osc ar (mce2 a b) 0) 0.1))))
  (audition
   (mrg4 (out  0 (pair 220 221))
         (x-out 0 (mouse-x kr 0 1 0 0.1) (pair 330 331))
         (x-out 0 (mouse-y kr 0 1 0 0.1) (pair 440 441))
         (out  0 (pair 120 121)))))

2.129 (out bufferindex inputs)

Send signal to an audio or control buss, mix with existing signal. The user is responsible for making sure that the number of channels -match and that there are no conflicts.

(audition (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)))

2.130 (mix UGen)

Force multiple channel expansion and sum signals.

(let ((f (make-mce (list 600.2 622.0 641.3 677.7)))) - (audition (out 0 (mul (mix (f-sin-osc ar f 0)) 0.1))))

Expansion nests.

(let ((l (f-sin-osc ar (mce2 100 500) 0)) - (r (f-sin-osc ar (mce2 5000 501) 0))) - (audition (out 0 (mul 0.05 (mix (mce2 l r))))))

2.131 (mix-fill n f) - -(let ((n 6) - (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1)))) - (audition (out 0 (mix-fill n o))))

2.132 (latch in trig)

Sample and hold. Holds input signal value when triggered.

in - input signal. +match and that there are no conflicts.

(audition (out 0 (mul (sin-osc ar (mce2 330 331) 0) 0.1)))

2.130 (mix UGen)

Force multiple channel expansion and sum signals.

(let ((f (make-mce (list 600.2 622.0 641.3 677.7))))
  (audition (out 0 (mul (mix (f-sin-osc ar f 0)) 0.1))))

Expansion nests.

(let ((l (f-sin-osc ar (mce2 100  500) 0))
      (r (f-sin-osc ar (mce2 5000 501) 0)))
  (audition (out 0 (mul 0.05 (mix (mce2 l r))))))

2.131 (mix-fill n f)

(let ((n 6)
      (o (lambda (_) (mul (f-sin-osc ar (rand 200 700) 0) 0.1))))
  (audition (out 0 (mix-fill n o))))

2.132 (latch in trig)

Sample and hold. Holds input signal value when triggered.

in - input signal. trig - trigger. The trigger can be any signal. A trigger happens when the - signal changes from non-positive to positive.

(audition - (out 0 (mul (blip ar (mul-add (latch (white-noise ar) (impulse ar 9 0)) - 400 500) 4) - 0.2)))

The above is just meant as example. lf-noise0 is a faster way to -generate random steps :

(audition - (out 0 (mul (blip ar (mul-add (lf-noise0 kr 9) 400 500) 4) 0.2)))

http://create.ucsb.edu/pipermail/sc-users/2006-December/029991.html

(let* ((n0 (mul-add (lf-noise2 kr 8) 200 300)) - (n1 (mul-add (lf-noise2 kr 3) 10 20)) - (s (blip ar n0 n1)) - (x (mouse-x kr 1000 (mul sample-rate 0.1) 1 0.1))) - (audition - (out 0 (latch s (impulse ar x 0)))))

2.133 (decay in decayTime)

Exponential decay. This is essentially the same as integrator + signal changes from non-positive to positive.

(audition
 (out 0 (mul (blip ar (mul-add (latch (white-noise ar) (impulse ar 9 0))
                               400 500) 4)
             0.2)))

The above is just meant as example. lf-noise0 is a faster way to +generate random steps :

(audition
 (out 0 (mul (blip ar (mul-add (lf-noise0 kr 9) 400 500) 4) 0.2)))

http://create.ucsb.edu/pipermail/sc-users/2006-December/029991.html

(let* ((n0 (mul-add (lf-noise2 kr 8) 200 300))
       (n1 (mul-add (lf-noise2 kr 3) 10 20))
       (s  (blip ar n0 n1))
       (x  (mouse-x kr 1000 (mul sample-rate 0.1) 1 0.1)))
  (audition
   (out 0 (latch s (impulse ar x 0)))))

2.133 (decay in decayTime)

Exponential decay. This is essentially the same as integrator except that instead of supplying the coefficient directly, it is caculated from a 60 dB decay time. This is the time required for the integrator to lose 99.9 % of its value or -60dB. This is useful -for exponential decaying envelopes triggered by impulses.

Used as an envelope.

(audition - (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) 0.2) - (pink-noise ar))))

2.134 (wrap-index bufnum in)

index into a table with a signal.

The input signal value is truncated to an integer value and used as +for exponential decaying envelopes triggered by impulses.

Used as an envelope.

(audition
 (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) 0.2)
             (pink-noise ar))))

2.134 (wrap-index bufnum in)

index into a table with a signal.

The input signal value is truncated to an integer value and used as an index into the table. out of range index values are wrapped cyclically to the valid range.

bufnum - index of the buffer -in - the input signal.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 6 1)) - (send fd (b-setn1 0 0 (list 200 300 400 500 600 800))) - (let ((f (wrap-index 0 (mouse-x kr 0 18 0 0.1)))) - (play fd (out 0 (mul (sin-osc ar f 0) 0.5))))))

2.135 (mouse-y rate minval maxval warp lag)

Report mouse location on root window of the machine that the +in - the input signal.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 6 1))
   (send fd (b-setn1 0 0 (list 200 300 400 500 600 800)))
   (let ((f (wrap-index 0 (mouse-x kr 0 18 0 0.1))))
     (play fd (out 0 (mul (sin-osc ar f 0) 0.5))))))

2.135 (mouse-y rate minval maxval warp lag)

Report mouse location on root window of the machine that the synthesis server is running on. For a linear mapping set warp to -0, for an exponential mapping set warp to 1.

(audition - (out 0 (mul (sin-osc ar (mouse-x kr 20 2000 0 0.1) 0) - (mouse-y kr 0.01 0.1 0 0.1))))

2.136 (degree-to-key bufnum in octave)

Convert signal to modal pitch

The input signal value is truncated to an integer value and used as +0, for an exponential mapping set warp to 1.

(audition
 (out 0 (mul (sin-osc ar (mouse-x kr 20 2000 0 0.1) 0)
             (mouse-y kr 0.01 0.1 0 0.1))))

2.136 (degree-to-key bufnum in octave)

Convert signal to modal pitch

The input signal value is truncated to an integer value and used as an index into an octave repeating table of note values. indices wrap around the table and shift octaves as they do.

bufnum - index of the buffer which contains the steps for each - scale degree.

in - the input signal.

octave - the number of steps per octave in the scale.

(let* ((b 0) - (p (list 0 2 3.2 5 7 9 10)) - (x (mouse-x kr 0 15 0 0.1)) - (k (degree-to-key 0 x 12)) - (c (lambda (n r) - (let* ((o (mul (sin-osc ar (midi-cps (add3 r k n)) 0) 0.1)) - (t (lf-pulse ar (midi-cps (mce2 48 55)) 0.15 0.5)) - (f (midi-cps (mul-add (sin-osc kr 0.1 0) 10 r))) - (d (mul (rlpf t f 0.1) 0.1)) - (m (add o d))) - (add (comb-n m 0.31 0.31 2) m))))) - (with-sc3 - (lambda (fd) - (async fd (b-alloc 0 7 1)) - (send fd (b-setn1 0 0 p)) - (let ((n (mul (lf-noise1 kr (mce2 3 3.05)) 0.04))) - (play fd (out 0 (mul (add (c n 48) (c n 72)) 0.25)))))))

2.137 (key-state rate keynum minval maxval lag)

Report the status of a particular key. A key is either pressed, + scale degree.

in - the input signal.

octave - the number of steps per octave in the scale.

(let* ((b 0)
       (p (list 0 2 3.2 5 7 9 10))
       (x (mouse-x kr 0 15 0 0.1))
       (k (degree-to-key 0 x 12))
       (c (lambda (n r)
            (let* ((o (mul (sin-osc ar (midi-cps (add3 r k n)) 0) 0.1))
                   (t (lf-pulse ar (midi-cps (mce2 48 55)) 0.15 0.5))
                   (f (midi-cps (mul-add (sin-osc kr 0.1 0) 10 r)))
                   (d (mul (rlpf t f 0.1) 0.1))
                   (m (add o d)))
              (add (comb-n m 0.31 0.31 2) m)))))
  (with-sc3
   (lambda (fd)
     (async fd (b-alloc 0 7 1))
     (send fd (b-setn1 0 0 p))
     (let ((n (mul (lf-noise1 kr (mce2 3 3.05)) 0.04)))
       (play fd (out 0 (mul (add (c n 48) (c n 72)) 0.25)))))))

2.137 (key-state rate keynum minval maxval lag)

Report the status of a particular key. A key is either pressed, or not pressed.

The keycode 38 is the A key on my keyboard. Under X the xev(1) -command is useful in determining your keyboard layout.

(audition - (out 0 (mul (sin-osc ar 800 0) - (key-state kr 38 0 0.1 0.5))))

2.138 (mrg2 left right)

mrg2 defines a node indicating a multiple root graph.

(let ((l (out 0 (mul (sin-osc ar 300 0) 0.1))) - (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) - (audition - (mrg2 l r)))

there is a leftmost rule, so that mrg nodes need not -be terminal.

(let ((l (mul (sin-osc ar 300 0) 0.1)) - (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) - (audition (out 0 (mrg2 l r))))

the leftmost node may be an mce node

(let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1)) - (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) - (audition (out 0 (mrg2 l r))))

the implementation is not thorough

(let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1)) - (r (out 1 (mul (sin-osc ar 900 0) 0.1)))) - (audition (out 0 (add (mrg2 l r) - (mrg2 l r)))))

2.139 (mouse-button rate minval maxval lag)

Report the status of the first pointer button. The button is -either pressed, or not pressed.

(audition - (out 0 (mul (sin-osc ar 800 0) - (mouse-button kr 0 0.1 0.1))))

2.140 (slew in up dn)

Has the effect of removing transients and higher frequencies.

(audition - (out 0 (slew (mul (saw ar 800) 0.2) 400 400)))

2.141 (mouse-x rate minval maxval warp lag)

Cursor UGen. Report mouse location on root window of the machine +command is useful in determining your keyboard layout.

(audition
 (out 0 (mul (sin-osc ar 800 0)
             (key-state kr 38 0 0.1 0.5))))

2.138 (mrg2 left right)

mrg2 defines a node indicating a multiple root graph.

(let ((l (out 0 (mul (sin-osc ar 300 0) 0.1)))
      (r (out 1 (mul (sin-osc ar 900 0) 0.1))))
  (audition
   (mrg2 l r)))

there is a leftmost rule, so that mrg nodes need not +be terminal.

(let ((l (mul (sin-osc ar 300 0) 0.1))
      (r (out 1 (mul (sin-osc ar 900 0) 0.1))))
  (audition (out 0 (mrg2 l r))))

the leftmost node may be an mce node

(let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1))
      (r (out 1 (mul (sin-osc ar 900 0) 0.1))))
  (audition (out 0 (mrg2 l r))))

the implementation is not thorough

(let ((l (mul (sin-osc ar (mce2 300 400) 0) 0.1))
      (r (out 1 (mul (sin-osc ar 900 0) 0.1))))
  (audition (out 0 (add (mrg2 l r)
                        (mrg2 l r)))))

2.139 (mouse-button rate minval maxval lag)

Report the status of the first pointer button. The button is +either pressed, or not pressed.

(audition
 (out 0 (mul (sin-osc ar 800 0)
             (mouse-button kr 0 0.1 0.1))))

2.140 (slew in up dn)

Has the effect of removing transients and higher frequencies.

(audition
 (out 0 (slew (mul (saw ar 800) 0.2) 400 400)))

2.141 (mouse-x rate minval maxval warp lag)

Cursor UGen. Report mouse location on root window of the machine that the synthesis server is running on. For a linear mapping set -warp to 0, for an exponential mapping set warp to 1.

(import (rsc3))

(audition - (out 0 (mul (sin-osc ar (mouse-x kr 40 10000 1 0.1) 0) 0.1)))

(audition - (out 0 (mce2 (mul (sin-osc ar (mouse-x kr 20 2000 1 0.1) 0) - (mouse-y kr 0.01 0.1 0 0.1)) - (mul (sin-osc ar (mouse-y kr 20 2000 1 0.1) 0) - (mouse-x kr 0.01 0.1 0 0.1)))))

Auto-pilot variant -(audition - (out 0 (mul (sin-osc ar (mouse-x* kr 40 10000 1 0.1) 0) 0.1)))

2.142 (decay2 in attackTime decayTime)

Exponential decay. decay has a very sharp attack and can produce +warp to 0, for an exponential mapping set warp to 1.

(import (rsc3))

(audition
 (out 0 (mul (sin-osc ar (mouse-x kr 40 10000 1 0.1) 0) 0.1)))
(audition
 (out 0 (mce2 (mul (sin-osc ar (mouse-x kr 20 2000 1 0.1) 0)
                   (mouse-y kr 0.01 0.1 0 0.1))
              (mul (sin-osc ar (mouse-y kr 20 2000 1 0.1) 0)
                   (mouse-x kr 0.01 0.1 0 0.1)))))

Auto-pilot variant

(audition
 (out 0 (mul (sin-osc ar (mouse-x* kr 40 10000 1 0.1) 0) 0.1)))

2.142 (decay2 in attackTime decayTime)

Exponential decay. decay has a very sharp attack and can produce clicks. decay2 rounds off the attack by subtracting one decay from -another.

(decay2 in a d) is equivalent to (sub (decay in d) (Decay in a)).

Used as an envelope

(audition - (out 0 (mul (decay2 (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) - 0.01 - 0.2) - (mul (f-sin-osc ar 600 0) 0.25))))

Compare the above with decay used as the envelope.

(audition - (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25) - 0.01) - (mul (f-sin-osc ar 600 0) 0.25))))

2.143 (k2a in)

Control rate to audio rate converter.

To be able to play a control rate UGen into an audio rate UGen, +another.

(decay2 in a d) is equivalent to (sub (decay in d) (Decay in a)).

Used as an envelope

(audition
 (out 0 (mul (decay2 (impulse ar (x-line kr 1 50 20 remove-synth) 0.25)
                     0.01
                     0.2)
             (mul (f-sin-osc ar 600 0) 0.25))))

Compare the above with decay used as the envelope.

(audition
 (out 0 (mul (decay (impulse ar (x-line kr 1 50 20 remove-synth) 0.25)
                    0.01)
             (mul (f-sin-osc ar 600 0) 0.25))))

2.143 (k2a in)

Control rate to audio rate converter.

To be able to play a control rate UGen into an audio rate UGen, sometimes the rate must be converted. k2a converts via linear -interpolation.

in - input signal

(audition - (out 0 (k2a (mul (white-noise kr) 0.3))))

(audition - (out 0 (mce2 (k2a (mul (white-noise kr) 0.3)) - (mul (white-noise ar) 0.3))))

(let* ((block-size 64) no ugen for this? - (freq (mul (fdiv (mouse-x kr 0.1 40 1 0.1) block-size) sample-rate))) - (audition - (out 0 (mul (mce2 (k2a (lf-noise0 kr freq)) - (lf-noise0 ar freq)) - 0.3))))

2.144 (mul-add a b c)

Functionally equivalent to (add (mul a b) c).

(let ((f (mul-add (lf-saw kr (mce2 10 9) 0) 200 400))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

(let ((f (add (mul (lf-saw kr (mce2 10 9) 0) 200) 400))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.145 (clip2 a b)

Bilateral clipping. clips a to +/- b

(audition - (out 0 (clip2 (f-sin-osc ar 400 0) 0.2)))

(audition - (out 0 (clip2 (f-sin-osc ar 400 0) (line kr 0 1 8 remove-synth))))

2.146 (Atan2 x y)

Returns the arctangent of y/x.

See also hypot.

add a pan to the hypot doppler examples by using atan2 to find the +interpolation.

in - input signal

(audition
 (out 0 (k2a (mul (white-noise kr) 0.3))))
(audition
 (out 0 (mce2 (k2a (mul (white-noise kr) 0.3))
              (mul (white-noise ar) 0.3))))
(let* ((block-size 64)
       (freq (mul (fdiv (mouse-x kr 0.1 40 1 0.1) block-size) sample-rate)))
  (audition
   (out 0 (mul (mce2 (k2a (lf-noise0 kr freq))
                     (lf-noise0 ar freq))
               0.3))))

2.144 (mul-add a b c)

Functionally equivalent to (add (mul a b) c).

(let ((f (mul-add (lf-saw kr (mce2 10 9) 0) 200 400)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))
(let ((f (add (mul (lf-saw kr (mce2 10 9) 0) 200) 400)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.145 (clip2 a b)

Bilateral clipping. clips a to +/- b

(audition
 (out 0 (clip2 (f-sin-osc ar 400 0) 0.2)))
(audition
 (out 0 (clip2 (f-sin-osc ar 400 0) (line kr 0 1 8 remove-synth))))

2.146 (Atan2 x y)

Returns the arctangent of y/x.

See also hypot.

add a pan to the hypot doppler examples by using atan2 to find the azimuth, or direction angle, of the sound source. Assume speakers -at +/- 45 degrees and clip the direction to between those.

(let* ((x 10) - (y (mul (lf-saw kr 1/6 0) 100)) - (distance (hypot x y)) - (amplitude (fdiv 40 (squared distance))) - (sound (rlpf (mul (f-sin-osc ar 200 0) (lf-pulse ar 31.3 0 0.4)) 400 0.3)) - (azimuth (atan2 y x)) - (loc (clip2 (fdiv azimuth (/ pi 2)) 1))) - (audition - (out 0 (pan2 (delay-l sound 110/344 (fdiv distance 344)) - loc - amplitude))))

2.147 (trunc a b)

Truncate a to a multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1)) - (f (trunc x 100))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.148 (sub a b)

subtraction, written ’-’ in sclang.

Silence.

(let ((z (f-sin-osc ar 800 0))) - (audition - (out 0 (sub z z))))

2.149 (round-up a b)

Rounds a up to the nearest multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1)) - (f (round-up x 100))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

(let ((n (line kr 24 108 6 remove-synth))) - (audition - (out 0 (mul (saw ar (midi-cps (round-up n 1))) 0.2))))

2.150 (ring4 a b)

Ring modulation variant. Return the value of ((a*a *b) - +at +/- 45 degrees and clip the direction to between those.

(let* ((x 10)
       (y (mul (lf-saw kr 1/6 0) 100))
       (distance (hypot x y))
       (amplitude (fdiv 40 (squared distance)))
       (sound (rlpf (mul (f-sin-osc ar 200 0) (lf-pulse ar 31.3 0 0.4)) 400 0.3))
       (azimuth (atan2 y x))
       (loc (clip2 (fdiv azimuth (/ pi 2)) 1)))
  (audition
   (out 0 (pan2 (delay-l sound 55/172 (fdiv distance 344))
                loc
                amplitude))))

2.147 (trunc a b)

Truncate a to a multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1))
       (f (trunc x 100)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.148 (sub a b)

subtraction, written ’-’ in sclang.

Silence.

(let ((z (f-sin-osc ar 800 0)))
  (audition
   (out 0 (sub z z))))

2.149 (round-up a b)

Rounds a up to the nearest multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1))
       (f (round-up x 100)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))
(let ((n (line kr 24 108 6 remove-synth)))
  (audition
   (out 0 (mul (saw ar (midi-cps (round-up n 1))) 0.2))))

2.150 (ring4 a b)

Ring modulation variant. Return the value of ((a*a *b) - (a*b*b)). This is more efficient than using separate unit -generators for the multiplies.

See also mul, ring1, ring2, ring3.

(audition - (out 0 (mul (ring4 (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (sub (mul3 a a b) (mul3 a b b)) - 0.125))))

2.151 (pow a b)

Exponentiation, written ** in sclang. When the signal is negative +generators for the multiplies.

See also mul, ring1, ring2, ring3.

(audition
 (out 0 (mul (ring4 (f-sin-osc ar 800 0)
                    (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (sub (mul3 a a b) (mul3 a b b))
               0.125))))

2.151 (pow a b)

Exponentiation, written ** in sclang. When the signal is negative this function extends the usual definition of exponentiation and returns neg(neg(a) ** b). This allows exponentiation of negative -signal values by noninteger exponents.

(audition - (out 0 (let ((a (mul (f-sin-osc ar 100 0) 0.1))) - (mce2 a (pow a 10)))))

http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html

(let* ((n0 (mul-add (lf-noise2 kr 8) 200 300)) - (n1 (mul-add (lf-noise2 kr 3) 10 20)) - (s (blip ar n0 n1)) - (x (mouse-x kr 1000 (mul sample-rate 0.5) 1 0.1)) - (y (mouse-y kr 1 24 1 0.1)) - (d (latch s (impulse ar x 0))) - (b (u:round d (pow 0.5 y)))) - (audition - (out 0 (mce2 d b))))

2.152 (ring1 a b)

Ring modulation plus first source. Return the value of ((a*b) + +signal values by noninteger exponents.

(audition
 (out 0 (let ((a (mul (f-sin-osc ar 100 0) 0.1)))
          (mce2 a (pow a 10)))))

http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html

(let* ((n0 (mul-add (lf-noise2 kr 8) 200 300))
       (n1 (mul-add (lf-noise2 kr 3) 10 20))
       (s  (blip ar n0 n1))
       (x  (mouse-x kr 1000 (mul sample-rate 0.5) 1 0.1))
       (y  (mouse-y kr 1 24 1 0.1))
       (d  (latch s (impulse ar x 0)))
       (b  (u:round d (pow 0.5 y))))
  (audition
   (out 0 (mce2 d b))))

2.152 (ring1 a b)

Ring modulation plus first source. Return the value of ((a*b) + a). This is more efficient than using separate unit generators for -the multiply and add.

See also mul, Ring1, Ring2, Ring3, Ring4.

(audition - (out 0 (mul (ring1 (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (add (mul a b) a) 0.125))))

2.153 (gt a b)

Greater than, written ’>’ in sclang. Signal is 1.0 if a > b, +the multiply and add.

See also mul, Ring1, Ring2, Ring3, Ring4.

(audition
 (out 0 (mul (ring1 (f-sin-osc ar 800 0)
                    (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (add (mul a b) a) 0.125))))

2.153 (gt a b)

Greater than, written ’>’ in sclang. Signal is 1.0 if a > b, otherwise it is 0.0. Similarly LT is <, GE >=, LE <= and EQ ==. -These can be useful for triggering purposes, among other things.

(let* ((o (sin-osc kr 1 0)) - (t (list (gt o 0) - (ge o 0) - (lt o 0) - (le o 0) - (eq o 0) - (mul (lt o 0.001) (gt o -0.001)))) - (f (list 220 - 330 - 440 - 550 - 660 - 770)) - (p (env-perc 0.01 1 1 (list -4 -4))) - (e (env-gen kr (make-mce t) 0.1 0 1 do-nothing p))) - (audition (out 0 (mix (mul (sin-osc ar (make-mce f) 0) e)))))

2.154 (add a b)

addition, written ’+’ in sclang.

(audition - (out 0 (add (mul (f-sin-osc ar 800 0) 0.1) - (mul (pink-noise ar) 0.1))))

DC offset.

(audition - (out 0 (add (f-sin-osc ar 440 0) 0.1)))

2.155 (abs-dif a b)

Calculates the value of (abs (- a b). Finding the magnitude of the -difference of two values is a common operation.

(audition - (out 0 (mul (f-sin-osc ar 440 0) - (abs-dif 0.2 (mul (f-sin-osc ar 2 0) 0.5)))))

2.156 (am-clip a b)

Two quadrant multiply, 0 when b <= 0, a*b when b > 0

(audition - (out 0 (am-clip (white-noise ar) - (mul (f-sin-osc kr 1 0) 0.2))))

2.157 (ge a b)

See gt

2.158 (max a b)

Maximum.

(audition - (out 0 (let ((z (f-sin-osc ar 500 0))) - (u:max z (f-sin-osc ar 0.1 0)))))

2.159 (ring3 a b)

Ring modulation variant. Return the value of (a * a * b). This is +These can be useful for triggering purposes, among other things.

(let* ((o (sin-osc kr 1 0))
       (t (list (gt o 0)
                (ge o 0)
                (lt o 0)
                (le o 0)
                (eq o 0)
                (mul (lt o 0.001) (gt o -0.001))))
       (f (list 220
                330
                440
                550
                660
                770))
       (p (env-perc 0.01 1 1 (list -4 -4)))
       (e (env-gen kr (make-mce t) 0.1 0 1 do-nothing p)))
  (audition (out 0 (mix (mul (sin-osc ar (make-mce f) 0) e)))))

2.154 (add a b)

addition, written ’+’ in sclang.

(audition
 (out 0 (add (mul (f-sin-osc ar 800 0) 0.1)
             (mul (pink-noise ar) 0.1))))

DC offset.

(audition
 (out 0 (add (f-sin-osc ar 440 0) 0.1)))

2.155 (abs-dif a b)

Calculates the value of (abs (- a b). Finding the magnitude of the +difference of two values is a common operation.

(audition
 (out 0 (mul (f-sin-osc ar 440 0)
             (abs-dif 0.2 (mul (f-sin-osc ar 2 0) 0.5)))))

2.156 (am-clip a b)

Two quadrant multiply, 0 when b <= 0, a*b when b > 0

(audition
 (out 0 (am-clip (white-noise ar)
                 (mul (f-sin-osc kr 1 0) 0.2))))

2.157 (ge a b)

See gt

2.158 (max a b)

Maximum.

(audition
   (out 0 (let ((z (f-sin-osc ar 500 0)))
            (u:max z (f-sin-osc ar 0.1 0)))))

2.159 (ring3 a b)

Ring modulation variant. Return the value of (a * a * b). This is more efficient than using separate unit generators for the -multiplies.

See also mul, ring1, ring2, ring4.

(audition - (out 0 (mul (ring3 (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul4 a a b 0.125))))

2.160 (thresh a b)

Signal thresholding. 0 when a < b, otherwise a.

(audition - (out 0 (thresh (mul (lf-noise0 ar 50) 0.5) 0.45)))

2.161 (dif-sqr a b)

Difference of squares. Return the value of (a*a) - (b*b). This is +multiplies.

See also mul, ring1, ring2, ring4.

(audition
 (out 0 (mul (ring3 (f-sin-osc ar 800 0)
                    (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul4 a a b 0.125))))

2.160 (thresh a b)

Signal thresholding. 0 when a < b, otherwise a.

(audition
 (out 0 (thresh (mul (lf-noise0 ar 50) 0.5) 0.45)))

2.161 (dif-sqr a b)

Difference of squares. Return the value of (a*a) - (b*b). This is more efficient than using separate unit generators for each -operation.

(audition - (out 0 (mul (dif-sqr (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(audition - (out 0 (let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (mul (sub (mul a a) (mul b b)) 0.125))))

2.162 (excess a b)

clipping residual. Returns the difference of the original signal -and its clipped form: (a - clip2(a,b)).

(audition - (out 0 (excess (f-sin-osc ar 1000 0) (line kr 0 1 8 do-nothing))))

(audition - (out 0 (let ((a (f-sin-osc ar 1000 0)) - (b (line kr 0 1 8 do-nothing))) - (sub a (clip2 a b)))))

2.163 (fold2 a b)

Bilateral folding. folds a to +/- b.

(audition - (out 0 (fold2 (f-sin-osc ar 1000 0) - (line kr 0 1 8 do-nothing))))

2.164 (sqr-dif a b)

Square of the difference. Return the value of (a - b)**2. This is +operation.

(audition
   (out 0 (mul (dif-sqr (f-sin-osc ar 800 0)
                        (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
               0.125)))
(audition
   (out 0 (let ((a (f-sin-osc ar 800 0))
                (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
            (mul (sub (mul a a) (mul b b)) 0.125))))

2.162 (excess a b)

clipping residual. Returns the difference of the original signal +and its clipped form: (a - clip2(a,b)).

(audition
   (out 0 (excess (f-sin-osc ar 1000 0) (line kr 0 1 8 do-nothing))))
(audition
 (out 0 (let ((a (f-sin-osc ar 1000 0))
              (b (line kr 0 1 8 do-nothing)))
          (sub a (clip2 a b)))))

2.163 (fold2 a b)

Bilateral folding. folds a to +/- b.

(audition
   (out 0 (fold2 (f-sin-osc ar 1000 0)
                 (line kr 0 1 8 do-nothing))))

2.164 (sqr-dif a b)

Square of the difference. Return the value of (a - b)**2. This is more efficient than using separate unit generators for each -operation.

(audition - (out 0 (mul (sqr-dif (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (mul (sub a b) (sub a b)) - 0.125))))

2.165 (hypot x y)

Returns the square root of the sum of the squares of a and b. Or -equivalently, the distance from the origin to the point (x, y).

(audition - (out 0 (mul (sin-osc ar 440 0) - (hypot (mouse-x kr 0 0.1 0 0.1) - (mouse-y kr 0 0.1 0 0.1)))))

Object travels 200 meters in 6 secs (=120kph) passing 10 meters -from the listener. The speed of sound is 344 meters/sec.

(let* ((x 10) - (y (mul (lf-saw kr 1/6 0) 100)) - (distance (hypot x y)) - (velocity (slope distance)) - (pitch-ratio (fdiv (sub 344 velocity) 344)) - (amplitude (fdiv 10 (squared distance)))) - (audition - (out 0 (mul (f-sin-osc ar (mul 1000 pitch-ratio) 0) - amplitude))))

(let* ((x 10) - (y (mul (lf-saw kr 1/6 0) 100)) - (distance (hypot x y)) - (amplitude (fdiv 40 (squared distance))) - (sound (rlpf (mul (f-sin-osc ar 200 0) (lf-pulse ar 31.3 0 0.4)) 400 0.3))) - (audition - (out 0 (mul (delay-l sound 110/344 (fdiv distance 344)) - amplitude))))

2.166 (sqr-sum a b)

Square of the difference. Return the value of (a + b)**2. This is +operation.

(audition
 (out 0 (mul (sqr-dif (f-sin-osc ar 800 0)
                      (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (mul (sub a b) (sub a b))
               0.125))))

2.165 (hypot x y)

Returns the square root of the sum of the squares of a and b. Or +equivalently, the distance from the origin to the point (x, y).

(audition
   (out 0 (mul (sin-osc ar 440 0)
               (hypot (mouse-x kr 0 0.1 0 0.1)
                      (mouse-y kr 0 0.1 0 0.1)))))

Object travels 200 meters in 6 secs (=120kph) passing 10 meters +from the listener. The speed of sound is 344 meters/sec.

(let* ((x 10)
       (y (mul (lf-saw kr 1/6 0) 100))
       (distance (hypot x y))
       (velocity (slope distance))
       (pitch-ratio (fdiv (sub 344 velocity) 344))
       (amplitude (fdiv 10 (squared distance))))
  (audition
   (out 0 (mul (f-sin-osc ar (mul 1000 pitch-ratio) 0)
               amplitude))))
(let* ((x 10)
       (y (mul (lf-saw kr 1/6 0) 100))
       (distance (hypot x y))
       (amplitude (fdiv 40 (squared distance)))
       (sound (rlpf (mul (f-sin-osc ar 200 0) (lf-pulse ar 31.3 0 0.4)) 400 0.3)))
  (audition
   (out 0 (mul (delay-l sound 55/172 (fdiv distance 344))
               amplitude))))

2.166 (sqr-sum a b)

Square of the difference. Return the value of (a + b)**2. This is more efficient than using separate unit generators for each -operation.

(audition - (out 0 (mul (sqr-sum (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (mul (add a b) (add a b)) - 0.125))))

2.167 (sum-sqr a b)

Return the value of (a*a) + (b*b). This is more efficient than -using separate unit generators for each operation.

(audition - (out 0 (mul (sum-sqr (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (add (mul a a) (mul b b)) 0.125))))

2.168 (le a b)

See gt

2.169 See gt

2.170 (scale-neg a b)

Scale negative part of input wave. a * b when a < 0, otherwise a.

(audition - (out 0 (scale-neg (f-sin-osc ar 500 0) (line ar 1 -1 4 remove-synth))))

2.171 (ring2 a b)

Ring modulation plus both sources. Return the value of ((a*b) + a +operation.

(audition
 (out 0 (mul (sqr-sum (f-sin-osc ar 800 0)
                      (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (mul (add a b) (add a b))
               0.125))))

2.167 (sum-sqr a b)

Return the value of (a*a) + (b*b). This is more efficient than +using separate unit generators for each operation.

(audition
 (out 0 (mul (sum-sqr (f-sin-osc ar 800 0)
                      (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (add (mul a a) (mul b b)) 0.125))))

2.168 (le a b)

See gt

2.169 eq

See gt

2.170 (scale-neg a b)

Scale negative part of input wave. a * b when a < 0, otherwise a.

(audition
 (out 0 (scale-neg (f-sin-osc ar 500 0) (line ar 1 -1 4 remove-synth))))

2.171 (ring2 a b)

Ring modulation plus both sources. Return the value of ((a*b) + a + b). This is more efficient than using separate unit generators -for the multiply and add.

See also mul, Ring1, Ring3, Ring4.

(audition - (out 0 (mul (ring2 (f-sin-osc ar 800 0) - (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) - 0.125)))

(let ((a (f-sin-osc ar 800 0)) - (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) - (audition - (out 0 (mul (add3 (mul a b) a b) 0.125))))

2.172 (Mod a b)

Modulo, written % in sclang. outputs a modulo b.

(audition - (out 0 (u:mod (f-sin-osc ar 100 4) 1)))

2.173 (fdiv a b)

Division, written ’/’ in sclang.

Division can be tricky with signals because of division by zero.

(audition - (out 0 (fdiv (mul (pink-noise ar) 0.1) - (mul (f-sin-osc kr 10 0.5) 0.75))))

2.174 (mul a b)

multiplication, written ’*’ in sclang.

(audition - (out 0 (mul (sin-osc ar 440 0) 0.5)))

Creates a beating effect (subaudio rate).

(audition - (out 0 (mul3 (f-sin-osc kr 10 0) - (pink-noise ar) - 0.5)))

Ring modulation.

(audition - (out 0 (mul3 (sin-osc ar (x-line kr 100 1001 10 do-nothing) 0) - (sync-saw ar 100 200) - 0.25)))

2.175 (min a b)

Minimum.

(audition - (out 0 (let ((z (f-sin-osc ar 500 0))) - (u:min z (f-sin-osc ar 0.1 0)))))

2.176 (lt a b)

See gt

2.177 (wrap2 a b)

Bilateral wrapping. wraps input wave to +/- b.

(audition - (out 0 (wrap2 (f-sin-osc ar 1000 0) - (line kr 0 1.01 8 do-nothing))))

2.178 (round a b)

Rounds a to the nearest multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1)) - (f (u:round x 100))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

(let ((n (line kr 24 108 6 remove-synth))) - (audition - (out 0 (mul (saw ar (midi-cps (u:round n 1))) 0.2))))

2.179 (hasher in)

Returns a unique output value from zero to one for each input value +for the multiply and add.

See also mul, Ring1, Ring3, Ring4.

(audition
 (out 0 (mul (ring2 (f-sin-osc ar 800 0)
                    (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))
             0.125)))
(let ((a (f-sin-osc ar 800 0))
      (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)))
  (audition
   (out 0 (mul (add3 (mul a b) a b) 0.125))))

2.172 (Mod a b)

Modulo, written % in sclang. outputs a modulo b.

(audition
   (out 0 (u:mod (f-sin-osc ar 100 4) 1)))

2.173 (fdiv a b)

Division, written ’/’ in sclang.

Division can be tricky with signals because of division by zero.

(audition
   (out 0 (fdiv (mul (pink-noise ar) 0.1)
                (mul (f-sin-osc kr 10 0.5) 0.75))))

2.174 (mul a b)

multiplication, written ’*’ in sclang.

(audition
 (out 0 (mul (sin-osc ar 440 0) 0.5)))

Creates a beating effect (subaudio rate).

(audition
 (out 0 (mul3 (f-sin-osc kr 10 0)
              (pink-noise ar)
              0.5)))

Ring modulation.

(audition
 (out 0 (mul3 (sin-osc ar (x-line kr 100 1001 10 do-nothing) 0)
              (sync-saw ar 100 200)
              0.25)))

2.175 (min a b)

Minimum.

(audition
 (out 0 (let ((z (f-sin-osc ar 500 0)))
          (u:min z (f-sin-osc ar 0.1 0)))))

2.176 (lt a b)

See gt

2.177 (wrap2 a b)

Bilateral wrapping. wraps input wave to +/- b.

(audition
 (out 0 (wrap2 (f-sin-osc ar 1000 0)
               (line kr 0 1.01 8 do-nothing))))

2.178 (round a b)

Rounds a to the nearest multiple of b.

(let* ((x (mouse-x kr 60 4000 0 0.1))
       (f (u:round x 100)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))
(let ((n (line kr 24 108 6 remove-synth)))
  (audition
   (out 0 (mul (saw ar (midi-cps (u:round n 1))) 0.2))))

2.179 (hasher in)

Returns a unique output value from zero to one for each input value according to a hash function. The same input value will always produce the same output value. The input need not be from zero to -one.

(audition (out 0 (mul (hasher (line ar 0 1 1 2)) 0.2)))

2.180 (rand-seed rate trig seed)

When the trigger signal changes from nonpositive to positve, the +one.

(audition (out 0 (mul (hasher (line ar 0 1 1 2)) 0.2)))

2.180 (rand-seed rate trig seed)

When the trigger signal changes from nonpositive to positve, the synth’s random generator seed is reset to the given value. All other synths that use the same random number generator reproduce -the same sequence of numbers again.

See also: randID.

Start a noise patch

(let ((n (add (mul (white-noise ar) (mce2 0.05 0.05)) (dust2 ar (mce2 70 70)))) - (f (mul-add (lf-noise1 kr 3) 5500 6000))) - (audition (out 0 (add (resonz (mul n 5) f 0.5) (mul n 0.5)))))

Reset the seed at a variable rate.

(audition (mrg2 (rand-seed kr (impulse kr (mouse-x kr 0.1 100 0 0.1) 0) 1956) - 0))

2.181 (lfd-noise0 rate freq)

(lfd-noise1 rate freq) +the same sequence of numbers again.

See also: randID.

Start a noise patch

(let ((n (add (mul (white-noise ar) (mce2 0.05 0.05)) (dust2 ar (mce2 70 70))))
      (f (mul-add (lf-noise1 kr 3) 5500 6000)))
  (audition (out 0 (add (resonz (mul n 5) f 0.5) (mul n 0.5)))))

Reset the seed at a variable rate.

(audition (mrg2 (rand-seed kr (impulse kr (mouse-x kr 0.1 100 0 0.1) 0) 1956)
                0))

2.181 (lfd-noise0 rate freq)

(lfd-noise1 rate freq) (lfd-noise3 rate freq)

lfd-noise0: Dynamic step noise. Like lf-noise0, it generates random values at a rate given by the freq argument, with two differences: no time quantization, and fast recovery from low freq values.

lfd-noise1: Dynamic ramp noise. Like lf-noise1, it generates linearly @@ -2081,284 +408,70 @@ argument, with two differences: no time quantization, and fast recovery from low freq values.

lf-noise0,1,3 quantize to the nearest integer division of the samplerate, and they poll the freq argument only when scheduled, and thus seem to hang when freqs get very low).

If you don’t need very high or very low freqs, or use fixed freqs, -lf-noise0,1,3 is more efficient.

Try wiggling mouse quicklyLf-Noise frequently seems stuck, -LFDNoise changes smoothly.

(audition - (out 0 (mul (lf-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1)))

(audition - (out 0 (mul (lfd-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1)))

silent for 2 secs before going up in freq

(audition - (out 0 (mul (lf-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1)))

(audition - (out 0 (mul (lfd-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1)))

lf-noise quantizes time steps at high freqs, lfd-noise does not:

(audition - (out 0 (mul (lf-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1)))

(audition - (out 0 (mul (lfd-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1)))

2.182 (lfclip-noise rate freq)

randomly generates the values -1 or +1 at a rate given by the +lf-noise0,1,3 is more efficient.

Try wiggling mouse quickly; Lf-Noise frequently seems stuck, +LFDNoise changes smoothly.

(audition
 (out 0 (mul (lf-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1)))
(audition
 (out 0 (mul (lfd-noise0 ar (mouse-x kr 0.1 1000 1 0.1)) 0.1)))

silent for 2 secs before going up in freq

(audition
 (out 0 (mul (lf-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1)))
(audition
 (out 0 (mul (lfd-noise0 ar (x-line kr 0.5 10000 3 remove-synth)) 0.1)))

lf-noise quantizes time steps at high freqs, lfd-noise does not:

(audition
 (out 0 (mul (lf-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1)))
(audition
 (out 0 (mul (lfd-noise0 ar (x-line kr 1000 20000 10 remove-synth)) 0.1)))

2.182 (lfclip-noise rate freq)

randomly generates the values -1 or +1 at a rate given by the nearest integer division of the sample rate by the freq argument. It is probably pretty hard on your speakers. The freq argument is -the approximate rate at which to generate random values.

(audition (out 0 (mul (lfclip-noise ar 1000) 0.1)))

Modulate frequency

(let ((f (x-line kr 1000 10000 10 remove-synth))) - (audition (out 0 (mul (lfclip-noise ar f) 0.1))))

Use as frequency control

(let ((f (mul-add (lfclip-noise kr 4) 200 600))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.183 See lf-noise0

2.184 (clip-noise rate)

Generates noise whose values are either -1 or 1. This produces the -maximum energy for the least peak to peak amplitude.

(audition (out 0 (mul (clip-noise ar) 0.2)))

2.185 (ti-rand lo hi trig)

Generates a random integer value in uniform distribution from lo to +the approximate rate at which to generate random values.

(audition (out 0 (mul (lfclip-noise ar 1000) 0.1)))

Modulate frequency

(let ((f (x-line kr 1000 10000 10 remove-synth)))
  (audition (out 0 (mul (lfclip-noise ar f) 0.1))))

Use as frequency control

(let ((f (mul-add (lfclip-noise kr 4) 200 600)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.183 See lf-noise0

2.184 (clip-noise rate)

Generates noise whose values are either -1 or 1. This produces the +maximum energy for the least peak to peak amplitude.

(audition (out 0 (mul (clip-noise ar) 0.2)))

2.185 (ti-rand lo hi trig)

Generates a random integer value in uniform distribution from lo to hi each time the trig signal changes from nonpositive to positive -values

(let ((p (ti-rand -1 1 (dust kr 10)))) - (audition (out 0 (pan2 (pink-noise ar) p 0.2))))

(let ((f (mul-add (ti-rand 4 12 (dust kr 10)) 150 (mce2 0 1)))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.186 (lf-noise0 rate freq)

(lf-noise1 rate freq) +values

(let ((p (ti-rand -1 1 (dust kr 10))))
  (audition (out 0 (pan2 (pink-noise ar) p 0.2))))
(let ((f (mul-add (ti-rand 4 12 (dust kr 10)) 150 (mce2 0 1))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.186 (lf-noise0 rate freq)

(lf-noise1 rate freq) (lf-noise2 rate freq)

lf-noise0 is step noise. Generates random values at a rate given by the nearest integer division of the sample rate by the freq argument.

lf-noise1 is ramp noise. Generates linearly interpolated random values at a rate given by the nearest integer division of the sample rate by the freq argument.

lf-noise2 is quadratic noise. Generates quadratically interpolated random values at a rate given by the nearest integer division of -the sample rate by the freq argument.

(audition (out 0 (mul (lf-noise0 ar 1000) 0.25))) -(audition (out 0 (mul (lf-noise1 ar 1000) 0.25))) -(audition (out 0 (mul (lf-noise2 ar 1000) 0.25)))

Modulate frequency.

(audition (out 0 (mul (lf-noise0 ar (x-line kr 1000 10000 10 remove-synth)) 0.25))) -(audition (out 0 (mul (lf-noise1 ar (x-line kr 1000 10000 10 remove-synth)) 0.25))) -(audition (out 0 (mul (lf-noise2 ar (x-line kr 1000 10000 10 remove-synth)) 0.25)))

Use as frequency control.

(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise0 kr 4) 400 450) 0) 0.2))) -(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise1 kr 4) 400 450) 0) 0.2))) -(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise2 kr 4) 400 450) 0) 0.2)))

2.187 (pink-noise rate)

Generates noise whose spectrum falls off in power by 3 dB per +the sample rate by the freq argument.

(audition (out 0 (mul (lf-noise0 ar 1000) 0.25)))

(audition (out 0 (mul (lf-noise1 ar 1000) 0.25)))

(audition (out 0 (mul (lf-noise2 ar 1000) 0.25)))

Modulate frequency.

(audition (out 0 (mul (lf-noise0 ar (x-line kr 1000 10000 10 remove-synth)) 0.25)))

(audition (out 0 (mul (lf-noise1 ar (x-line kr 1000 10000 10 remove-synth)) 0.25)))

(audition (out 0 (mul (lf-noise2 ar (x-line kr 1000 10000 10 remove-synth)) 0.25)))

Use as frequency control.

(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise0 kr 4) 400 450) 0) 0.2)))

(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise1 kr 4) 400 450) 0) 0.2)))

(audition (out 0 (mul (sin-osc ar (mul-add (lf-noise2 kr 4) 400 450) 0) 0.2)))

2.187 (pink-noise rate)

Generates noise whose spectrum falls off in power by 3 dB per octave. This gives equal power over the span of each octave. This -version gives 8 octaves of pink noise.

(audition (out 0 (mul (pink-noise ar) 0.25)))

2.188 (rand lo hi)

Generates a single random value in uniform distribution from lo to +version gives 8 octaves of pink noise.

(audition (out 0 (mul (pink-noise ar) 0.25)))

2.188 (rand lo hi)

Generates a single random value in uniform distribution from lo to hi. It generates this when the SynthDef first starts playing, and -remains fixed for the duration of the synth’s existence.

(let* ((a (line kr 0.2 0 0.1 2)) - (p (rand -1 1)) - (s (mul (f-sin-osc ar (rand 200 1200) 0) a))) - (audition (out 0 (pan2 s p 1))))

2.189 (gray-noise rate)

Generates noise which results from flipping random bits in a word. +remains fixed for the duration of the synth’s existence.

(let* ((a (line kr 0.2 0 0.1 2))
       (p (rand -1 1))
       (s (mul (f-sin-osc ar (rand 200 1200) 0) a)))
  (audition (out 0 (pan2 s p 1))))

2.189 (gray-noise rate)

Generates noise which results from flipping random bits in a word. This type of noise has a high RMS level relative to its peak to -peak level. The spectrum is emphasized towards lower frequencies.

(audition (out 0 (mul (gray-noise ar) 0.1)))

2.190 See lfd-noise0

2.191 (i-rand lo hi)

Generates a single random integer value in uniform distribution -from ‘lo’ to ‘hi’.

(let ((f (i-rand 200 1200)) - (a (line kr 0.2 0 0.1 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.192 (n-rand lo hi n)

Generates a single random float value in a sum of ‘n’ uniform +peak level. The spectrum is emphasized towards lower frequencies.

(audition (out 0 (mul (gray-noise ar) 0.1)))

2.190 See lfd-noise0

2.191 (i-rand lo hi)

Generates a single random integer value in uniform distribution +from ‘lo’ to ‘hi’.

(let ((f (i-rand 200 1200))
      (a (line kr 0.2 0 0.1 remove-synth)))
  (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.192 (n-rand lo hi n)

Generates a single random float value in a sum of ‘n’ uniform distributions from ‘lo’ to ‘hi’.

n = 1 : uniform distribution - same as rand n = 2 : triangular distribution n = 3 : smooth hump -as n increases, distribution converges towards gaussian

(let ((f (mul (n-rand 1200 4000 2) (mce2 2 5))) - (a (line kr 0.2 0 0.01 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.193 (lfdclip-noise rate freq)

Like lfclip-noise, it generates the values -1 or +1 at a rate given +as n increases, distribution converges towards gaussian

(let ((f (mul (n-rand 1200 4000 2) (mce2 2 5)))
      (a (line kr 0.2 0 0.01 remove-synth)))
  (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.193 (lfdclip-noise rate freq)

Like lfclip-noise, it generates the values -1 or +1 at a rate given by the freq argument, with two differences: no time quantization, and fast recovery from low freq values.

(lfclip-noise, as well as lf-noise0,1,2 quantize to the nearest integer division of the samplerate, and they poll the freq argument only when scheduled, and thus seem to hang when freqs get very low).

If you don’t need very high or very low freqs, or use fixed freqs, -lfclip-noise is more efficient.

Try wiggling mouse quicklyLFNoise frequently seems stuck, -LFDNoise changes smoothly.

(let ((f (mul-add (lfclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

(let ((f (mul-add (lfdclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

LFNoise quantizes time steps at high freqs, LFDNoise does not:

(let ((f (x-line kr 1000 20000 10 remove-synth))) - (audition (out 0 (mul (lfclip-noise ar f) 0.1))))

(let ((f (x-line kr 1000 20000 10 remove-synth))) - (audition (out 0 (mul (lfdclip-noise ar f) 0.1))))

2.194 (coin-gate prob in)

When it receives a trigger, it tosses a coin, and either passes the -trigger or doesn’t.

(let ((f (t-rand 300 400 (Coingate 0.8 (impulse kr 10 0))))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

(let* ((p 0.2) - (t (mul (impulse ar 20 0) (add (sin-osc kr 0.5 0) 1))) - (t* (t-exp-rand (Mce 1000 1000) 12000 t)) - (i (lambda () (Coingate (+ p (rand 0 0.1)) (mul t 0.5)))) - (s (lambda () (ringz (i) t* 0.01))) - (ignore (lambda (f) (lambda (_) (f))))) - (audition (out 0 (mix/fill 3 (ignore s)))))

2.195 (t-exp-rand lo hi trig)

Generates a random float value in exponential distribution from lo +lfclip-noise is more efficient.

Try wiggling mouse quickly; LFNoise frequently seems stuck, +LFDNoise changes smoothly.

(let ((f (mul-add (lfclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let ((f (mul-add (lfdclip-noise ar (mouse-x kr 0.1 1000 1 0.1)) 200 500)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

LFNoise quantizes time steps at high freqs, LFDNoise does not:

(let ((f (x-line kr 1000 20000 10 remove-synth)))
  (audition (out 0 (mul (lfclip-noise ar f) 0.1))))
(let ((f (x-line kr 1000 20000 10 remove-synth)))
  (audition (out 0 (mul (lfdclip-noise ar f) 0.1))))

2.194 (coin-gate prob in)

When it receives a trigger, it tosses a coin, and either passes the +trigger or doesn’t.

(let ((f (t-rand 300 400 (Coingate 0.8 (impulse kr 10 0)))))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((p 0.2)
       (t (mul (impulse ar 20 0) (add (sin-osc kr 0.5 0) 1)))
       (t* (t-exp-rand (Mce 1000 1000) 12000 t))
       (i (lambda () (Coingate (+ p (rand 0 0.1)) (mul t 0.5))))
       (s (lambda () (ringz (i) t* 0.01)))
       (ignore (lambda (f) (lambda (_) (f)))))
  (audition (out 0 (mix/fill 3 (ignore s)))))

2.195 (t-exp-rand lo hi trig)

Generates a random float value in exponential distribution from lo to hi each time the trig signal changes from nonpositive to positive values lo and hi must both have the same sign and be -non-zero.

(let* ((t (dust kr 10)) - (f (t-exp-rand 300 3000 t))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.196 (t-rand lo hi trig)

Generates a random float value in uniform distribution from lo each -time the trig signal changes from nonpositive to positive values

(let* ((t (dust kr (mce2 5 12))) - (f (t-rand (mce2 200 1600) (mce2 500 3000) t))) - (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.197 (white-noise rate)

Generates noise whose spectrum has equal power at all frequencies.

(audition (out 0 (mul (white-noise ar) 0.15)))

Noise generators constructors are unique, to share noise UGens -values must be explictly stored and reused.

(audition (out 0 (mul (sub (white-noise ar) (white-noise ar)) 0.15)))

(let ((n (white-noise ar))) - (audition (out 0 (sub n n))))

2.198 (dust2 rate density)

Generates random impulses from -1 to +1. The ‘density’ is in -impulses per second.

(audition (out 0 (mul (dust2 ar 200) 0.5)))

(let ((r (x-line kr 20000 2 10 remove-synth))) - (audition (out 0 (mul (dust2 ar r) 0.5))))

2.199 See lfd-noise0

2.200 (rand-id rate id)

Choose which random number generator to use for this synth. All +non-zero.

(let* ((t (dust kr 10))
       (f (t-exp-rand 300 3000 t)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.196 (t-rand lo hi trig)

Generates a random float value in uniform distribution from lo each +time the trig signal changes from nonpositive to positive values

(let* ((t (dust kr (mce2 5 12)))
       (f (t-rand (mce2 200 1600) (mce2 500 3000) t)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.2))))

2.197 (white-noise rate)

Generates noise whose spectrum has equal power at all frequencies.

(audition (out 0 (mul (white-noise ar) 0.15)))

Noise generators constructors are unique, to share noise UGens +values must be explictly stored and reused.

(audition (out 0 (mul (sub (white-noise ar) (white-noise ar)) 0.15)))

(let ((n (white-noise ar)))
  (audition (out 0 (sub n n))))

2.198 (dust2 rate density)

Generates random impulses from -1 to +1. The ‘density’ is in +impulses per second.

(audition (out 0 (mul (dust2 ar 200) 0.5)))

(let ((r (x-line kr 20000 2 10 remove-synth)))
  (audition (out 0 (mul (dust2 ar r) 0.5))))

2.199 See lfd-noise0

2.200 (rand-id rate id)

Choose which random number generator to use for this synth. All synths that use the same generator reproduce the same sequence of numbers when the same seed is set again.

See also: rand-seed.

Graphs to generate noise in the context of a given RNG and to reset -a specified RNG.

(with-sc3 - (lambda (fd) - (send-synth - fd "r" - (letc ((bus 0) - (id 1)) - (mrg2 (rand-id ir id) - (out bus (add (mul (white-noise ar) 0.05) - (dust2 ar 70)))))) - (send-synth - fd "s" - (letc ((seed 1910) (id 1)) - (mrg2 (rand-id kr id) - (rand-seed kr - (impulse kr (mul-add (f-sin-osc kr 0.2 0) 10 11) 0) - seed))))))

Start two noise synths on left and right channel with a different randgen id

(with-sc3 - (lambda (fd) - (send fd (s-new2 "r" 1001 1 1 "bus" 0 "id" 1)) - (send fd (s-new2 "r" 1002 1 1 "bus" 1 "id" 2))))

Reset the seed of randgen 1

(with-sc3 (lambda (fd) (send fd (s-new1 "s" 1003 1 1 "id" 1))))

Change the target RNG with ID 2, ie. effect right channel.

(with-sc3 (lambda (fd) (send fd (n-set1 1003 "id" 2))))

free noise nodes.

(with-sc3 - (lambda (fd) - (send fd (n-free1 1001)) - (send fd (n-free1 1002)) - (send fd (n-free1 1003))))

2.201 See lf-noise0

2.202 (mantissa-mask in bits)

Masks off bits in the mantissa of the floating point sample +a specified RNG.

(with-sc3
 (lambda (fd)
   (send-synth
    fd "r"
    (letc ((bus 0)
           (id 1))
      (mrg2 (rand-id ir id)
            (out bus (add (mul (white-noise ar) 0.05)
                          (dust2 ar 70))))))
   (send-synth
    fd "s"
    (letc ((seed 1910) (id 1))
      (mrg2 (rand-id kr id)
            (rand-seed kr
                       (impulse kr (mul-add (f-sin-osc kr 0.2 0) 10 11) 0)
                       seed))))))

Start two noise synths on left and right channel with a different randgen id

(with-sc3
 (lambda (fd)
   (send fd (s-new2 "r" 1001 1 1 "bus" 0 "id" 1))
   (send fd (s-new2 "r" 1002 1 1 "bus" 1 "id" 2))))

Reset the seed of randgen 1

(with-sc3 (lambda (fd) (send fd (s-new1 "s" 1003 1 1 "id" 1))))

Change the target RNG with ID 2, ie. effect right channel.

(with-sc3 (lambda (fd) (send fd (n-set1 1003 "id" 2))))

free noise nodes.

(with-sc3
 (lambda (fd)
   (send fd (n-free1 1001))
   (send fd (n-free1 1002))
   (send fd (n-free1 1003))))

2.201 See lf-noise0

2.202 (mantissa-mask in bits)

Masks off bits in the mantissa of the floating point sample value. This introduces a quantization noise, but is less severe than linearly quantizing the signal.

in - input signal -bits - the number of mantissa bits to preserve. a number from 0 to 23.

(let ((s (mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 500) 0) 0.4))) - (audition (out 0 (mantissa-mask s 3))))

2.203 (dust rate density)

Generates random impulses from 0 to +1 at a rate determined by the -density argument.

(audition (out 0 (mul (dust ar 200) 0.5)))

(let ((r (x-line kr 20000 2 10 remove-synth))) - (audition (out 0 (mul (dust ar r) 0.5))))

2.204 (lin-rand lo hi minmax)

Generates a single random float value in linear distribution from +bits - the number of mantissa bits to preserve. a number from 0 to 23.

(let ((s (mul (sin-osc ar (mul-add (sin-osc kr 0.2 0) 400 500) 0) 0.4)))
  (audition (out 0 (mantissa-mask s 3))))

2.203 (dust rate density)

Generates random impulses from 0 to +1 at a rate determined by the +density argument.

(audition (out 0 (mul (dust ar 200) 0.5)))

(let ((r (x-line kr 20000 2 10 remove-synth)))
  (audition (out 0 (mul (dust ar r) 0.5))))

2.204 (lin-rand lo hi minmax)

Generates a single random float value in linear distribution from lo to hi, skewed towards lo if minmax < 0, otherwise skewed towards -hi.

(let ((f (lin-rand 200 10000 (mce2 -1 1))) - (a (line kr 0.4 0 0.01 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.205 (exp-rand lo hi)

Generates a single random float value in an exponential -distributions from ‘lo’ to ‘hi’.

(let ((f (exp-rand 100 8000)) - (a (line kr 0.5 0 0.01 remove-synth))) - (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.206 (brown-noise rate)

Generates noise whose spectrum falls off in power by 6 dB per -octave.

(audition (out 0 (mul (brown-noise ar) 0.1)))

2.207 (u:log a)

Reciprocal.

(let* ((a (line ar -2 2 2 remove-synth)) - (b (u:log a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.208 (frac a)

Fractional part.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (frac a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.209 (arc-tan a)

Arc tan.

(let* ((a (line kr -1 1 1 remove-synth)) - (b (sub (fdiv (arc-tan a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.210 (distort a)

Nonlinear distortion.

(audition - (out 0 (mul (distort (mul (f-sin-osc ar 500 0.0) - (x-line kr 0.1 10 10 do-nothing))) - 0.25)))

2.211 (tan-h a)

Tangent.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (tan-h a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.212 (u:floor a)

Round signal down.

(let* ((x (mouse-x kr 65 95 0 0.1)) - (f (midi-cps (u:floor x)))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.213 (cps-oct a)

Convert cycles per second to decimal octaves.

(audition - (let ((f (oct-cps (cps-oct (x-line kr 600 900 6 remove-synth))))) - (out 0 (mul (saw ar f) 0.2))))

2.214 (db-amp a)

Convert decibels to linear amplitude.

(audition - (out 0 (mul (f-sin-osc ar 800 0.0) - (db-amp (line kr -3 -40 10 remove-synth)))))

2.215 (u:sqrt a)

Square root. The definition of square root is extended for signals -so that sqrt(a) when a<0 returns -sqrt(-a).

(let* ((a (line ar -2 2 3 remove-synth)) - (b (u:sqrt a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.216 (soft-clip a)

Nonlinear distortion. Distortion with a perfectly linear region -from -0.5 to +0.5.

(audition - (out 0 (mul (soft-clip (mul (f-sin-osc ar 500 0.0) - (x-line kr 0.1 10 10 do-nothing))) - 0.25)))

2.217 (cps-midi a)

Convert cycles per second to MIDI note.

(let ((f (line kr 600 900 5 remove-synth))) - (audition - (out 0 (mul (saw ar (midi-cps (cps-midi f))) 0.1))))

2.218 (is-strictly-positive a)

Predicate to determine if a value is strictly positive.

(define (is-strictly-positive a) - (gt a 0.0))

(let* ((a (line ar -1 1 1 remove-synth)) - (b (is-strictly-positive a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.219 (u:tan a)

Tangent.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (u:tan a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.220 (cos-h a)

Cosine.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (cos-h a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.221 (amp-db a)

Convert linear amplitude to decibels.

(audition - (out 0 (mul (f-sin-osc ar 800 0.0) - (db-amp (amp-db (line kr 0.5 0.0 5 remove-synth))))))

(let* ((x (mouse-x kr -60 0 0 0.1)) - (f (mul-add (db-amp x) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.222 (abs a)

Absolute value.

(audition (out 0 (u:abs (mul (sync-saw ar 100 440) 0.1))))

2.223 (log10 a)

Base ten logarithm.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (log10 a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.224 (midi-cps a)

Convert MIDI note to cycles per second.

(audition - (out 0 (mul (saw ar (midi-cps (line kr 24 108 10 remove-synth))) 0.2)))

2.225 (is-positive a)

Predicate to determine if a value is positive.

(define (is-positive a) - (ge a 0.0))

(let* ((a (line ar -1 1 1 remove-synth)) - (b (is-positive a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.226 (sign a)

Sign function. -1 when a < 0, +1 when a > 0, 0 when a is 0

(let* ((a (line ar -1 1 1 remove-synth)) - (b (sign a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.227 (neg a)

Negation.

(let ((s (sin-osc ar 440 0))) - (audition - (out 0 (mce2 (mul s 0.1) - (add s (neg s))))))

2.228 (log2 a)

Base two logarithm.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (log2 a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.229 (ceil a)

Round signal up.

(let* ((x (mouse-x kr 65 95 0 0.1)) - (f (midi-cps (mce2 (u:floor x) (ceil x))))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.230 (arc-cos a)

Arc cosine.

(let* ((a (line kr -1 1 1 remove-synth)) - (b (sub (fdiv (arc-cos a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.231 (exp a)

Exponential.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (u:exp a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.232 (squared a)

Square.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (squared a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.233 (arc-sin a)

Arc sine.

(let* ((a (line kr -1 1 1 remove-synth)) - (b (sub (fdiv (arc-sin a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.234 (cubed a)

Cube.

(let* ((a (line ar -2 2 3 remove-synth)) - (b (cubed a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.235 (is-negative a)

Predicate to determine if a value is negative.

(define (is-negative a) - (lt a 0.0))

(let* ((a (line ar -1 1 1 remove-synth)) - (b (is-negative a)) - (f (mul-add (mce2 a b) 600 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.236 (oct-cps a)

Convert decimal octaves to cycles per second.

(audition - (let ((f (oct-cps (line kr 2 9 6 remove-synth)))) - (out 0 (mul (saw ar f) 0.2))))

(audition - (let ((f (oct-cps (u:round (line kr 2 9 6 remove-synth) (/ 1 12))))) - (out 0 (mul (saw ar f) 0.2))))

2.237 (u:sin a)

Sine.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (u:sin a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.238 (sin-h a)

Sine.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (sin-h a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.239 (cos a)

Cosine.

(let* ((a (line kr (- pi) pi 1 remove-synth)) - (b (sub (fdiv (u:cos a) (/ pi 2)) 1)) - (f (mul-add b 900 1600))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.1))))

2.240 (pv-mul bufferA bufferB)

2.241 (pv-mag-squared buffer)

2.242 (pv-min bufferA bufferB)

2.243 (pv-mag-noise buffer)

Magnitudes are multiplied with noise.

buffer - fft buffer.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (h (pv-mag-noise f))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.244 (pv-mag-below buffer threshold)

Pass bins below a threshold. Pass only bands where the magnitude +hi.

(let ((f (lin-rand 200 10000 (mce2 -1 1)))
      (a (line kr 0.4 0 0.01 remove-synth)))
  (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.205 (exp-rand lo hi)

Generates a single random float value in an exponential +distributions from ‘lo’ to ‘hi’.

(let ((f (exp-rand 100 8000))
      (a (line kr 0.5 0 0.01 remove-synth)))
  (audition (out 0 (mul (f-sin-osc ar f 0) a))))

2.206 (brown-noise rate)

Generates noise whose spectrum falls off in power by 6 dB per +octave.

(audition (out 0 (mul (brown-noise ar) 0.1)))

2.207 (u:log a)

Reciprocal.

(let* ((a (line ar -2 2 2 remove-synth))
       (b (u:log a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.208 (frac a)

Fractional part.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (frac a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.209 (arc-tan a)

Arc tan.

(let* ((a (line kr -1 1 1 remove-synth))
       (b (sub (fdiv (arc-tan a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.210 (distort a)

Nonlinear distortion.

(audition
   (out 0 (mul (distort (mul (f-sin-osc ar 500 0.0)
                             (x-line kr 0.1 10 10 do-nothing)))
               0.25)))

2.211 (tan-h a)

Tangent.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (tan-h a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.212 (u:floor a)

Round signal down.

(let* ((x (mouse-x kr 65 95 0 0.1))
       (f (midi-cps (u:floor x))))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.213 (cps-oct a)

Convert cycles per second to decimal octaves.

(audition
 (let ((f (oct-cps (cps-oct (x-line kr 600 900 6 remove-synth)))))
   (out 0 (mul (saw ar f) 0.2))))

2.214 (db-amp a)

Convert decibels to linear amplitude.

(audition
   (out 0 (mul (f-sin-osc ar 800 0.0)
               (db-amp (line kr -3 -40 10 remove-synth)))))

2.215 (u:sqrt a)

Square root. The definition of square root is extended for signals +so that sqrt(a) when a<0 returns -sqrt(-a).

(let* ((a (line ar -2 2 3 remove-synth))
       (b (u:sqrt a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.216 (soft-clip a)

Nonlinear distortion. Distortion with a perfectly linear region +from -0.5 to +0.5.

(audition
 (out 0 (mul (soft-clip (mul (f-sin-osc ar 500 0.0)
                             (x-line kr 0.1 10 10 do-nothing)))
             0.25)))

2.217 (cps-midi a)

Convert cycles per second to MIDI note.

(let ((f (line kr 600 900 5 remove-synth)))
  (audition
   (out 0 (mul (saw ar (midi-cps (cps-midi f))) 0.1))))

2.218 (is-strictly-positive a)

Predicate to determine if a value is strictly positive.

(define (is-strictly-positive a)
  (gt a 0.0))
(let* ((a (line ar -1 1 1 remove-synth))
       (b (is-strictly-positive a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.219 (u:tan a)

Tangent.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (u:tan a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.220 (cos-h a)

Cosine.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (cos-h a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.221 (amp-db a)

Convert linear amplitude to decibels.

(audition
 (out 0 (mul (f-sin-osc ar 800 0.0)
             (db-amp (amp-db (line kr 0.5 0.0 5 remove-synth))))))
(let* ((x (mouse-x kr -60 0 0 0.1))
       (f (mul-add (db-amp x) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.222 (abs a)

Absolute value.

(audition (out 0 (u:abs (mul (sync-saw ar 100 440) 0.1))))

2.223 (log10 a)

Base ten logarithm.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (log10 a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.224 (midi-cps a)

Convert MIDI note to cycles per second.

(audition
 (out 0 (mul (saw ar (midi-cps (line kr 24 108 10 remove-synth))) 0.2)))

2.225 (is-positive a)

Predicate to determine if a value is positive.

(define (is-positive a)
  (ge a 0.0))
(let* ((a (line ar -1 1 1 remove-synth))
       (b (is-positive a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.226 (sign a)

Sign function. -1 when a < 0, +1 when a > 0, 0 when a is 0

(let* ((a (line ar -1 1 1 remove-synth))
       (b (sign a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.227 (neg a)

Negation.

(let ((s (sin-osc ar 440 0)))
  (audition
   (out 0 (mce2 (mul s 0.1)
                (add s (neg s))))))

2.228 (log2 a)

Base two logarithm.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (log2 a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.229 (ceil a)

Round signal up.

(let* ((x (mouse-x kr 65 95 0 0.1))
       (f (midi-cps (mce2 (u:floor x) (ceil x)))))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.230 (arc-cos a)

Arc cosine.

(let* ((a (line kr -1 1 1 remove-synth))
       (b (sub (fdiv (arc-cos a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.231 (exp a)

Exponential.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (u:exp a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.232 (squared a)

Square.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (squared a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.233 (arc-sin a)

Arc sine.

(let* ((a (line kr -1 1 1 remove-synth))
       (b (sub (fdiv (arc-sin a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.234 (cubed a)

Cube.

(let* ((a (line ar -2 2 3 remove-synth))
       (b (cubed a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.235 (is-negative a)

Predicate to determine if a value is negative.

(define (is-negative a)
  (lt a 0.0))
(let* ((a (line ar -1 1 1 remove-synth))
       (b (is-negative a))
       (f (mul-add (mce2 a b) 600 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.236 (oct-cps a)

Convert decimal octaves to cycles per second.

(audition
 (let ((f (oct-cps (line kr 2 9 6 remove-synth))))
   (out 0 (mul (saw ar f) 0.2))))
(audition
 (let ((f (oct-cps (u:round (line kr 2 9 6 remove-synth) (/ 1 12)))))
   (out 0 (mul (saw ar f) 0.2))))

2.237 (u:sin a)

Sine.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (u:sin a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.238 (sin-h a)

Sine.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (sin-h a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.239 (cos a)

Cosine.

(let* ((a (line kr (- pi) pi 1 remove-synth))
       (b (sub (fdiv (u:cos a) (/ pi 2)) 1))
       (f (mul-add b 900 1600)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.1))))

2.240 (pv-mul bufferA bufferB)

2.241 (pv-mag-squared buffer)

2.242 (pv-min bufferA bufferB)

2.243 (pv-mag-noise buffer)

Magnitudes are multiplied with noise.

buffer - fft buffer.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (h (pv-mag-noise f)))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.244 (pv-mag-below buffer threshold)

Pass bins below a threshold. Pass only bands where the magnitude is below ‘threshold’. This value is not normalized and is therefore dependant on the buffer size.

See pv-mag-above

2.245 (convolution in kernel framesize)

Strict convolution of two continuously changing inputs. Also see [convolution2] for a cheaper CPU cost alternative for the case of a fixed kernel which can be changed with a trigger message.

in - processing target kernel - processing kernel. -framesize - size of fft frame, must be a power of two

(audition - (let ((input (sound-in (mce2 0 1))) - (kernel (white-noise ar))) - (out 0 (mul (convolution input kernel 2048) 0.1))))

(let ((a 2048) - (b 0)) - (with-sc3 - (lambda (fd) - (async fd (b-alloc b a 1)) - (send fd (b-set1 b 0 1.0)) - (replicate-m 100 (send fd (b-set1 b (random-integer a) (random 0.0 1.0)))) - (play fd (out 0 (mul (convolution - (sound-in (mce2 0 1)) - (play-buf 1 b (buf-rate-scale kr b) 1 0 1) - (* 2 a)) - 0.2))))))

2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) - -#| - -fft feature detector for onset detection based on work described in +framesize - size of fft frame, must be a power of two

(audition
 (let ((input (sound-in (mce2 0 1)))
       (kernel (white-noise ar)))
   (out 0 (mul (convolution input kernel 2048) 0.1))))
(let ((a 2048)
      (b 0))
  (with-sc3
   (lambda (fd)
     (async fd (b-alloc b a 1))
     (send fd (b-set1 b 0 1.0))
     (replicate-m 100 (send fd (b-set1 b (random-integer a) (random 0.0 1.0))))
     (play fd (out 0 (mul (convolution
                           (sound-in (mce2 0 1))
                           (play-buf 1 b (buf-rate-scale kr b) 1 0 1)
                           (* 2 a))
                          0.2))))))

2.246 (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime)

fft feature detector for onset detection based on work described in Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using Feature Extraction. in Proceedings of the Computer Music Modeling and Retrieval Symposium, Lecture Notes in Computer Science. springer -Verlag. - -First order derivatives of the features are taken. Threshold may -need to be set low to pick up on changes. - -buffer - fft buffer to read from. +Verlag.

First order derivatives of the features are taken. Threshold may +need to be set low to pick up on changes.

buffer - fft buffer to read from. propsc - Proportion of spectral centroid feature. prophfe - Proportion of high frequency energy feature. prophfc - Proportion of high frequency content feature. @@ -2366,29 +479,9 @@ propsf - Proportion of spectral flux feature. threshold - Threshold level for allowing a detection waittime - If triggered, minimum wait until a further frame can cause another spot (useful to stop multiple detects on - heavy signals) - -Default values in sclang are: propsc=0.25, prophfe=0.25, -prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. - -|# - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)))) - -(let* ((source (sound-in 0)) - (detect (pv-jensen-andersen (fft* 0 source) - 0.25 0.25 0.25 0.25 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1)))))

2.247 (pv-phase-shift270 buffer)

Swap the real and imaginary components of every bin at ‘buffer’ and -swap the sign of the real components.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let ((n (mul (white-noise ar) 0.1))) - (audition (out 0 (ifft* (pv-phase-shift270 (fft* 10 n))))))

2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

fft onset detector based on work described in

Hainsworth, S. (2003) Techniques for the Automated Analysis of + heavy signals)

Default values in sclang are: propsc=0.25, prophfe=0.25, +prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 2048 1))))
(let* ((source (sound-in 0))
       (detect (pv-jensen-andersen (fft* 0 source)
                                  0.25 0.25 0.25 0.25
                                  (mouse-x kr 0.01 1.0 1 0.1)
                                  0.04)))
  (audition
   (out 0 (mul (sin-osc ar (mce2 440 445) 0)
               (decay (mul 0.1 detect) 0.1)))))

2.247 (pv-phase-shift270 buffer)

Swap the real and imaginary components of every bin at ‘buffer’ and +swap the sign of the real components.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let ((n (mul (white-noise ar) 0.1)))
  (audition (out 0 (ifft* (pv-phase-shift270 (fft* 10 n))))))

2.248 (pv-hainsworth-foote buffer proph propf threshold waittime)

fft onset detector based on work described in

Hainsworth, S. (2003) Techniques for the Automated Analysis of Musical Audio. PhD, University of Cambridge engineering dept. See especially p128. The Hainsworth metric is a modification of the Kullback Liebler distance.

The onset detector has general ability to spot spectral change, so @@ -2399,162 +492,33 @@ useful in some situations: experimental.

buffer - fft buffer to read from< use. The Foote metric is normalised to [0.0,1.0]

threshold - Threshold hold level for allowing a detection

waittime - If triggered, minimum wait until a further frame can cause another spot (useful to stop multiple detects on heavy signals)

Default values in sclang are: proph=0.0, propf=0.0, threshold=1.0, -waittime=0.04.

Just Hainsworth metric with low threshold

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1))))

(let* ((source (sound-in 0)) - (detect (pv-hainsworth-foote (fft* 0 source) - 1.0 - 0.0 - (mouse-x kr 0.01 1.0 1 0.1) - 0.04))) - (audition - (out 0 (mul3 (sin-osc ar (mce2 440 445) 0) - (decay (mul 0.1 detect) 0.1) - 0.1))))

Just Hainsworth metric, spot note transitions.

(let* ((src (mul (lf-saw ar (mul-add (lf-noise0 kr 1) 90 400) 0) 0.5)) - (dtc (pv-hainsworth-foote (fft* 0 src) - 1.0 - 0.0 - 0.9 - 0.5)) - (cmp (mul (sin-osc ar 440 0) - (decay (mul 0.1 dtc) 0.1)))) - (audition - (out 0 (mul (mce2 src cmp) 0.1))))

Just Foote metric. Foote never triggers with threshold over 1.0, -threshold under mouse control.

(let* ((src (sound-in 0)) - (dtc (pv-hainsworth-foote (fft* 0 src) - 0.0 - 1.0 - (mouse-x kr 0.0 1.1 0 0.1) - 0.02)) - (cmp (mul (sin-osc ar 440 0) - (decay (mul 0.1 dtc) 0.1)))) - (audition - (out 0 (mul (mce2 src cmp) 0.1))))

2.249 (pv-phase-shift buffer shift)

add ‘shift’ to the phase component of every bin at ‘buffer’.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let ((n (mul (white-noise ar) 0.1)) - (x (mouse-x kr 0 1 0 0.1))) - (audition (out 0 (ifft* (pv-phase-shift (fft* 10 n) x)))))

2.250 (pv-copy bufferA bufferB)

Copies the spectral frame in bufferA to bufferB at that point in +waittime=0.04.

Just Hainsworth metric with low threshold

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 2048 1))))
(let* ((source (sound-in 0))
       (detect (pv-hainsworth-foote (fft* 0 source)
                                   1.0
                                   0.0
                                   (mouse-x kr 0.01 1.0 1 0.1)
                                   0.04)))
  (audition
   (out 0 (mul3 (sin-osc ar (mce2 440 445) 0)
                (decay (mul 0.1 detect) 0.1)
                0.1))))

Just Hainsworth metric, spot note transitions.

(let* ((src (mul (lf-saw ar (mul-add (lf-noise0 kr 1) 90 400) 0) 0.5))
       (dtc (pv-hainsworth-foote (fft* 0 src)
                                1.0
                                0.0
                                0.9
                                0.5))
       (cmp (mul (sin-osc ar 440 0)
                 (decay (mul 0.1 dtc) 0.1))))
  (audition
   (out 0 (mul (mce2 src cmp) 0.1))))

Just Foote metric. Foote never triggers with threshold over 1.0, +threshold under mouse control.

(let* ((src (sound-in 0))
       (dtc (pv-hainsworth-foote (fft* 0 src)
                                0.0
                                1.0
                                (mouse-x kr 0.0 1.1 0 0.1)
                                0.02))
       (cmp (mul (sin-osc ar 440 0)
                 (decay (mul 0.1 dtc) 0.1))))
  (audition
   (out 0 (mul (mce2 src cmp) 0.1))))

2.249 (pv-phase-shift buffer shift)

add ‘shift’ to the phase component of every bin at ‘buffer’.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let ((n (mul (white-noise ar) 0.1))
      (x (mouse-x kr 0 1 0 0.1)))
  (audition (out 0 (ifft* (pv-phase-shift (fft* 10 n) x)))))

2.250 (pv-copy bufferA bufferB)

Copies the spectral frame in bufferA to bufferB at that point in the chain of PV UGens. This allows for parallel processing of spectral data without the need for multiple fft UGens, and to copy out data at that point in the chain for other purposes. bufferA and bufferB must be the same size.

bufferA - source buffer. -bufferB - destination buffer.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1)) - (async fd (b-alloc 1 2048 1))))

Proof of concept, silence

(let* ((in (lfclip-noise ar 100)) - (c0 (fft* 0 in)) - (c1 (pv-copy c0 1))) - (audition (out 0 (sub (ifft* c0) (ifft* c1)))))

2.251 (pv-brick-wall buffer wipe)

Clears bins above or below a cutoff point. ‘wipe’ = a unit signal, +bufferB - destination buffer.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 2048 1))
   (async fd (b-alloc 1 2048 1))))

Proof of concept, silence

(let* ((in (lfclip-noise ar 100))
       (c0 (fft* 0 in))
       (c1 (pv-copy c0 1)))
  (audition (out 0 (sub (ifft* c0) (ifft* c1)))))

2.251 (pv-brick-wall buffer wipe)

Clears bins above or below a cutoff point. ‘wipe’ = a unit signal, from -1 to 0 the UGen acts as a low-pass filter, from 0 to 1 it -acts as a high pass filter.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let ((x (mouse-x kr -1 1 0 0.1)) - (c (fft* 10 (mul (white-noise ar) 0.2)))) - (audition (out 0 (ifft* (pv-brick-wall c x)))))

2.252 (pv-mag-smear buffer bins)

Average a bin’s magnitude with its neighbors.

buffer - fft buffer.

bins - number of bins to average on each side of bin. - As this number rises, so will CPU usage.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((dup (lambda (a) (mce2 a a))) - (in (mul (lf-saw ar 500 0) (decay2 (mul (impulse ar 2 0) 0.2) 0.01 2))) - (c0 (fft* 10 in)) - (c1 (pv-mag-smear c0 (mouse-x kr 0 100 0 0.1)))) - (audition (out 0 (mul 0.5 (dup (ifft* c1))))))

(let* ((dup (lambda (a) (mce2 a a))) - (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) - (x (mouse-x kr 0 100 0 0.1))) - (audition (out 0 (mul 0.5 (dup (ifft* (pv-mag-smear (fft* 10 s) x)))))))

2.253 (pv-mag-above buffer threshold)

Pass only bands where the magnitude is above ‘threshold’. This +acts as a high pass filter.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let ((x (mouse-x kr -1 1 0 0.1))
      (c (fft* 10 (mul (white-noise ar) 0.2))))
  (audition (out 0 (ifft* (pv-brick-wall c x)))))

2.252 (pv-mag-smear buffer bins)

Average a bin’s magnitude with its neighbors.

buffer - fft buffer.

bins - number of bins to average on each side of bin. + As this number rises, so will CPU usage.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((dup (lambda (a) (mce2 a a)))
       (in (mul (lf-saw ar 500 0) (decay2 (mul (impulse ar 2 0) 0.2) 0.01 2)))
       (c0 (fft* 10 in))
       (c1 (pv-mag-smear c0 (mouse-x kr 0 100 0 0.1))))
  (audition (out 0 (mul 0.5 (dup (ifft* c1))))))
(let* ((dup (lambda (a) (mce2 a a)))
       (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1))
       (x (mouse-x kr 0 100 0 0.1)))
  (audition (out 0 (mul 0.5 (dup (ifft* (pv-mag-smear (fft* 10 s) x)))))))

2.253 (pv-mag-above buffer threshold)

Pass only bands where the magnitude is above ‘threshold’. This value is not normalized and is therefore dependant on the buffer -size.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc 11 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (x (mouse-x kr 1 100 0 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (c1 (fft* 10 a)) - (c2 (pv-copy c1 11)) - (c3 (pv-mag-below c1 x)) - (c4 (pv-mag-above c2 x))) - (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))

(let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) - (f2 (mul-add (sin-osc kr f1 0) 100 800)) - (s (sin-osc ar f2 0)) - (x (mouse-x kr 1 1024 0 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (c1 (fft* 10 s)) - (c2 (pv-copy c1 11)) - (c3 (pv-mag-below c1 x)) - (c4 (pv-mag-above c2 x))) - (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))

2.254 (pv-bin-shift buffer stretch shift)

Shift and scale the positions of the bins. Can be used as a very +size.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc 11 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (x (mouse-x kr 1 100 0 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (c1 (fft* 10 a))
       (c2 (pv-copy c1 11))
       (c3 (pv-mag-below c1 x))
       (c4 (pv-mag-above c2 x)))
  (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))
(let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2)))
       (f2 (mul-add (sin-osc kr f1 0) 100 800))
       (s (sin-osc ar f2 0))
       (x (mouse-x kr 1 1024 0 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (c1 (fft* 10 s))
       (c2 (pv-copy c1 11))
       (c3 (pv-mag-below c1 x))
       (c4 (pv-mag-above c2 x)))
  (audition (out 0 (mul (mce2 (ifft* c3) (ifft* c4)) (mce2 y (sub 1 y))))))

2.254 (pv-bin-shift buffer stretch shift)

Shift and scale the positions of the bins. Can be used as a very crude frequency shifter/scaler. Shifts the leftmost bin at ‘buffer’ by ‘shift’ places, the distance between subsequent bins is -‘stretch’.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(define snd - (let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) - (f2 (sin-osc kr f1 0))) - (sin-osc ar (mul-add f2 100 800) 0)))

(audition (out 0 snd))

(audition - (out 0 (mul - (ifft* - (pv-bin-shift - (fft* 10 snd) - (mouse-y kr 1 4 0 0.1) - (mouse-x kr -10 100 0 0.1))) - 1/2)))

2.255 (fft buffer in hop wintype active)

(fft* b i) => (fft b i 0.5 0 1)

Fast fourier transform. The fast fourier transform analyzes the +‘stretch’.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(define snd
  (let* ((f1 (squared (mul-add (sin-osc kr 0.08 0) 6 6.2)))
         (f2 (sin-osc kr f1 0)))
    (sin-osc ar (mul-add f2 100 800) 0)))

(audition (out 0 snd))

(audition
 (out 0 (mul
         (ifft*
          (pv-bin-shift
           (fft* 10 snd)
           (mouse-y kr 1 4 0 0.1)
           (mouse-x kr -10 100 0 0.1)))
         1/2)))

2.255 (fft buffer in hop wintype active)

(fft* b i) => (fft b i 0.5 0 1)

Fast fourier transform. The fast fourier transform analyzes the frequency content of a signal. fft uses a local buffer for holding the buffered audio. The inverse transform, Ifft, reconstructs an audio signal.

Note that the UGens the SC3 language provides do not use rate extensions, since only a single rate is valid for each UGen class. The fft and PV_ UGens must run at control rate, the ifft UGen at -audio rate.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let* ((s (mul (white-noise ar) 0.05)) - (c (fft* 10 s))) - (audition (out 0 (ifft* c))))

(let* ((f1 (Squared (mul-add (sin-osc kr 0.08 0) 6 6.2))) - (f2 (mul-add (sin-osc kr f1 0) 100 800)) - (s (sin-osc ar f2 0))) - (audition (out 0 (ifft* (fft* 10 s)))))

2.256 (pv-bin-wipe bufferA bufferB wipe)

Combine low and high bins from two inputs

Copies low bins from one input and the high bins of the other.

bufferA - fft buffer A. +audio rate.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let* ((s (mul (white-noise ar) 0.05))
       (c (fft* 10 s)))
  (audition (out 0 (ifft* c))))
(let* ((f1 (Squared (mul-add (sin-osc kr 0.08 0) 6 6.2)))
       (f2 (mul-add (sin-osc kr f1 0) 100 800))
       (s (sin-osc ar f2 0)))
  (audition (out 0 (ifft* (fft* 10 s)))))

2.256 (pv-bin-wipe bufferA bufferB wipe)

Combine low and high bins from two inputs

Copies low bins from one input and the high bins of the other.

bufferA - fft buffer A. bufferB - fft buffer B. wipe - can range between -1 and +1.

if wipe == 0 then the output is the same as inA. if wipe > 0 then it begins replacing with bins from inB from the bottom up. -if wipe < 0 then it begins replacing with bins from inB from the top down.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc 11 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (mul (white-noise ar) 0.2)) - (b (mul (sin-osc ar 100 0) 0.2)) - (f (fft* 10 a)) - (g (fft* 11 b)) - (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1)))) - (audition (out 0 (mul (ifft* h) 0.5))))

(let* ((a (mul (white-noise ar) 0.2)) - (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (g (fft* 11 b)) - (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1)))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.257 (pv-copyPhase bufferA bufferB)

Combines magnitudes of first input and phases of the second input.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc 11 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (mul (white-noise ar) 0.2)) - (b (mul (sin-osc ar 100 0) 0.2)) - (f (fft* 10 a)) - (g (fft* 11 b)) - (h (pv-copy-phase f g))) - (audition (out 0 (mul (ifft* h) 0.5))))

(let* ((a (mul (white-noise ar) 0.2)) - (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (g (fft* 11 b)) - (h (pv-copy-phase f g))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.258 (pv-phase-shift90 buffer)

Swap the real and imaginary components of every bin at ‘buffer’ and -swap the of the imaginary components.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let ((n (mul (white-noise ar) 0.1))) - (audition (out 0 (ifft* (pv-phase-shift90 (fft* 10 n))))))

2.259 (convolution2 in bufnum trigger framesize) - -#| - -Strict convolution with fixed kernel which can be updated using a -trigger signal. - -in - processing target +if wipe < 0 then it begins replacing with bins from inB from the top down.

(with-sc3
 (lambda (fd)
  (async fd (b-alloc 10 2048 1))
  (async fd (b-alloc 11 2048 1))
  (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (mul (white-noise ar) 0.2))
       (b (mul (sin-osc ar 100 0) 0.2))
       (f (fft* 10 a))
       (g (fft* 11 b))
       (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1))))
  (audition (out 0 (mul (ifft* h) 0.5))))
(let* ((a (mul (white-noise ar) 0.2))
       (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (g (fft* 11 b))
       (h (pv-bin-wipe f g (mouse-x kr -1 1 0 0.1))))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.257 (pv-copyPhase bufferA bufferB)

Combines magnitudes of first input and phases of the second input.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc 11 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (mul (white-noise ar) 0.2))
       (b (mul (sin-osc ar 100 0) 0.2))
       (f (fft* 10 a))
       (g (fft* 11 b))
       (h (pv-copy-phase f g)))
  (audition (out 0 (mul (ifft* h) 0.5))))
(let* ((a (mul (white-noise ar) 0.2))
       (b (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (g (fft* 11 b))
       (h (pv-copy-phase f g)))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.258 (pv-phase-shift90 buffer)

Swap the real and imaginary components of every bin at ‘buffer’ and +swap the of the imaginary components.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let ((n (mul (white-noise ar) 0.1)))
  (audition (out 0 (ifft* (pv-phase-shift90 (fft* 10 n))))))

2.259 (convolution2 in bufnum trigger framesize)

Strict convolution with fixed kernel which can be updated using a +trigger signal.

in - processing target bufnum - buffer index for the fixed kernel, may be modulated in combination with the trigger trigger - update the kernel on a change from <=0 to >0 @@ -2562,172 +526,24 @@ framesize - size of fft frame, must be a power of two. convolution uses twice this number internally, maximum value you can give this argument is 2^16=65536. Note that it gets progressively more expensive to run for higher powers! - 512, 1024, 2048, 4096 standard. - -|# - -(with-sc3 - (lambda (fd) - (for-each - (lambda (b) - (async fd (b-alloc b 2048 1))) - (list 10 11 12)) - (for-each - (lambda (n) - (send fd (b-set1 10 (+ (* 400 n) 100) 1))) - (enum-from-to 0 2)) - (for-each - (lambda (n) - (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1)))) - (enum-from-to 0 49)) - (for-each - (lambda (n) - (send fd (b-set1 12 (+ (* 40 n) 20) 1))) - (enum-from-to 0 19)) - (send-synth - fd "c" - (letc ((k 0) (t 0)) - (let ((i (impulse ar 1 0))) - (out 0 (mul (convolution2 i k t 2048) 0.5))))))) - -(define send-to - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m))))) - -(define async-to - (lambda (m) - (with-sc3 - (lambda (fd) - (async fd m))))) - -(send-to (s-new1 "c" 1001 1 1 "k" 10)) - -(send-to (n-set1 1001 "k" 11)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(send-to (n-set1 1001 "k" 12)) -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1)) - -(async-to (b-zero 12)) - -(for-each - (lambda (n) - (send-to (b-set1 12 (+ (* 20 n) 10) 1))) - (enum-from-to 0 39)) - -(send-to (n-set1 1001 "t" 0)) -(send-to (n-set1 1001 "t" 1))

With soundfile.

(async-to (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))

(let ((i (sound-in 0))) - (audition (out 0 (mul (convolution2 i 10 0 512) 0.5))))

2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

2.261 (pv-add bufferA bufferB)

Complex addition: RealA + RealB, ImagA + ImagB

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc 11 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (g (fft* 11 (mul (sin-osc ar 440 0) 0.2))) - (h (pv-add f g))) - (audition (out 0 (mul (ifft* h) 0.5))))

(audition - (out 0 (mul (add (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1) - (mul (sin-osc ar 440 0) 0.2)) - 0.5)))

2.262 (pv-rand-comb buffer wipe trig)

randomly clear bins.

buffer = fft buffer. wipe = clear bins from input in a random -order (0, 1). trig = select new random ordering.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1))))

(let ((dup (lambda (a) (mce2 a a))) - (n (mul (white-noise ar) 0.5)) - (x (mouse-x kr 0.6 0.95 0 0.1)) - (t (impulse kr 0.4 0))) - (audition (out 0 (dup (ifft* (pv-rand-comb (fft* 10 n) x t))))))

2.263 (pv-local-max buffer threshold)

Pass bins which are a local maximum

Passes only bins whose magnitude is above a threshold and above + 512, 1024, 2048, 4096 standard.

(with-sc3
 (lambda (fd)
   (for-each
    (lambda (b)
      (async fd (b-alloc b 2048 1)))
    (list 10 11 12))
   (for-each
    (lambda (n)
      (send fd (b-set1 10 (+ (* 400 n) 100) 1)))
    (enum-from-to 0 2))
   (for-each
    (lambda (n)
      (send fd (b-set1 11 (+ (* 20 n) 10) (random 0 1))))
    (enum-from-to 0 49))
   (for-each
    (lambda (n)
      (send fd (b-set1 12 (+ (* 40 n) 20) 1)))
    (enum-from-to 0 19))
   (send-synth
    fd "c"
    (letc ((k 0) (t 0))
      (let ((i (impulse ar 1 0)))
        (out 0 (mul (convolution2 i k t 2048) 0.5)))))))
(define send-to
  (lambda (m)
    (with-sc3
     (lambda (fd)
       (send fd m)))))
(define async-to
  (lambda (m)
    (with-sc3
     (lambda (fd)
       (async fd m)))))

(send-to (s-new1 "c" 1001 1 1 "k" 10))

(send-to (n-set1 1001 "k" 11))

(send-to (n-set1 1001 "t" 0))

(send-to (n-set1 1001 "t" 1))

(send-to (n-set1 1001 "k" 12))

(send-to (n-set1 1001 "t" 0))

(send-to (n-set1 1001 "t" 1))

(async-to (b-zero 12))

(for-each
 (lambda (n)
   (send-to (b-set1 12 (+ (* 20  n) 10)  1)))
 (enum-from-to 0 39))

(send-to (n-set1 1001 "t" 0))

(send-to (n-set1 1001 "t" 1))

With soundfile.

(async-to (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))

(let ((i (sound-in 0)))
  (audition (out 0 (mul (convolution2 i 10 0 512) 0.5))))

2.260 (pv-rect-comb2 bufferA bufferB numTeeth phase width)

2.261 (pv-add bufferA bufferB)

Complex addition: RealA + RealB, ImagA + ImagB

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc 11 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (g (fft* 11 (mul (sin-osc ar 440 0) 0.2)))
       (h (pv-add f g)))
  (audition (out 0 (mul (ifft* h) 0.5))))
(audition
 (out 0 (mul (add (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)
                  (mul (sin-osc ar 440 0) 0.2))
             0.5)))

2.262 (pv-rand-comb buffer wipe trig)

randomly clear bins.

buffer = fft buffer. wipe = clear bins from input in a random +order (0, 1). trig = select new random ordering.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let ((dup (lambda (a) (mce2 a a)))
      (n (mul (white-noise ar) 0.5))
      (x (mouse-x kr 0.6 0.95 0 0.1))
      (t (impulse kr 0.4 0)))
  (audition (out 0 (dup (ifft* (pv-rand-comb (fft* 10 n) x t))))))

2.263 (pv-local-max buffer threshold)

Pass bins which are a local maximum

Passes only bins whose magnitude is above a threshold and above their nearest neighbors.

buffer - fft buffer. -threshold - magnitude threshold.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (h (pv-local-max f (mouse-x kr 0 100 0 0.1)))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.264 (pv-mag-mul bufferA bufferB)

2.265 (pv-conformal-map buffer real imag)

Applies the conformal mapping z send (z-a)/(1-za*) to the phase +threshold - magnitude threshold.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (h (pv-local-max f (mouse-x kr 0 100 0 0.1))))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.264 (pv-mag-mul bufferA bufferB)

2.265 (pv-conformal-map buffer real imag)

Applies the conformal mapping z send (z-a)/(1-za*) to the phase vocoder bins z with a given by the real and imag imputs to the UGen.

See http://mathworld.wolfram.com/ConformalMapping.html

buffer - buffer number of buffer to act on, passed in through a chain real - real part of a. -imag - imaginary part of a.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 1024 1)) - (async fd (b-alloc 0 2048 1))))

(audition - (out 0 (pan2 - (ifft* - (pv-conformal-map - (fft* 10 (mul (sound-in 0) 0.5)) (mouse-x kr -1 1 0 0.1) - (mouse-y kr -1 1 0 0.1))) - 0 - 1)))

(let* ((signal (lambda (n) - (let* ((o (sin-osc kr (mix-fill n (lambda (_) (rand 0.1 0.5))) 0)) - (a (mul (make-mce (list 1 1.1 1.5 1.78 2.45 6.7)) 220)) - (f (mul-add o 10 a))) - (mix (mul (lf-saw ar f 0) 0.3))))) - (mapped (lambda (n) - (let* ((c0 (fft* 0 (signal n))) - (x (mouse-x kr 0.01 2.0 1.0 0.1)) - (y (mouse-y kr 0.01 10.0 1.0 0.1)) - (c1 (pv-conformal-map c0 x y))) - (ifft* c1)))) - (s (mapped 3)) - (t (mul-add (comb-n s 0.1 0.1 10) 0.5 s))) - (audition (out 0 (pan2 t 0 1))))

2.266 (pv-diffuser buffer trig)

adds a different constant random phase shift to each bin. +imag - imaginary part of a.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 1024 1))
   (async fd (b-alloc 0 2048 1))))
(audition
 (out 0 (pan2
         (ifft*
          (pv-conformal-map
           (fft* 10 (mul (sound-in 0) 0.5)) (mouse-x kr -1 1 0 0.1)
           (mouse-y kr -1 1 0 0.1)))
         0
         1)))
(let* ((signal (lambda (n)
                 (let* ((o (sin-osc kr (mix-fill n (lambda (_) (rand 0.1 0.5))) 0))
                        (a (mul (make-mce (list 1 1.1 1.5 1.78 2.45 6.7)) 220))
                        (f (mul-add o 10 a)))
                   (mix (mul (lf-saw ar f 0) 0.3)))))
       (mapped (lambda (n)
                 (let* ((c0 (fft* 0 (signal n)))
                        (x (mouse-x kr 0.01 2.0  1.0 0.1))
                        (y (mouse-y kr 0.01 10.0 1.0 0.1))
                        (c1 (pv-conformal-map c0 x y)))
                   (ifft* c1))))
       (s (mapped 3))
       (t (mul-add (comb-n s 0.1 0.1 10) 0.5 s)))
  (audition (out 0 (pan2 t 0 1))))

2.266 (pv-diffuser buffer trig)

adds a different constant random phase shift to each bin. The trigger will select a new set of random phases.

buffer - fft buffer. -trig - a trigger selects a new set of random values.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (h (pv-diffuser f (gt (mouse-x kr 0 1 0 0.1) 0.5)))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.267 (pv-max bufferA bufferB)

2.268 (Ifft buffer wintype)

(ifft* b) => (ifft b 0)

inverse Fast Fourier Transform. The inverse fast fourier transform -converts from frequency content to a signal.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 2048 1))))

(let* ((s (mul (white-noise ar) 0.05)) - (c (fft 0 s 0.5 0 1))) - (audition (out 0 (Ifft c 0))))

2.269 (pv-bin-scramble buffer wipe width trig)

randomizes the order of the bins. The trigger will select a new +trig - a trigger selects a new set of random values.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (h (pv-diffuser f (gt (mouse-x kr 0 1 0 0.1) 0.5))))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.267 (pv-max bufferA bufferB)

2.268 (Ifft buffer wintype)

(ifft* b) => (ifft b 0)

inverse Fast Fourier Transform. The inverse fast fourier transform +converts from frequency content to a signal.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 2048 1))))
(let* ((s (mul (white-noise ar) 0.05))
       (c (fft 0 s 0.5 0 1)))
  (audition (out 0 (Ifft c 0))))

2.269 (pv-bin-scramble buffer wipe width trig)

randomizes the order of the bins. The trigger will select a new random ordering.

buffer - fft buffer. wipe - scrambles more bins as wipe moves from zero to one. width - a value from zero to one, indicating the maximum randomized distance of a bin from its original location in the spectrum. -trig - a trigger selects a new random ordering.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) - (f (fft* 10 a)) - (g (pv-bin-scramble f - (mouse-x kr 0.0 1.0 0 0.1) - (mouse-y kr 0.0 1.0 0 0.1) - (impulse kr 4 0))) - (h (ifft* g))) - (audition (out 0 (mul 0.5 (mce2 h h)))))

careful - reads adc! -(let* ((a (mul (sound-in (mce2 0 1)) 4.0)) - (f (fft* 10 a)) - (g (pv-bin-scramble f - (mouse-x kr 0.25 1.0 0 0.1) - (mouse-y kr 0.25 1.0 0 0.1) - (impulse kr (mul-add (lf-noise0 kr 2) 8 10) 0))) - (h (ifft* g))) - (audition (out 0 (pan2 h 0 0.5))))

2.270 (pv-rand-wipe bufferA bufferB wipe trig)

Cross fades between two sounds by copying bins in a random order.

bufferA = fft buffer A. bufferB = fft buffer B. wipe = copies +trig - a trigger selects a new random ordering.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1))
       (f (fft* 10 a))
       (g (pv-bin-scramble f
                          (mouse-x kr 0.0 1.0 0 0.1)
                          (mouse-y kr 0.0 1.0 0 0.1)
                          (impulse kr 4 0)))
       (h (ifft* g)))
  (audition (out 0 (mul 0.5 (mce2 h h)))))

careful - reads adc!

(let* ((a (mul (sound-in (mce2 0 1)) 4.0))
       (f (fft* 10 a))
       (g (pv-bin-scramble f
                          (mouse-x kr 0.25 1.0 0 0.1)
                          (mouse-y kr 0.25 1.0 0 0.1)
                          (impulse kr (mul-add (lf-noise0 kr 2) 8 10) 0)))
       (h (ifft* g)))
  (audition (out 0 (pan2 h 0 0.5))))

2.270 (pv-rand-wipe bufferA bufferB wipe trig)

Cross fades between two sounds by copying bins in a random order.

bufferA = fft buffer A. bufferB = fft buffer B. wipe = copies bins from bufferB in a random order (0, 1). trig = select new -random ordering.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc 11 2048 1))))

(define-syntax n-of - (syntax-rules () - ((_ n f) (mix-fill n (lambda (_) f)))))

(let* ((n 6) - (a (n-of n (mul (lf-saw ar (exp-rand 400.0 1000.0) 0.0) 0.1))) - (b (n-of n (mul (lf-pulse ar (exp-rand 80.0 400.0) 0.0 0.2) - (u:max (mul (sin-osc kr (rand 0.0 8.0) 0.0) 0.2) 0.0)))) - (f (fft* 10 a)) - (g (fft* 11 b)) - (y (mouse-y kr 0 1 0 0.1)) - (x (mouse-x kr 0 1 0 0.1)) - (h (pv-rand-wipe f g x (gt y 0.5))) - (i (ifft* h))) - (audition (out 0 (mul 0.5 (mce2 i i)))))

2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

Pack separate demand-rate fft bin streams into an fft chain buffer

Takes a length-prefixed array of magnitudes and phases, and packs +random ordering.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc 11 2048 1))))
(define-syntax n-of
  (syntax-rules ()
    ((_ n f) (mix-fill n (lambda (_) f)))))
(let* ((n 6)
       (a (n-of n (mul (lf-saw ar (exp-rand 400.0 1000.0) 0.0) 0.1)))
       (b (n-of n (mul (lf-pulse ar (exp-rand 80.0 400.0) 0.0 0.2)
                       (u:max (mul (sin-osc kr (rand 0.0 8.0) 0.0) 0.2) 0.0))))
       (f (fft* 10 a))
       (g (fft* 11 b))
       (y (mouse-y kr 0 1 0 0.1))
       (x (mouse-x kr 0 1 0 0.1))
       (h (pv-rand-wipe f g x (gt y 0.5)))
       (i (ifft* h)))
  (audition (out 0 (mul 0.5 (mce2 i i)))))

2.271 (Packfft chain bufsize frombin tobin zeroothers magsphases)

Pack separate demand-rate fft bin streams into an fft chain buffer

Takes a length-prefixed array of magnitudes and phases, and packs them into an fft buffer ready for transforming back into time-domain audio using Ifft.

Most people won’t need to use this directly - instead, use pvcollect, pvcalc, or pvcalc2.

The input data is magsphases, which should be a flat array @@ -2742,20 +558,7 @@ subset of the fft bins (i.e. a single delimited frequency band), set zeroothers to 1 to zero all the magnitudes outside this band (otherwise they stay intact).

For usage examples, see Unpackfft, but also pvcollect, pvcalc, pvcalc2.

Here’s an unusual example which uses Packfft without using -Unpackfft first - essentially creating our fft data from scratch.

(with-sc3 - (lambda (fd) - (send fd (b-alloc 10 512 1))))

(let* ((n 100) - (n* (enum-from-to 1 n)) - (m1 (map (lambda (_) (range (f-sin-osc kr (exp-rand 0.1 1) 0) 0 1)) n*)) - (square (lambda (a) (* a a))) - (m2 (map mul m1 (map square (iota n 1.0 (- (/ 1.0 n)))))) - (i (map (lambda (_) (lf-pulse kr (pow 2 (i-rand -3 5)) 0 0.3)) n*)) - (m3 (map mul m2 i)) - (p (replicate n 0.0)) - (c1 (fft* 10 (f-sin-osc ar 440 0))) - (c2 (pack-fft c1 512 0 (- n 1) 1 (packfft-data m3 p))) - (s (ifft* c2))) - (audition (out 0 (mce2 s s))))

2.272 (pvcollect chain numframes func frombin tobin zeroothers)

Process each bin of an fft chain separately.

pvcollect applies function func to each bin of an fft chain. func +Unpackfft first - essentially creating our fft data from scratch.

(with-sc3
 (lambda (fd)
   (send fd (b-alloc 10 512 1))))
(let* ((n 100)
       (n* (enum-from-to 1 n))
       (m1 (map (lambda (_) (range (f-sin-osc kr (exp-rand 0.1 1) 0) 0 1)) n*))
       (square (lambda (a) (* a a)))
       (m2 (map mul m1 (map square (iota n 1.0 (- (/ 1.0 n))))))
       (i (map (lambda (_) (lf-pulse kr (pow 2 (i-rand -3 5)) 0 0.3)) n*))
       (m3 (map mul m2 i))
       (p (replicate n 0.0))
       (c1 (fft* 10 (f-sin-osc ar 440 0)))
       (c2 (pack-fft c1 512 0 (- n 1) 1 (packfft-data m3 p)))
       (s (ifft* c2)))
  (audition (out 0 (mce2 s s))))

2.272 (pvcollect chain numframes func frombin tobin zeroothers)

Process each bin of an fft chain separately.

pvcollect applies function func to each bin of an fft chain. func should be a function that takes magnitude, phase, index as inputs and returns a resulting [magnitude, phase].

The "index" is the integer bin number, starting at 0 for DC. You can optionally ignore the phase and only return a single @@ -2764,81 +567,14 @@ unchanged.

frombin, tobin, and zeroothers are optional arguments which lim the processing to a specified integer range of fft bins. If zeroothers is set to 1 then bins outside of the range being processed are silenced.

Note that this procedure can be relatively CPU-heavy, depending on -how you use it.

(define no-op - (lambda (m p _) - (list m p)))

(define rand-phase - (lambda (m p _) - (list m (rand 0 3.14))))

(define noise-phase - (lambda (m p _) - (list m (lin-lin (lf-noise0 kr 3) -1 1 0 3.14))))

(define combf - (lambda (m p i) - (list (if (= (modulo i 7) 0) m 0) p)))

(define noise-mag - (lambda (m p _) - (list (mul (gt (lf-noise0 kr 10) 0) m) p)))

(define spectral-delay - (lambda (m p _) - (let ((v (lin-lin (lf-par kr 0.5 0) -1 1 0.1 1))) - (list (add m (delay-n m 1 v)) p))))

(define (bpf-sweep nf) - (lambda (m p i) - (let ((e (u:abs (sub i (lin-lin (lf-par kr 0.1 0) -1 1 2 (/ nf 20)))))) - (list (mul (lt e 10) m) p))))

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 1024 1)) - (async fd (b-alloc-read 11 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((nf 1024) - (i (play-buf 1 11 (buf-rate-scale kr 11) 1 0 1)) - (c1 (fft* 10 i)) - (c2 (pvcollect c1 nf spectral-delay 0 250 0))) - (audition (out 0 (mul 0.1 (ifft* c2)))))

2.273 (PV_Magclip buffer threshold)

clip bins to a threshold. clips bin magnitudes to a maximum +how you use it.

(define no-op
  (lambda (m p _)
    (list m p)))
(define rand-phase
  (lambda (m p _)
    (list m (rand 0 3.14))))
(define noise-phase
  (lambda (m p _)
    (list m (lin-lin (lf-noise0 kr 3) -1 1 0 3.14))))
(define combf
  (lambda (m p i)
    (list (if (= (modulo i 7) 0) m 0) p)))
(define noise-mag
  (lambda (m p _)
    (list (mul (gt (lf-noise0 kr 10) 0) m) p)))
(define spectral-delay
  (lambda (m p _)
    (let ((v (lin-lin (lf-par kr 0.5 0) -1 1 0.1 1)))
      (list (add m (delay-n m 1 v)) p))))
(define (bpf-sweep nf)
  (lambda (m p i)
    (let ((e (u:abs (sub i (lin-lin (lf-par kr 0.1 0) -1 1 2 (/ nf 20))))))
      (list (mul (lt e 10) m) p))))
(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 1024 1))
   (async fd (b-alloc-read 11 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((nf 1024)
       (i (play-buf 1 11 (buf-rate-scale kr 11) 1 0 1))
       (c1 (fft* 10 i))
       (c2 (pvcollect c1 nf spectral-delay 0 250 0)))
  (audition (out 0 (mul 0.1 (ifft* c2)))))

2.273 (PV_Magclip buffer threshold)

clip bins to a threshold. clips bin magnitudes to a maximum threshold.

buffer - fft buffer. -threshold - magnitude threshold.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1)) - (f (fft* 10 a)) - (h (pv-mag-clip f (mouse-x kr 0 5 0 0.1)))) - (audition (out 0 (mul (ifft* h) 0.5))))

2.274 (PV_Magfreeze buffer freeze)

freeze magnitudes. freezes magnitudes at current levels when +threshold - magnitude threshold.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let* ((a (play-buf 1 12 (buf-rate-scale kr 12) 0 0 1))
       (f (fft* 10 a))
       (h (pv-mag-clip f (mouse-x kr 0 5 0 0.1))))
  (audition (out 0 (mul (ifft* h) 0.5))))

2.274 (PV_Magfreeze buffer freeze)

freeze magnitudes. freezes magnitudes at current levels when freeze > 0.

buffer - fft buffer. -freeze - if > 0 then magnitudes are frozen at current levels.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)) - (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))

(let ((dup (lambda (a) (mce2 a a))) - (s (sin-osc ar (mul-add (lf-noise1 kr 5.2) 250 400) 0)) - (f (sin-osc kr 0.2 0))) - (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f)))))))

(let ((dup (lambda (a) (mce2 a a))) - (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1)) - (f (gt (mouse-y kr 0 1 0 0.1) 0.5))) - (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f)))))))

2.275 (pv-rect-comb buffer numTeeth phase width) - -(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 2048 1)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (x (mouse-x kr 0 0.5 0 0.1)) - (y (mouse-y kr 0 0.5 0 0.1)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 x y))) - (audition (out 0 (ifft* c)))) - -(let* ((dup (lambda (a) (mce2 a a))) - (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5)) - (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5)) - (n (dup (mul (white-noise ar) 0.3))) - (c (pv-rect-comb (fft* 10 n) 8 p w))) - (audition (out 0 (ifft* c))))

2.276 (pv-mag-shift buffer stretch shift)

2.277 See allpass-n

2.278 See comb-n

2.279 See Bufallpass-c

2.280 (free-verb in mix room damp)

(free-verb2 in1 in2 mix room damp)

A simple reverb.

in, in1, in2 - input signal +freeze - if > 0 then magnitudes are frozen at current levels.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))
   (async fd (b-alloc-read 12 "/home/rohan/audio/metal.wav" 0 0))))
(let ((dup (lambda (a) (mce2 a a)))
      (s (sin-osc ar (mul-add (lf-noise1 kr 5.2) 250 400) 0))
      (f (sin-osc kr 0.2 0)))
  (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f)))))))
(let ((dup (lambda (a) (mce2 a a)))
      (s (play-buf 1 12 (buf-rate-scale kr 12) 1 0 1))
      (f (gt (mouse-y kr 0 1 0 0.1) 0.5)))
  (audition (out 0 (dup (mul 0.25 (ifft* (pv-mag-freeze (fft* 10 s) f)))))))

2.275 (pv-rect-comb buffer numTeeth phase width)

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 2048 1))))
(let* ((dup (lambda (a) (mce2 a a)))
       (x (mouse-x kr 0 0.5 0 0.1))
       (y (mouse-y kr 0 0.5 0 0.1))
       (n (dup (mul (white-noise ar) 0.3)))
       (c (pv-rect-comb (fft* 10 n) 8 x y)))
  (audition (out 0 (ifft* c))))
(let* ((dup (lambda (a) (mce2 a a)))
       (p (mul-add (lf-tri kr 0.097 0) 0.4 0.5))
       (w (mul-add (lf-tri kr 0.24 0) -0.5 0.5))
       (n (dup (mul (white-noise ar) 0.3)))
       (c (pv-rect-comb (fft* 10 n) 8 p w)))
  (audition (out 0 (ifft* c))))

2.276 (pv-mag-shift buffer stretch shift)

2.277 See allpass-n

2.278 See comb-n

2.279 See Bufallpass-c

2.280 (free-verb in mix room damp)

(free-verb2 in1 in2 mix room damp)

A simple reverb.

in, in1, in2 - input signal mix - dry/wet balance (0,1) room - room size (0,1) - damp - reverb high frequency damping (0,1)

(let* ((i (impulse ar 1 0)) - (c (lf-cub ar 1200 0)) - (s (mul3 (decay i 0.25) c 0.1)) - (x (mouse-x kr 0 1 0 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (r (free-verb s y x 0.5))) - (audition (out 0 r)))

(let* ((i (sound-in (mce2 0 1))) - (c (lambda (u n) (mce-channel u n))) - (x (mouse-x kr 0 1 0 0.1)) - (y (mouse-y kr 0 1 0 0.1)) - (r (free-verb2 (c i 0) (c i 1) y x 0.5))) - (audition (out 0 r)))

2.281 See freeVerb

2.282 (play-buf numChannels bufnum rate trigger startPos loop)

Sample playback oscillator. Plays back a memory resident sample.

numChannels - number of channels that the buffer will be. This + damp - reverb high frequency damping (0,1)

(let* ((i (impulse ar 1 0))
       (c (lf-cub ar 1200 0))
       (s (mul3 (decay i 0.25) c 0.1))
       (x (mouse-x kr 0 1 0 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (r (free-verb s y x 0.5)))
  (audition (out 0 r)))
(let* ((i (sound-in (mce2 0 1)))
       (c (lambda (u n) (mce-channel u n)))
       (x (mouse-x kr 0 1 0 0.1))
       (y (mouse-y kr 0 1 0 0.1))
       (r (free-verb2 (c i 0) (c i 1) y x 0.5)))
  (audition (out 0 r)))

2.281 See freeVerb

2.282 (play-buf numChannels bufnum rate trigger startPos loop)

Sample playback oscillator. Plays back a memory resident sample.

numChannels - number of channels that the buffer will be. This must be a fixed integer. The architechture of the SynthDef cannot change after it is compiled. Warning: if you supply a bufnum of a buffer that has @@ -2851,116 +587,53 @@ freeze - if > 0 then magnitudes are frozen at current levels.

(with-sc3 server’s rate). The UGen buf-rate-scale.kr(bufnum) returns this factor. See examples below. buf-rate-scale should be used in virtually every case.

trigger - a trigger causes a jump to the startPos. A trigger -occurs when a signal changes from <= 0 to > 0.

startPos - sample frame to start playback.

loop - 1 means true, 0 means false. This is modulate-able.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))

Play once only.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 0)))

Play in infinite loop.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 1)))

trigger playback at each pulse.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) (impulse kr 2 0) 0 0)))

trigger playback at each pulse (diminishing intervals).

(let ((t (impulse kr (x-line kr 0.1 100 10 remove-synth) 0))) - (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) t 0 0))))

Loop playback, accelerating pitch.

(let ((rate (x-line kr 0.1 100 60 remove-synth))) - (audition (out 0 (play-buf 1 10 rate 1 0 1))))

Sine wave control of playback rate, negative rate plays backwards.

(let ((r (mul-add (f-sin-osc kr (x-line kr 0.2 8 30 remove-synth) 0) 3 0.6))) - (audition (out 0 (play-buf 1 10 (mul (buf-rate-scale kr 10) r) 1 0 1))))

Release buffer.

(with-sc3 - (lambda (fd) - (async fd (b-free 10))))

2.283 See buf-delay-c

2.284 (delay2 in)

Fixed two sample delay.

(let ((s (impulse ar 1 0))) - (audition - (out 0 (add s (delay2 s)))))

2.285 (comb-n in maxDelayTime delayTime decayTime)

(comb-l in maxDelayTime delayTime decayTime) +occurs when a signal changes from <= 0 to > 0.

startPos - sample frame to start playback.

loop - 1 means true, 0 means false. This is modulate-able.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 10 "/home/rohan/audio/metal.wav" 0 0))))

Play once only.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 0)))

Play in infinite loop.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) 1 0 1)))

trigger playback at each pulse.

(audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) (impulse kr 2 0) 0 0)))

trigger playback at each pulse (diminishing intervals).

(let ((t (impulse kr (x-line kr 0.1 100 10 remove-synth) 0)))
  (audition (out 0 (play-buf 1 10 (buf-rate-scale kr 10) t 0 0))))

Loop playback, accelerating pitch.

(let ((rate (x-line kr 0.1 100 60 remove-synth)))
  (audition (out 0 (play-buf 1 10 rate 1 0 1))))

Sine wave control of playback rate, negative rate plays backwards.

(let ((r (mul-add (f-sin-osc kr (x-line kr 0.2 8 30 remove-synth) 0) 3 0.6)))
  (audition (out 0 (play-buf 1 10 (mul (buf-rate-scale kr 10) r) 1 0 1))))

Release buffer.

(with-sc3
 (lambda (fd)
   (async fd (b-free 10))))

2.283 See buf-delay-c

2.284 (delay2 in)

Fixed two sample delay.

(let ((s (impulse ar 1 0)))
  (audition
   (out 0 (add s (delay2 s)))))

2.285 (comb-n in maxDelayTime delayTime decayTime)

(comb-l in maxDelayTime delayTime decayTime) (comb-c in maxDelayTime delayTime decayTime)

Comb delay line. comb-n uses no interpolation, comb-l uses linear interpolation, comb-c uses all pass interpolation. All times are in seconds. The decay time is the time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.

Comb used as a resonator. The resonant fundamental is equal to -reciprocal of the delay time.

(define src (mul (white-noise ar) 0.01)) -(define ctl (x-line kr 0.0001 0.01 20 remove-synth)) -(define hear (lambda (u) (audition (out 0 u))))

(hear (comb-n src 0.01 ctl 0.2)) -(hear (comb-l src 0.01 ctl 0.2)) -(hear (comb-c src 0.01 ctl 0.2))

With negative feedback:

(hear (comb-n src 0.01 ctl -0.2)) -(hear (comb-l src 0.01 ctl -0.2)) -(hear (comb-c src 0.01 ctl -0.2))

Used as an echo.

(hear (comb-n (mul (decay (mul (dust ar 1) 0.5) 0.2) (white-noise ar)) - 0.2 0.2 3))

2.286 See Bufallpass-c

2.287 (allpass-n in maxDelayTime delayTime decayTime)

All pass delay line. allpass-n uses no interpolation, allpass-l uses +reciprocal of the delay time.

(define src (mul (white-noise ar) 0.01))

(define ctl (x-line kr 0.0001 0.01 20 remove-synth))

(define hear (lambda (u) (audition (out 0 u))))

(hear (comb-n src 0.01 ctl 0.2))

(hear (comb-l src 0.01 ctl 0.2))

(hear (comb-c src 0.01 ctl 0.2))

With negative feedback:

(hear (comb-n src 0.01 ctl -0.2))

(hear (comb-l src 0.01 ctl -0.2))

(hear (comb-c src 0.01 ctl -0.2))

Used as an echo.

(hear (comb-n (mul (decay (mul (dust ar 1) 0.5) 0.2) (white-noise ar))
       0.2 0.2 3))

2.286 See Bufallpass-c

2.287 (allpass-n in maxDelayTime delayTime decayTime)

All pass delay line. allpass-n uses no interpolation, allpass-l uses linear interpolation, allpass-c uses all pass interpolation. All time values are in seconds. The decay time is the time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.

Since the allpass delay has no audible effect as a resonator on -steady state sound ...

(define z (mul (white-noise ar) 0.1))

(audition (out 0 (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2)))

...these examples add the input to the effected sound so that you -can hear the effect of the phase comb.

(audition - (out 0 (add z (allpass-n z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))

(audition - (out 0 (add z (allpass-l z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))

(audition - (out 0 (add z (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))

Used as an echo - doesn’t really sound different than Comb, but it +steady state sound ...

(define z (mul (white-noise ar) 0.1))

(audition (out 0 (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2)))

...these examples add the input to the effected sound so that you +can hear the effect of the phase comb.

(audition
 (out 0 (add z (allpass-n z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))
(audition
 (out 0 (add z (allpass-l z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))
(audition
 (out 0 (add z (allpass-c z 0.01 (x-line kr 0.0001 0.01 20 do-nothing) 0.2))))

Used as an echo - doesn’t really sound different than Comb, but it outputs the input signal immediately (inverted) and the echoes are -lower in amplitude.

(audition - (out 0 (allpass-n (mul (decay (dust ar 1) 0.2) z) 0.2 0.2 3)))

2.288 See comb-n

2.289 (buf-allpass-c buf in delaytime decaytime)

Buffer based all pass delay line with cubic interpolation

All pass delay line with cubic interpolation which uses a buffer +lower in amplitude.

(audition
 (out 0 (allpass-n (mul (decay (dust ar 1) 0.2) z) 0.2 0.2 3)))

2.288 See comb-n

2.289 (buf-allpass-c buf in delaytime decaytime)

Buffer based all pass delay line with cubic interpolation

All pass delay line with cubic interpolation which uses a buffer for its internal memory. See also Bufallpass-n which uses no interpolation, and Bufallpass-l which uses linear interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate.

See also allpass-c.

buf - buffer number.

in - the input signal.

delaytime - delay time in seconds.

decaytime - time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an - octave lower.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 44100 1))))

(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5))) - (audition (out 0 (buf-allpass-n 0 x 0.25 6))))

2.290 See allpass-n

2.291 See buf-delay-c

2.292 (buf-delay-c buf in delaytime)

Buffer based simple delay line with cubic interpolation.

Simple delay line with cubic interpolation which uses a buffer for + octave lower.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 44100 1))))
(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5)))
  (audition (out 0 (buf-allpass-n 0 x 0.25 6))))

2.290 See allpass-n

2.291 See buf-delay-c

2.292 (buf-delay-c buf in delaytime)

Buffer based simple delay line with cubic interpolation.

Simple delay line with cubic interpolation which uses a buffer for its internal memory. See also buf-delay-n which uses no interpolation, and buf-delay-l which uses linear interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate.

See also delay-c.

buf - buffer number. in - the input signal. -delaytime - delay time in seconds.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 44100 1))))

(let ((z (mul3 (decay (dust ar 1) 0.5) 0.3 (white-noise ar)))) - (audition (out 0 (add (buf-delay-c 0 z 0.2) z))))

2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

Karplus-Strong synthesis.

in - an excitation signal

tr - upon a negative to positive transition, the excitation signal +delaytime - delay time in seconds.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 44100 1))))
(let ((z (mul3 (decay (dust ar 1) 0.5) 0.3 (white-noise ar))))
  (audition (out 0 (add (buf-delay-c 0 z 0.2) z))))

2.293 (pluck in tr maxdelaytime delaytime decaytime coef)

Karplus-Strong synthesis.

in - an excitation signal

tr - upon a negative to positive transition, the excitation signal will be fed into the delay line

maxdelaytime - the max delay time in seconds (initializes the internal delay buffer).

delaytime - delay time in seconds.

decaytime - time for the echoes to decay by 60 decibels. Negative times emphasize odd partials.

coef - the coef of the internal one-pole filter. Values should be between -1 and +1 (larger values will be unstable... so be careful!).

Excitation signal is white-noise, triggered twice a second with -varying one-pole coef.

(let ((n (mul (white-noise ar) 0.1)) - (t (impulse kr 2 0)) - (x (mouse-x kr -0.999 0.999 0 0.1)) - (dl (/ 1 440))) - (audition (out 0 (pluck n t dl dl 10 x))))

(let* ((n 25) - (gen (lambda (n f) (mce-fill n (lambda (_) (f))))) - (f (gen n (lambda () (rand 0.05 0.2)))) - (p (gen n (lambda () (rand 0 1)))) - (x (mouse-x kr 60 1000 1 0.1)) - (o (lin-lin (sin-osc kr f p) -1 1 x 3000)) - (w (clone n (mul (white-noise ar) 0.1))) - (i (impulse kr (gen n (lambda () (rand 10 12))) 0)) - (ks (pluck w i 0.01 (fdiv 1 o) 2 (rand 0.01 0.2))) - (l (gen n (lambda () (rand -1 1))))) - (audition (out 0 (leak-dc (mix (pan2 ks l 1)) 0.995))))

2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

A simple time domain pitch shifter.

(audition - (out 0 (pitch-shift (sin-osc ar 440 0) - 0.2 - (mouse-x kr 0.5 2 0 0.1) - (mouse-y kr 0 0.1 0 0.1) - 0)))

2.295 See buf-comb-c

2.296 (buf-comb-c buf in delaytime decaytime)

Buffer based comb delay line with cubic interpolation

All pass delay line with cubic interpolation which uses a buffer +varying one-pole coef.

(let ((n (mul (white-noise ar) 0.1))
      (t (impulse kr 2 0))
      (x (mouse-x kr -0.999 0.999 0 0.1))
      (dl (/ 1 440)))
  (audition (out 0 (pluck n t dl dl 10 x))))
(let* ((n 25)
       (gen (lambda (n f) (mce-fill n (lambda (_) (f)))))
       (f (gen n (lambda () (rand 0.05 0.2))))
       (p (gen n (lambda () (rand 0 1))))
       (x (mouse-x kr 60 1000 1 0.1))
       (o (lin-lin (sin-osc kr f p) -1 1 x 3000))
       (w (clone n (mul (white-noise ar) 0.1)))
       (i (impulse kr (gen n (lambda () (rand 10 12))) 0))
       (ks (pluck w i 0.01 (fdiv 1 o) 2 (rand 0.01 0.2)))
       (l (gen n (lambda () (rand -1 1)))))
  (audition (out 0 (leak-dc (mix (pan2 ks l 1)) 0.995))))

2.294 (pitch-shift in winSize pchRatio pchDispersion timeDispersion)

A simple time domain pitch shifter.

(audition
 (out 0 (pitch-shift (sin-osc ar 440 0)
                     0.2
                     (mouse-x kr 0.5 2 0 0.1)
                     (mouse-y kr 0 0.1 0 0.1)
                     0)))

2.295 See buf-comb-c

2.296 (buf-comb-c buf in delaytime decaytime)

Buffer based comb delay line with cubic interpolation

All pass delay line with cubic interpolation which uses a buffer for its internal memory. See also buf-comb-n which uses no interpolation, and buf-comb-l which uses linear interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate. See also comb-c.

buf - buffer number.

in - the input signal.

delaytime - delay time in seconds.

decaytime - time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an - octave lower.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 0 44100 1))))

(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5))) - (audition (out 0 (buf-comb-n 0 x 0.25 6))))

2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

Plays the content of a buffer.

The number of channels must be a fixed integer. The architechture + octave lower.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 0 44100 1))))
(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5)))
  (audition (out 0 (buf-comb-n 0 x 0.25 6))))

2.297 (buf-rd numChannels rate bufnum phase loop interpolation)

Plays the content of a buffer.

The number of channels must be a fixed integer. The architechture of the SynthDef cannot change after it is compiled. NOTE: if you supply a bufnum of a buffer that has a different numChannels then you have specified to the buf-rd, it will fail silently.

The interpolation type is an integer: 1 no interpolation, 2 linear -interpolation, 4 cubic interpolation.

(with-sc3 - (lambda (fd) - (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(audition (out 0 (buf-rd 1 ar 0 (mul (sin-osc ar 0.1 0) (buf-frames ir 0)) 0 2)))

(let ((phase (mul (lf-noise1 ar (mouse-x kr (mce2 5 10) 100 0 0.1)) - (buf-frames ir 0)))) - (audition (out 0 (buf-rd-l 1 ar 0 phase 0))))

(let ((phase (add (lf-tri ar 0.1 0) - (mul (lf-tri ar 0.23 0) (buf-frames ir 0))))) - (audition (out 0 (buf-rd-l 1 ar 0 phase 0))))

Use a phasor index into the file

(let ((phase (phasor ar - 0 - (mul (mouse-x kr 0.5 2 0 0.1) - (buf-rate-scale kr 0)) - 0 - (buf-frames kr 0) - 0))) - (audition (out 0 (buf-rd 1 ar 0 phase 1 (mouse-y kr 0 5 0 0.1)))))

2.298 (delay1 in)

Fixed Single sample delay.

(let ((s (impulse ar 1 0))) - (audition - (out 0 (add s (delay1 s)))))

2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

Records input into a Buffer.

If recLevel is 1.0 and preLevel is 0.0 then the new input +interpolation, 4 cubic interpolation.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc-read 0 "/home/rohan/audio/metal.wav" 0 0))))

(audition (out 0 (buf-rd 1 ar 0 (mul (sin-osc ar 0.1 0) (buf-frames ir 0)) 0 2)))

(let ((phase (mul (lf-noise1 ar (mouse-x kr (mce2 5 10) 100 0 0.1))
                  (buf-frames ir 0))))
  (audition (out 0 (buf-rd-l 1 ar 0 phase 0))))
(let ((phase (add (lf-tri ar 0.1 0)
                  (mul (lf-tri ar 0.23 0) (buf-frames ir 0)))))
  (audition (out 0 (buf-rd-l 1 ar 0 phase 0))))

Use a phasor index into the file

(let ((phase (phasor ar
                     0
                     (mul (mouse-x kr 0.5 2 0 0.1)
                          (buf-rate-scale kr 0))
                     0
                     (buf-frames kr 0)
                     0)))
  (audition (out 0 (buf-rd 1 ar 0 phase 1 (mouse-y kr 0 5 0 0.1)))))

2.298 (delay1 in)

Fixed Single sample delay.

(let ((s (impulse ar 1 0)))
  (audition
   (out 0 (add s (delay1 s)))))

2.299 (record-buf bufnum offset reclevel prelevel run loop trigger inputs)

Records input into a Buffer.

If recLevel is 1.0 and preLevel is 0.0 then the new input overwrites the old data. If they are both 1.0 then the new data is added to the existing data. (Any other settings are also valid.)

bufnum - the index of the buffer to use offset - an offset into the buffer in samples, default 0 @@ -2974,65 +647,17 @@ loop - If zero then don’t loop, otherwise do. This is modulate-able. Default is 1. trigger - a trigger causes a jump to the start of the Buffer. A trigger occurs when a signal changes from <=0 to >0. -inputArray - an Array of input channels

(with-sc3 - (lambda (fd) - (send-synth - fd - "recorder" - (letc ((in 0) - (bufnum 0) - (offset 1) - (recLevel 1) - (preLevel 0) - (run 1) - (loop 1) - (trigger 1)) - (let ((i (in 2 ar in))) - (out 0 (record-buf bufnum offset recLevel preLevel run loop trigger i))))) - (let ((b 10) - (y 1001) - (z 1002)) - (async fd (/b_alloc b 44100 2)) - (send fd (/s_new "recorder" y add-to-tail 1 "bufnum" b "in" 8)) - (send fd (/n_trace y)) - (send-synth - fd - "player" - (letc ((bufnum 0) - (rate 1) - (trigger 1) - (startPos 0) - (loop 1) - (gain 1)) - (out 0 (mul (play-buf 2 bufnum rate trigger startPos loop) gain)))) - (send fd (/s_new "player" z add-to-tail 1 "bufnum" b)))))

(define do-send - (lambda (m) - (with-sc3 - (lambda (fd) - (send fd m)))))

(do-send (/n_set 1001 "run" 1))

(do-send (/n_set 1002 "loop" 1)) -(do-send (/n_set 1002 "gain" 2)) -(do-send (/n_set 1002 "trigger" 1))

(do-send (/n_free 1001)) -(do-send (/n_free 1002))

(with-sc3 - (lambda (fd) - (async fd (/b_free 10))))

2.300 See delay-n

2.301 See buf-comb-c

2.302 See delay-n

2.303 (delay-n in maxDelayTime delayTime)

(delay-l in maxDelayTime delayTime) +inputArray - an Array of input channels

(with-sc3
 (lambda (fd)
   (send-synth
    fd
    "recorder"
    (letc ((in 0)
           (bufnum 0)
           (offset 1)
           (recLevel 1)
           (preLevel 0)
           (run 1)
           (loop 1)
           (trigger 1))
      (let ((i (in 2 ar in)))
        (out 0 (record-buf bufnum offset recLevel preLevel run loop trigger i)))))
   (let ((b 10)
         (y 1001)
         (z 1002))
     (async fd (/b_alloc b 44100 2))
     (send fd (/s_new "recorder" y add-to-tail 1 "bufnum" b "in" 8))
     (send fd (/n_trace y))
     (send-synth
      fd
      "player"
      (letc ((bufnum 0)
             (rate 1)
             (trigger 1)
             (startPos 0)
             (loop 1)
             (gain 1))
        (out 0 (mul (play-buf 2 bufnum rate trigger startPos loop) gain))))
     (send fd (/s_new "player" z add-to-tail 1 "bufnum" b)))))
(define do-send
  (lambda (m)
    (with-sc3
     (lambda (fd)
       (send fd m)))))

(do-send (/n_set 1001 "run" 1))

(do-send (/n_set 1002 "loop" 1))

(do-send (/n_set 1002 "gain" 2))

(do-send (/n_set 1002 "trigger" 1))

(do-send (/n_free 1001))

(do-send (/n_free 1002))

(with-sc3
 (lambda (fd)
   (async fd (/b_free 10))))

2.300 See delay-n

2.301 See buf-comb-c

2.302 See delay-n

2.303 (delay-n in maxDelayTime delayTime)

(delay-l in maxDelayTime delayTime) (delay-c in maxDelayTime delayTime)

Simple delay line. There are three forms, delay-n uses no interpolation, delay-l uses linear interpolation, delay-c uses cubic interpolation. The maximum delay length is set at initialization time and cannot be extended.

dust randomly triggers decay to create an exponential decay -envelope for the white-noise input source.

(let ((z (mul (decay (dust ar 1) 0.3) - (white-noise ar)))) - (audition - (out 0 (add (delay-n z 0.2 0.2) z))))

2.304 (ball in g damp friction)

Physical model of bouncing object.

Models the path of a bouncing object that is reflected by a +envelope for the white-noise input source.

(let ((z (mul (decay (dust ar 1) 0.3)
              (white-noise ar))))
  (audition
   (out 0 (add (delay-n z 0.2 0.2) z))))

2.304 (ball in g damp friction)

Physical model of bouncing object.

Models the path of a bouncing object that is reflected by a vibrating surface.

in - modulated surface level g - gravity damp - damping on impact friction - proximity from which on attraction to surface starts

2.305 (dswitch1 index array)

demand rate generator for switching between inputs

index - which of the inputs to return -array - array of values or other ugens

(let* ((x (mouse-x kr 0 4 0 0.1)) - (y (mouse-y kr 1 15 0 0.1)) - (a (dswitch1 x (make-mce (list 1 3 y 2 (dwhite 2 0 3))))) - (t (impulse kr 3 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.306 (t-duty rate duration reset doneAction level gap)

demand results as trigger from demand rate ugens.

A value is demanded each ugen in the list and output as a trigger +array - array of values or other ugens

(let* ((x (mouse-x kr 0 4 0 0.1))
       (y (mouse-y kr 1 15 0 0.1))
       (a (dswitch1 x (make-mce (list 1 3 y 2 (dwhite 2 0 3)))))
       (t (impulse kr 3 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.306 (t-duty rate duration reset doneAction level gap)

demand results as trigger from demand rate ugens.

A value is demanded each ugen in the list and output as a trigger according to a stream of duration values. The unit generators in the list should be ’demand’ rate. When there is a trigger at the reset input, the demand rate ugens in the list and the duration are @@ -3044,48 +669,13 @@ doneAction’, rsc does not.

duration - time values. Can be a demand and the duration ugen when triggered. The reset input may also be a demand ugen, providing a stream of reset times.

doneAction - a doneAction that is evaluated when the duration - stream ends.

level - demand ugen providing the output values.

Play a little rhythm

(let ((s (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3))))) - (audition (out 0 (t-duty ar s 0 0 1 0))))

Amplitude changes

(let ((t (t-duty ar - (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3))) - 0 - 0 - (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0))) - 0))) - (audition (out 0 (ringz t 1000 0.1))))

(let ((t (t-duty ar - (mouse-x kr 0.001 2 1 0.1) - 0 - 0 - (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0))) - 0))) - (audition (out 0 (ringz t 1000 0.1))))

2.307 See dwhite

2.308 (dwhite length lo hi)

(diwhite length lo hi)

demand rate white noise random generators.

length number of values to create + stream ends.

level - demand ugen providing the output values.

Play a little rhythm

(let ((s (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3)))))
  (audition (out 0 (t-duty ar s 0 0 1 0))))

Amplitude changes

(let ((t (t-duty ar
                 (dseq dinf (make-mce (list 0.1 0.2 0.4 0.3)))
                 0
                 0
                 (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0)))
                 0)))
  (audition (out 0 (ringz t 1000 0.1))))
(let ((t (t-duty ar
                 (mouse-x kr 0.001 2 1 0.1)
                 0
                 0
                 (dseq dinf (make-mce (list 0.1 0.4 0.01 0.5 1.0)))
                 0)))
  (audition (out 0 (ringz t 1000 0.1))))

2.307 See dwhite

2.308 (dwhite length lo hi)

(diwhite length lo hi)

demand rate white noise random generators.

length number of values to create lo minimum value hi maximum value

dwhite returns numbers in the continuous range between lo and hi, diwhite returns integer values. The arguments can be a number or -any other ugen

(let* ((a (dwhite dinf 0 15)) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

(let* ((a (diwhite dinf 0 15)) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.309 (dbufrd bufnum phase loop)

Buffer demand ugen.

bufnum - buffer number to read from +any other ugen

(let* ((a (dwhite dinf 0 15))
       (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))
(let* ((a (diwhite dinf 0 15))
       (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.309 (dbufrd bufnum phase loop)

Buffer demand ugen.

bufnum - buffer number to read from phase - index into the buffer (demand ugen or any other ugen) -loop - loop when phase exceeds number of frames in buffer

Example

(with-sc3 - (lambda (fd) - (async fd (b-alloc 10 24 1)) - (send fd (b-setn1 10 0 (replicate-m 24 (exp-random 200 500))))))

(let* ((q (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9)))) - (p (dseq dinf (mce2 q (dbrown 5 0 23 1)))) - (t (dust kr 10))) - (audition (out 0 (mul (sin-osc ar (demand t 0 (dbufrd 10 p 1)) 0) 0.1))))

Buffer as a time pattern.

(with-sc3 - (lambda (fd) - (async fd (b-alloc 11 24 1)) - (send fd (b-setn1 11 0 (replicate-m 24 (choose (list 1 0.5 0.25)))))))

(let* ((p (dseq dinf (mce2 (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9))) - (dbrown 5 0 23 1)))) - (d (mul (dbufrd 11 (dseries dinf 0 1) 1) 0.5)) - (l (dbufrd 10 p 1))) - (audition (out 0 (mul (sin-osc ar (duty kr d 0 do-nothing l) 0) 0.1))))

free buffers

(with-sc3 - (lambda (fd) - (async fd (b-free 10)) - (async fd (b-free 11))))

2.310 (demand-env-gen rate levels times shapes curves gate reset

levelScale levelOffset timeScale doneAction)

levels - a demand ugen or any other ugen

times - a demand ugen or any other ugen if one of these ends, +loop - loop when phase exceeds number of frames in buffer

Example

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 10 24 1))
   (send fd (b-setn1 10 0 (replicate-m 24 (exp-random 200 500))))))
(let* ((q (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9))))
       (p (dseq dinf (mce2 q (dbrown 5 0 23 1))))
       (t (dust kr 10)))
  (audition (out 0 (mul (sin-osc ar (demand t 0 (dbufrd 10 p 1)) 0) 0.1))))

Buffer as a time pattern.

(with-sc3
 (lambda (fd)
   (async fd (b-alloc 11 24 1))
   (send fd (b-setn1 11 0 (replicate-m 24 (choose (list 1 0.5 0.25)))))))
(let* ((p (dseq dinf (mce2 (dseq 3 (make-mce (list 0 3 5 0 3 7 0 5 9)))
                           (dbrown 5 0 23 1))))
       (d (mul (dbufrd 11 (dseries dinf 0 1) 1) 0.5))
       (l (dbufrd 10 p 1)))
  (audition (out 0 (mul (sin-osc ar (duty kr d 0 do-nothing l) 0) 0.1))))

free buffers

(with-sc3
 (lambda (fd)
   (async fd (b-free 10))
   (async fd (b-free 11))))

2.310 (demand-env-gen rate levels times shapes curves gate reset

levelScale levelOffset timeScale doneAction)

levels - a demand ugen or any other ugen

times - a demand ugen or any other ugen if one of these ends, the doneAction is evaluated

shapes - a demand ugen or any other ugen, the number given is the shape number according to Env

curves - a demand ugen or any other ugen, if shape is 5, this is the curve factor some curves/shapes don’t work if @@ -3095,39 +685,11 @@ loop - loop when phase exceeds number of frames in buffer

Example

the ugen is released at the next level (doneAction), if gate is x < 0, the ugen is sampled end held

reset - if reset crosses from nonpositive to positive, the ugen is reset at the next level, if it is > 1, it is reset - immediately.

Frequency envelope with random times.

(let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200)))) - (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0)))) - (y (mouse-y kr 0.01 3 1 0.1)) - (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing))) - (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.01)) 0) 0.1))))

Frequency modulation

(let* ((x (mouse-x kr -0.01 -4 0 0.1)) - (y (mouse-y kr 1 3000 1 0.1)) - (l (lambda () (dseq dinf (clone 32 (exp-rand 200 1000))))) - (t (mul sample-dur y)) - (f (demand-env-gen ar (mce2 (l) (l)) t 5 x 1 1 1 0 1 do-nothing))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

gate. Mouse x on right side of screen toggles gate.

(let* ((x (mouse-x kr 0 1 0 0.1)) - (l (u:round (dwhite dinf 300 1000) 100)) - (f (demand-env-gen kr l 0.1 5 0.3 (gt x 0.5) 1 1 0 1 do-nothing))) - (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.21)) 0) 0.1))))

2.311 (demand trig reset ugens)

demand results from demand rate ugens.

When there is a trigger at the trig input, a value is demanded from + immediately.

Frequency envelope with random times.

(let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200))))
       (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0))))
       (y (mouse-y kr 0.01 3 1 0.1))
       (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing)))
  (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.01)) 0) 0.1))))

Frequency modulation

(let* ((x (mouse-x kr -0.01 -4 0 0.1))
       (y (mouse-y kr 1 3000 1 0.1))
       (l (lambda () (dseq dinf (clone 32 (exp-rand 200 1000)))))
       (t (mul sample-dur y))
       (f (demand-env-gen ar (mce2 (l) (l)) t 5 x 1 1 1 0 1 do-nothing)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

gate. Mouse x on right side of screen toggles gate.

(let* ((x (mouse-x kr 0 1 0 0.1))
       (l (u:round (dwhite dinf 300 1000) 100))
       (f (demand-env-gen kr l 0.1 5 0.3 (gt x 0.5) 1 1 0 1 do-nothing)))
  (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.21)) 0) 0.1))))

2.311 (demand trig reset ugens)

demand results from demand rate ugens.

When there is a trigger at the trig input, a value is demanded from each ugen in the list and output. The unit generators in the list should be ’demand’ rate.

When there is a trigger at the reset input, the demand rate ugens in the list are reset.

trig - trigger. trigger can be any signal. A trigger happens when - the signal changes from non-positive to positive.

reset - trigger. Resets the list of ugens when triggered.

(define (mirror1 l) - (append l (cdr (reverse (cdr l)))))

(let* ((t (impulse kr 24 0)) - (s (drand dinf (mce2 (dseq 1 (make-mce (mirror1 (enum-from-to 1 5)))) - (drand 8 (make-mce (enum-from-to 4 11)))))) - (f (demand t 0 (mul s 100))) - (x (mouse-x kr -1 1 0 0.1)) - (o (sin-osc ar (mce2 f (add f 0.7)) 0))) - (audition (out 0 (mul (scale-neg (cubed (cubed o)) x) 0.1))))

(let* ((t (impulse kr 10 0)) - (r (dust kr 1)) - (s (dgeom dinf (midi-cps 72) (midi-ratio 1))) - (f (demand t r s)) - (o (sin-osc ar (mce2 f (add f 0.7)) 0))) - (audition (out 0 (mul (u:max (cubed o) 0) 0.1))))

(let* ((t (impulse kr 10 0)) - (s (midi-cps (diwhite dinf 60 72))) - (f (demand t 0 s)) - (o (sin-osc ar (mce2 f (add f 0.7)) 0))) - (audition (out 0 (mul (cubed (cubed o)) 0.1))))

2.312 (duty rate duration reset doneAction level)

demand results from demand rate ugens

A value is demanded from each ugen in the list and output according + the signal changes from non-positive to positive.

reset - trigger. Resets the list of ugens when triggered.

(define (mirror1 l)
  (append l (cdr (reverse (cdr l)))))
(let* ((t (impulse kr 24 0))
       (s (drand dinf (mce2 (dseq 1 (make-mce (mirror1 (enum-from-to 1 5))))
                               (drand 8 (make-mce (enum-from-to 4 11))))))
       (f (demand t 0 (mul s 100)))
       (x (mouse-x kr -1 1 0 0.1))
       (o (sin-osc ar (mce2 f (add f 0.7)) 0)))
  (audition (out 0 (mul (scale-neg (cubed (cubed o)) x) 0.1))))
(let* ((t (impulse kr 10 0))
       (r (dust kr 1))
       (s (dgeom dinf (midi-cps 72) (midi-ratio 1)))
       (f (demand t r s))
       (o (sin-osc ar (mce2 f (add f 0.7)) 0)))
  (audition (out 0 (mul (u:max (cubed o) 0) 0.1))))
(let* ((t (impulse kr 10 0))
       (s (midi-cps (diwhite dinf 60 72)))
       (f (demand t 0 s))
       (o (sin-osc ar (mce2 f (add f 0.7)) 0)))
  (audition (out 0 (mul (cubed (cubed o)) 0.1))))

2.312 (duty rate duration reset doneAction level)

demand results from demand rate ugens

A value is demanded from each ugen in the list and output according to a stream of duration values. The unit generators in the list should be ’demand’ rate. When there is a trigger at the reset input, the demand rate ugens in the list and the duration are @@ -3137,87 +699,23 @@ next value is acquired after the duration provided by the last time value.

reset: trigger or reset time values. Resets the list of ugens and the duration ugen when triggered. The reset input may also be a demand ugen, providing a stream of reset times.

doneAction: a doneAction that is evaluated when the duration stream -ends.

level: demand ugen providing the output values.

(let* ((f (duty kr - (drand dinf (mce3 0.01 0.2 0.4)) - 0 - 2 - (dseq dinf (make-mce (list 204 400 201 502 300 200))))) - (o (sin-osc ar (mul f (mce2 1 1.01)) 0))) - (audition (out 0 (mul o 0.1))))

(let* ((f (duty kr - (mouse-x kr 0.001 2 1 0.1) - 0 - 2 - (dseq dinf (make-mce (list 204 400 201 502 300 200))))) - (o (sin-osc ar (mul f (mce2 1 1.0)) 0))) - (audition (out 0 (mul o 0.1))))

2.313 (dser length array)

demand rate sequence generator.

array - array of values or other ugens -length - number of values to return

(let* ((a (dser dinf (make-mce (list 1 3 2 7 8)))) - (x (mouse-x kr 1 40 1 0.1)) - (t (impulse kr x 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.314 (dgeom length start grow)

demand rate geometric series ugen.

start - start value +ends.

level: demand ugen providing the output values.

(let* ((f (duty kr
                (drand dinf (mce3 0.01 0.2 0.4))
                0
                2
                (dseq dinf (make-mce (list 204 400 201 502 300 200)))))
       (o (sin-osc ar (mul f (mce2 1 1.01)) 0)))
  (audition (out 0 (mul o 0.1))))
(let* ((f (duty kr
                (mouse-x kr 0.001 2 1 0.1)
                0
                2
                (dseq dinf (make-mce (list 204 400 201 502 300 200)))))
       (o (sin-osc ar (mul f (mce2 1 1.0)) 0)))
  (audition (out 0 (mul o 0.1))))

2.313 (dser length array)

demand rate sequence generator.

array - array of values or other ugens +length - number of values to return

(let* ((a (dser dinf (make-mce (list 1 3 2 7 8))))
       (x (mouse-x kr 1 40 1 0.1))
       (t (impulse kr x 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.314 (dgeom length start grow)

demand rate geometric series ugen.

start - start value grow - value by which to grow ( x = x[-1] * grow ) -length - number of values to create

The arguments can be a number or any other ugen

(let* ((a (dgeom 15 1 1.2)) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

demand rate UGens are not shared...

(let* ((a (dgeom 15 1 1.2)) - (t (impulse ar (mouse-x kr 1 40 1 0.1) 0)) - (f0 (mul-add (demand (delay1 t) 0 a) 30 340)) - (f1 (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1))))

(let* ((a0 (dgeom 15 1 1.2)) - (a1 (dgeom 15 1 1.2)) - (t (impulse ar (mouse-x kr 1 40 1 0.1) 0)) - (f0 (mul-add (demand (delay1 t) 0 a0) 30 340)) - (f1 (mul-add (demand t 0 a1) 30 340))) - (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1))))

2.315 (drand length array)

(dxrand length array)

demand rate random sequence generators.

length - number of values to return +length - number of values to create

The arguments can be a number or any other ugen

(let* ((a (dgeom 15 1 1.2))
       (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

demand rate UGens are not shared...

(let* ((a  (dgeom 15 1 1.2))
       (t  (impulse ar (mouse-x kr 1 40 1 0.1) 0))
       (f0 (mul-add (demand (delay1 t) 0 a) 30 340))
       (f1 (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1))))
(let* ((a0 (dgeom 15 1 1.2))
       (a1 (dgeom 15 1 1.2))
       (t  (impulse ar (mouse-x kr 1 40 1 0.1) 0))
       (f0 (mul-add (demand (delay1 t) 0 a0) 30 340))
       (f1 (mul-add (demand t 0 a1) 30 340)))
  (audition (out 0 (mul (sin-osc ar (mce2 f0 f1) 0) 0.1))))

2.315 (drand length array)

(dxrand length array)

demand rate random sequence generators.

length - number of values to return array - array of values or other ugens

dxrand never plays the same value twice, whereas drand chooses any -value in the list.

(let ((f (lambda (u) - (let* ((a (u dinf (make-mce (list 1 3 2 7 8)))) - (t (impulse kr (mouse-x kr 1 400 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (mul (sin-osc ar f 0) 0.1))))) - (audition (out 0 (mce2 (f drand) - (f dxrand)))))

2.316 See drand

2.317 (dseries length start step)

demand rate arithmetic series ugen.

length - number of values to create +value in the list.

(let ((f (lambda (u)
           (let* ((a (u dinf (make-mce (list 1 3 2 7 8))))
                  (t (impulse kr (mouse-x kr 1 400 1 0.1) 0))
                  (f (mul-add (demand t 0 a) 30 340)))
             (mul (sin-osc ar f 0) 0.1)))))
  (audition (out 0 (mce2 (f drand)
                         (f dxrand)))))

2.316 See drand

2.317 (dseries length start step)

demand rate arithmetic series ugen.

length - number of values to create start - start value -step - step value

The arguments can be a number or any other ugen

(let* ((a (dseries 15 0 1)) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.318 (dswitch index array)

demand rate generator for switching between inputs

index - which of the inputs to return +step - step value

The arguments can be a number or any other ugen

(let* ((a (dseries 15 0 1))
       (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.318 (dswitch index array)

demand rate generator for switching between inputs

index - which of the inputs to return array - array of values or other ugens

In difference to dswitch1, dswitch embeds all items of an input demand ugen first before looking up the -next index.

(let* ((a0 (dwhite 2 3 4)) - (a1 (dwhite 2 0 1)) - (a2 (dseq 2 (make-mce (list 1 1 1 0)))) - (i (dseq 2 (make-mce (list 0 1 2 1 0)))) - (d (dswitch i (make-mce (list a0 a1 a2)))) - (t (impulse kr 4 0)) - (f (mul-add (demand t 0 d) 300 400)) - (o (mul (sin-osc ar f 0) 0.1))) - (audition (out 0 o)))

compare with dswitch1

(let* ((a0 (dwhite 2 3 4)) - (a1 (dwhite 2 0 1)) - (a2 (dseq 2 (make-mce (list 1 1 1 0)))) - (i (dseq 2 (make-mce (list 0 1 2 1 0)))) - (d (dswitch1 i (make-mce (list a0 a1 a2)))) - (t (impulse kr 4 0)) - (f (mul-add (demand t 0 d) 300 400)) - (o (mul (sin-osc ar f 0) 0.1))) - (audition (out 0 o)))

2.319 See dbrown

2.320 (dbrown length lo hi step)

(dibrown length lo hi step)

demand rate brownian movement generators.

lo - minimum value +next index.

(let* ((a0 (dwhite 2 3 4))
       (a1 (dwhite 2 0 1))
       (a2 (dseq 2 (make-mce (list 1 1 1 0))))
       (i (dseq 2 (make-mce (list 0 1 2 1 0))))
       (d (dswitch i (make-mce (list a0 a1 a2))))
       (t (impulse kr 4 0))
       (f (mul-add (demand t 0 d) 300 400))
       (o (mul (sin-osc ar f 0) 0.1)))
  (audition (out 0 o)))

compare with dswitch1

(let* ((a0 (dwhite 2 3 4))
       (a1 (dwhite 2 0 1))
       (a2 (dseq 2 (make-mce (list 1 1 1 0))))
       (i (dseq 2 (make-mce (list 0 1 2 1 0))))
       (d (dswitch1 i (make-mce (list a0 a1 a2))))
       (t (impulse kr 4 0))
       (f (mul-add (demand t 0 d) 300 400))
       (o (mul (sin-osc ar f 0) 0.1)))
  (audition (out 0 o)))

2.319 See dbrown

2.320 (dbrown length lo hi step)

(dibrown length lo hi step)

demand rate brownian movement generators.

lo - minimum value hi - maximum value step - maximum step for each new value length - number of values to create

dbrown returns numbers in the continuous range between lo and hi, dibrown returns integer values. The arguments can be a number or -any other ugen.

(let ((f (lambda (u) - (let* ((a (u dinf 0 15 1)) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (mul (sin-osc ar f 0) 0.1))))) - (audition (out 0 (mce2 (f dbrown) (f dibrown)))))

2.321 (dseq length array)

demand rate sequence generator.

array - array of values or other ugens -length - number of repeats

(let* ((a (dseq 3 (make-mce (list 1 3 2 7 8)))) - (t (impulse kr (mouse-x kr 1 40 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

(let* ((a (dseq dinf (make-mce (replicate-m 32 (random 0 10))))) - (t (impulse ar (mouse-x kr 1 10000 1 0.1) 0)) - (f (mul-add (demand t 0 a) 30 340))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.322 See latoocarfian-c.

2.323 (fb-sine-c rate freq im fb a c xi yi)

Feedback sine with chaotic phase indexing.

freq - iteration frequency in Hz - 22050 +any other ugen.

(let ((f (lambda (u)
           (let* ((a (u dinf 0 15 1))
                  (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
                  (f (mul-add (demand t 0 a) 30 340)))
             (mul (sin-osc ar f 0) 0.1)))))
  (audition (out 0 (mce2 (f dbrown) (f dibrown)))))

2.321 (dseq length array)

demand rate sequence generator.

array - array of values or other ugens +length - number of repeats

(let* ((a (dseq 3 (make-mce (list 1 3 2 7 8))))
       (t (impulse kr (mouse-x kr 1 40 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))
(let* ((a (dseq dinf (make-mce (replicate-m 32 (random 0 10)))))
       (t (impulse ar (mouse-x kr 1 10000 1 0.1) 0))
       (f (mul-add (demand t 0 a) 30 340)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.322 See latoocarfian-c.

2.323 (fb-sine-c rate freq im fb a c xi yi)

Feedback sine with chaotic phase indexing.

freq - iteration frequency in Hz - 22050 im - index multiplier amount - 1 fb - feedback amount - 0.1 a - phase multiplier amount - 1.1 @@ -3227,35 +725,12 @@ yi - initial value of y - 0.1

A cubic-interpolating sound gene equations:

xn+1 = sin(im*yn + fb*xn) yn+1 = (ayn + c) % 2pi

This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0, and a = 1 a normal -sinewave results.

sclang default values

(audition - (out 0 (mul (fb-sine-c ar (fdiv sample-rate 4) 1 0.1 1.1 0.5 0.1 0.1) - 0.2)))

increase feedback

(let ((fb (line kr 0.01 4 10 do-nothing))) - (audition - (out 0 (mul (fb-sine-c ar sample-rate 1 fb 1.1 0.5 0.1 0.1) 0.2))))

increase phase multiplier

(let ((a (line kr 1 2 10 do-nothing))) - (audition - (out 0 (mul (fb-sine-c ar sample-rate 1 0 a 0.5 0.1 0.1) 0.2))))

randomly modulate parameters

(let* ((x (mouse-x kr 1 12 0 0.1)) - (f (lambda (m a) (mul-add (lf-noise2 kr x) m a)))) - (audition - (out 0 (mul (fb-sine-c ar - (f 1e4 1e4) - (f 32 33) - (f 0.5 0) - (f 0.05 1.05) - (f 0.3 0.3) - 0.1 - 0.1) - 0.2))))

2.324 See fb-sine-c

2.325 (quad-n rate freq a b c xi)

(quad-l rate freq a b c xi) +sinewave results.

sclang default values

(audition
 (out 0 (mul (fb-sine-c ar (fdiv sample-rate 4) 1 0.1 1.1 0.5 0.1 0.1)
             0.2)))

increase feedback

(let ((fb (line kr 0.01 4 10 do-nothing)))
  (audition
   (out 0 (mul (fb-sine-c ar sample-rate 1 fb 1.1 0.5 0.1 0.1) 0.2))))

increase phase multiplier

(let ((a (line kr 1 2 10 do-nothing)))
  (audition
   (out 0 (mul (fb-sine-c ar sample-rate 1 0 a 0.5 0.1 0.1) 0.2))))

randomly modulate parameters

(let* ((x (mouse-x kr 1 12 0 0.1))
       (f (lambda (m a) (mul-add (lf-noise2 kr x) m a))))
  (audition
   (out 0 (mul (fb-sine-c ar
                          (f 10000.0 10000.0)
                          (f 32 33)
                          (f 0.5 0)
                          (f 0.05 1.05)
                          (f 0.3 0.3)
                          0.1
                          0.1)
               0.2))))

2.324 See fb-sine-c

2.325 (quad-n rate freq a b c xi)

(quad-l rate freq a b c xi) (quad-c rate freq a b c xi)

freq - iteration frequency in Hertz a, b, c - equation variables xi - initial value of x

General quadratic map chaotic generator. Non-, linear- and cubic- interpolating sound generators based on the difference equation: -xn+1 = axn2 + bxn + c

(define quad_ quad-c)

(audition - (out 0 (mul (quad_ ar 4000 1 -1 -0.75 0) 0.2)))

(let ((r (mouse-x kr 3.5441 4 0 0.1))) - (audition - (out 0 (mul (quad_ ar 4000.0 (neg r) r 0 0.1) 0.4))))

(let ((r (mouse-x kr 3.5441 4 0 0.1))) - (audition - (out 0 (mul (sin-osc ar (mul-add (quad_ ar 4 (neg r) r 0 0.1) 800 900) 0) - 0.4))))

2.326 (lorenz-l rate freq s r b h xi yi zi)

freq - iteration frequency in Hertz +xn+1 = axn2 + bxn + c

(define quad_ quad-c)

(audition
 (out 0 (mul (quad_ ar 4000 1 -1 -0.75 0) 0.2)))
(let ((r (mouse-x kr 3.5441 4 0 0.1)))
  (audition
   (out 0 (mul (quad_ ar 4000.0 (neg r) r 0 0.1) 0.4))))
(let ((r (mouse-x kr 3.5441 4 0 0.1)))
  (audition
   (out 0 (mul (sin-osc ar (mul-add (quad_ ar 4 (neg r) r 0 0.1) 800 900) 0)
               0.4))))

2.326 (lorenz-l rate freq s r b h xi yi zi)

freq - iteration frequency in Hertz s, r, b - equation variables h - integration time step xi - initial value of x @@ -3266,114 +741,44 @@ The system is composed of three ordinary differential equations:

x’ y’ = x(r - z) - y z’ = xy - bz

The time step amount h determines the rate at which the ODE is evaluated. Higher values will increase the rate, but cause more -instability. A safe choice is the default amount of 0.05.

vary frequency

(audition - (out 0 (mul (lorenz-l ar (mouse-x kr 20 sample-rate 0 0.1) - 10 28 2.667 0.05 0.1 0 0) - 0.3)))

randomly modulate params

(audition - (out 0 (mul (lorenz-l ar sample-rate - (mul-add (lf-noise0 kr 1) 2 10) - (mul-add (lf-noise0 kr 1) 20 38) - (mul-add (lf-noise0 kr 1) 1.5 2) - 0.05 - 0.1 0.0 0.0) - 0.2)))

as a frequency control

(audition - (out 0 (mul - (sin-osc ar (mul-add - (lag - (lorenz-l ar - (mouse-x kr 1 200 0 0.1) - 10 - 28 - 2.667 - 0.05 - 0.1 - 0 - 0) - 0.003) - 800 900) - 0) - 0.4)))

2.327 See standard-l.

2.328 See quad-n

2.329 See cusp-n

2.330 See latoocarfian-c.

2.331 (logistic rate chaosParam freq)

UNDOCUMENTED.

Implements the equation: y1 = param * y1 * (1.0 - y1)

(audition - (out 0 (mul (logistic ar 2.9 1000) 0.2)))

2.332 See fb-sine-c

2.333 (latoocarfian-c rate freq a b c d xi yi)

(latoocarfian-l rate freq a b c d xi yi)

(latoocarfian-n rate freq a b c d xi yi)

This is a function given in Clifford Pickover’s book Chaos in +instability. A safe choice is the default amount of 0.05.

vary frequency

(audition
 (out 0 (mul (lorenz-l ar (mouse-x kr 20 sample-rate 0 0.1)
                       10 28 2.667 0.05 0.1 0 0)
             0.3)))

randomly modulate params

(audition
 (out 0 (mul (lorenz-l ar sample-rate
                       (mul-add (lf-noise0 kr 1) 2 10)
                       (mul-add (lf-noise0 kr 1) 20 38)
                       (mul-add (lf-noise0 kr 1) 1.5 2)
                       0.05
                       0.1 0.0 0.0)
             0.2)))

as a frequency control

(audition
 (out 0 (mul
         (sin-osc ar (mul-add
                      (lag
                       (lorenz-l ar
                                 (mouse-x kr 1 200 0 0.1)
                                 10
                                 28
                                 2.667
                                 0.05
                                 0.1
                                 0
                                 0)
                       0.003)
                      800 900)
                  0)
         0.4)))

2.327 See standard-l.

2.328 See quad-n

2.329 See cusp-n

2.330 See latoocarfian-c.

2.331 (logistic rate chaosParam freq)

UNDOCUMENTED.

Implements the equation: y1 = param * y1 * (1.0 - y1)

(audition
 (out 0 (mul (logistic ar 2.9 1000) 0.2)))

2.332 See fb-sine-c

2.333 (latoocarfian-c rate freq a b c d xi yi)

(latoocarfian-l rate freq a b c d xi yi) +(latoocarfian-n rate freq a b c d xi yi)

This is a function given in Clifford Pickover’s book Chaos in Wonderland, pg 26. The function has four parameters a, b, c, and -d. The function is:

xnew = sin -

(y * b)

2.334 (rossler rate chaosParam dt)

The Rossler attractor is a well known chaotic function. The +d. The function is:

xnew = sin(y * b) + c * sin(x * b); +ynew = sin(x * a) + d * sin(y * a); +x = xnew; +y = ynew; +output = x;

According to Pickover, parameters a and b should be in the range +from -3 to +3, and parameters c and d should be in the range from +0.5 to 1.5. The function can, depending on the parameters given, +give continuous chaotic output, converge to a single value +(silence) or oscillate in a cycle (tone). This UGen is +experimental and not optimized currently, so is rather hoggish of +CPU.

Default initial parameters.

(let ((x (mouse-x kr 20 sample-rate 0 0.1)))
  (audition
   (out 0 (mul (latoocarfian-c ar x 1 3 0.5 0.5 0.5 0.5) 0.2))))

randomly modulate all parameters.

(audition
 (out 0 (mul (latoocarfian-c ar
                             (fdiv sample-rate 4)
                             (mul-add (lf-noise2 kr 2) 1.5 1.5)
                             (mul-add (lf-noise2 kr 2) 1.5 1.5)
                             (mul-add (lf-noise2 kr 2) 0.5 1.5)
                             (mul-add (lf-noise2 kr 2) 0.5 1.5)
                             0.5
                             0.5)
             0.2)))

2.334 (rossler rate chaosParam dt)

The Rossler attractor is a well known chaotic function. The chaosParam can be varied from 1.0 to 25.0 with a dt of 0.04. Valid -ranges for chaosParam vary depending on dt.

(audition - (out 0 (mul (rossler ar 4 0.08) 0.1)))

2.335 (standard-l rate freq k xi yi)

(standard-n rate freq k xi yi)

Standard map chaotic generator.

freq - iteration frequency in Hertz +ranges for chaosParam vary depending on dt.

(audition
 (out 0 (mul (rossler ar 4 0.08) 0.1)))

2.335 (standard-l rate freq k xi yi)

(standard-n rate freq k xi yi)

Standard map chaotic generator.

freq - iteration frequency in Hertz k - perturbation amount xi - initial value of x yi - initial value of y

A linear-interpolating sound generator based on the difference equations:

xn+1 = (xn + yn+1) % 2pi yn+1 = (yn + ksin(xn)) % 2pi

The standard map is an area preserving map of a cylinder discovered by -the plasma physicist Boris Chirikov.

Vary frequency

(audition - (out 0 (mul (standard-l ar (mouse-x kr 20 sample-rate 0 0.1) 1 0.5 0) 0.3)))

Mouse-controlled parameter.

(let ((f (fdiv sample-rate 2)) - (x (mouse-x kr 0.9 4 0 0.1))) - (audition - (out 0 (mul (standard-l ar f x 0.5 0) 0.3))))

As a frequency control

(let* ((x (mouse-x kr 0.9 4 0 0.1)) - (f (mul-add (standard-l ar 40 x 0.5 0) 800 900))) - (audition - (out 0 (mul (sin-osc ar f 0) 0.4))))

2.336 See quad-n

2.337 (cusp-n rate freq a b xi)

(cusp-l rate freq a b xi)

freq - iteration frequency in Hertz +the plasma physicist Boris Chirikov.

Vary frequency

(audition
 (out 0 (mul (standard-l ar (mouse-x kr 20 sample-rate 0 0.1) 1 0.5 0) 0.3)))

Mouse-controlled parameter.

(let ((f (fdiv sample-rate 2))
      (x (mouse-x kr 0.9 4 0 0.1)))
  (audition
   (out 0 (mul (standard-l ar f x 0.5 0) 0.3))))

As a frequency control

(let* ((x (mouse-x kr 0.9 4 0 0.1))
       (f (mul-add (standard-l ar 40 x 0.5 0) 800 900)))
  (audition
   (out 0 (mul (sin-osc ar f 0) 0.4))))

2.336 See quad-n

2.337 (cusp-n rate freq a b xi)

(cusp-l rate freq a b xi)

freq - iteration frequency in Hertz a, b - equation variables xi - initial value of x

Cusp map chaotic generator. Non- and linear- interpolating sound -generator based on the difference equation:

xn+1 = a - b*sqrt(|xn|)

(define cusp_ cusp-l)

vary frequency

(let ((x (mouse-x kr 20 sample-rate 0 0.1))) - (audition (out 0 (mul (cusp_ ar x 1.0 1.99 0) 0.3))))

mouse-controlled params

(let ((x (mouse-x kr 0.9 1.1 1 0.1)) - (y (mouse-y kr 1.8 2 1 0.1))) - (audition (out 0 (mul (cusp_ ar (fdiv sample-rate 4) x y 0) 0.3))))

as a frequency control

(let* ((x (mouse-x kr 0.9 1.1 1 0.1)) - (y (mouse-y kr 1.8 2 1 0.1)) - (f (mul-add (cusp_ ar 40 x y 0) 800 900))) - (audition (out 0 (mul (sin-osc ar f 0.0) 0.4))))

2.338 (lin-cong-c rate freq a c m xi)

(lin-cong-l rate freq a c m xi) +generator based on the difference equation:

xn+1 = a - b*sqrt(|xn|)

(define cusp_ cusp-l)

vary frequency

(let ((x (mouse-x kr 20 sample-rate 0 0.1)))
  (audition (out 0 (mul (cusp_ ar x 1.0 1.99 0) 0.3))))

mouse-controlled params

(let ((x (mouse-x kr 0.9 1.1 1 0.1))
      (y (mouse-y kr 1.8 2 1 0.1)))
  (audition (out 0 (mul (cusp_ ar (fdiv sample-rate 4) x y 0) 0.3))))

as a frequency control

(let* ((x (mouse-x kr 0.9 1.1 1 0.1))
       (y (mouse-y kr 1.8 2 1 0.1))
       (f (mul-add (cusp_ ar 40 x y 0) 800 900)))
  (audition (out 0 (mul (sin-osc ar f 0.0) 0.4))))

2.338 (lin-cong-c rate freq a c m xi)

(lin-cong-l rate freq a c m xi) (lin-cong-n rate freq a c m xi)

linear congruential chaotic generator.

freq - iteration frequency in Hertz a - multiplier amount c - increment amount m - modulus amount xi - initial value of x

A cubic-interpolating sound generator based on the difference -equation:

xn+1 = (axn + c) % m

The output signal is automatically scaled to a range of [-1, 1].

Default initial parameters.

(audition - (out 0 (let ((x (mouse-x kr 20 sample-rate 0 0.1))) - (mul (lin-cong-c ar x 1.1 0.13 1 0) 0.2))))

randomly modulate parameters.

(audition - (out 0 (mul (lin-cong-c ar - (mul-add (lf-noise2 kr 1.0) 1e4 1e4) - (mul-add (lf-noise2 kr 0.1) 0.5 1.4) - (mul-add (lf-noise2 kr 0.1) 0.1 0.1) - (lf-noise2 kr 0.1) - 0) - 0.2)))

As frequency control...

(audition - (out 0 (mul (sin-osc ar (mul-add (lin-cong-c ar - 40 - (mul-add (lf-noise2 kr 0.1) 0.1 1.0) - (mul-add (lf-noise2 kr 0.1) 0.1 0.1) - (lf-noise2 kr 0.1) - 0) - 500 600) 0) - 0.4)))

2.339 (crackle rate chaosParam)

A noise generator based on a chaotic function. The parameter of +equation:

xn+1 = (axn + c) % m

The output signal is automatically scaled to a range of [-1, 1].

Default initial parameters.

(audition
 (out 0 (let ((x (mouse-x kr 20 sample-rate 0 0.1)))
          (mul (lin-cong-c ar x 1.1 0.13 1 0) 0.2))))

randomly modulate parameters.

(audition
 (out 0 (mul (lin-cong-c ar
                         (mul-add (lf-noise2 kr 1.0) 10000.0 10000.0)
                         (mul-add (lf-noise2 kr 0.1) 0.5 1.4)
                         (mul-add (lf-noise2 kr 0.1) 0.1 0.1)
                         (lf-noise2 kr 0.1)
                         0)
             0.2)))

As frequency control...

(audition
 (out 0 (mul (sin-osc ar (mul-add (lin-cong-c ar
                                              40
                                              (mul-add (lf-noise2 kr 0.1) 0.1 1.0)
                                              (mul-add (lf-noise2 kr 0.1) 0.1 0.1)
                                              (lf-noise2 kr 0.1)
                                              0)
                                  500 600) 0)
             0.4)))

2.339 (crackle rate chaosParam)

A noise generator based on a chaotic function. The parameter of the chaotic function has useful values from just below 1.0 to just -above 2.0. Towards 2.0 the sound crackles.

The equation implemented is: y0 = fabs(y1 * param - y2 - 0.05f)

(audition (out 0 (mul (crackle ar 1.95) 0.5)))

Modulate chaos parameter

(let ((p (line kr 1.0 2.0 3 remove-synth))) - (audition (out 0 (mul (crackle ar p) 0.5))))

2.340 (henon-n rate freq a b x0 x1)

(henon-l rate freq a b x0 x1) +above 2.0. Towards 2.0 the sound crackles.

The equation implemented is: y0 = fabs(y1 * param - y2 - 0.05f)

(audition (out 0 (mul (crackle ar 1.95) 0.5)))

Modulate chaos parameter

(let ((p (line kr 1.0 2.0 3 remove-synth)))
  (audition (out 0 (mul (crackle ar p) 0.5))))

2.340 (henon-n rate freq a b x0 x1)

(henon-l rate freq a b x0 x1) (henon-c rate freq a b x0 x1)

Henon map chaotic generator.

freq - iteration frequency in Hertz – 22050 a, b - equation variables – 1.4, 0.3 x0, x1 - initial and second values of x – 0, 0

A non-interpolating sound generator based on the difference equation:

xn + 2 = 1 - axn + 12 + bxn

This equation was discovered by French astronomer Michel Henon -while studying the orbits of stars in globular clusters.

With default initial parameters.

(audition - (out 0 (mul (henon-n ar (mouse-x kr 20 sample-rate 0 0.1) 1.4 0.3 0 0) - 0.1)))

With mouse-control of parameters.

(audition - (out 0 (mul (henon-n ar - (fdiv sample-rate 4) - (mouse-x kr 1 1.4 0 0.1) - (mouse-y kr 0 0.3 0 0.1) - 0 - 0) - 0.1)))

With randomly modulate parameters.

(audition - (out 0 (mul (henon-n ar - (fdiv sample-rate 8) - (mul-add (lf-noise2 kr 1) 0.20 1.20) - (mul-add (lf-noise2 kr 1) 0.15 0.15) - 0 - 0) - 0.1)))

As a frequency control.

(let ((x (mouse-x kr 1 1.4 0 0.1)) - (y (mouse-y kr 0 0.3 0 0.1)) - (f 40)) - (audition - (out 0 (mul (sin-osc ar (mul-add (henon-n ar f x y 0 0) 800 900) 0) - 0.4))))

2.341 See henon-n

2.342 See lin-cong-c.

2.343 See GbmanL.

2.344 See GbmanL.

2.345 See henon-n

2.346 See lin-cong-c.

2.347 (gbman-c rate freq xi yi)

(gbman-l rate freq xi yi) +while studying the orbits of stars in globular clusters.

With default initial parameters.

(audition
 (out 0 (mul (henon-n ar (mouse-x kr 20 sample-rate 0 0.1) 1.4 0.3 0 0)
             0.1)))

With mouse-control of parameters.

(audition
 (out 0 (mul (henon-n ar
                      (fdiv sample-rate 4)
                      (mouse-x kr 1 1.4 0 0.1)
                      (mouse-y kr 0 0.3 0 0.1)
                      0
                      0)
             0.1)))

With randomly modulate parameters.

(audition
 (out 0 (mul (henon-n ar
                      (fdiv sample-rate 8)
                      (mul-add (lf-noise2 kr 1) 0.2 1.2)
                      (mul-add (lf-noise2 kr 1) 0.15 0.15)
                      0
                      0)
             0.1)))

As a frequency control.

(let ((x (mouse-x kr 1 1.4 0 0.1))
      (y (mouse-y kr 0 0.3 0 0.1))
      (f 40))
  (audition
   (out 0 (mul (sin-osc ar (mul-add (henon-n ar f x y 0 0) 800 900) 0)
               0.4))))

2.341 See henon-n

2.342 See lin-cong-c.

2.343 See GbmanL.

2.344 See GbmanL.

2.345 See henon-n

2.346 See lin-cong-c.

2.347 (gbman-c rate freq xi yi)

(gbman-l rate freq xi yi) (gbman-n rate freq xi yi)

Gingerbreadman map chaotic generator. Cubic, linear and non-interpolating variants.

freq - iteration frequency in Hertz xi - initial value of x @@ -3381,86 +786,34 @@ yi - initial value of y

A linear-interpolating sound generator based on equations:

xn+1 = 1 - yn + |xn| yn+1 = xn

The behavior of the system is dependent only on its initial conditions qand cannot be changed once it’s started.

Reference: Devaney, R. L. "The Gingerbreadman." Algorithm 3, 15-16, -Jan. 1992.

sclang default initial parameters.

(audition - (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.1) 0.1)))

Different initial parameters.

(audition - (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) -0.7 -2.7) 0.1)))

Wait for it...

(audition - (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.0002) 0.1)))

As a frequency control

(audition - (out 0 (mul (sin-osc ar (mul-add (gbman-l ar 40 1.2 2.1) 400 500) 0) 0.4)))

2.348 (lin-pan2 in pos level)

Two channel linear pan. See pan2.

(audition (out 0 (lin-pan2 (pink-noise ar) (f-sin-osc kr 2 0) 0.1)))

(audition (out 0 (lin-pan2 (f-sin-osc ar 800 0.1) (f-sin-osc kr 3 0) 0.1)))

2.349 (rotate2 x y pos)

Rotate a sound field. rotate2 can be used for rotating an +Jan. 1992.

sclang default initial parameters.

(audition
 (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.1) 0.1)))

Different initial parameters.

(audition
 (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) -0.7 -2.7) 0.1)))

Wait for it...

(audition
 (out 0 (mul (gbman-l ar (mouse-x kr 20 sample-rate 0 0.1) 1.2 2.0002) 0.1)))

As a frequency control

(audition
 (out 0 (mul (sin-osc ar (mul-add (gbman-l ar 40 1.2 2.1) 400 500) 0) 0.4)))

2.348 (lin-pan2 in pos level)

Two channel linear pan. See pan2.

(audition (out 0 (lin-pan2 (pink-noise ar) (f-sin-osc kr 2 0) 0.1)))

(audition (out 0 (lin-pan2 (f-sin-osc ar 800 0.1) (f-sin-osc kr 3 0) 0.1)))

2.349 (rotate2 x y pos)

Rotate a sound field. rotate2 can be used for rotating an ambisonic B-format sound field around an axis. rotate2 does an equal power rotation so it also works well on stereo sounds. It takes two audio inputs (x, y) and an angle control (pos). It -outputs two channels (x, y).

It computes:

xout = cos(angle) * xin + sin(angle) * yin - yout = cos(angle) * yin - sin(angle) * xin

where angle = pos * pi, so that -1 becomes -pi and +1 becomes +pi. +outputs two channels (x, y).

It computes:

xout = cos(angle) * xin + sin(angle) * yin; + yout = cos(angle) * yin - sin(angle) * xin;

where angle = pos * pi, so that -1 becomes -pi and +1 becomes +pi. This allows you to use an lf-saw to do continuous rotation around a circle.

The control pos is the angle to rotate around the circle from -1 to +1. -1 is 180 degrees, -0.5 is left, 0 is forward, +0.5 is -right, +1 is behind.

(let* ((p (mul (white-noise ar) 0.05)) - (q (mul (mix (lf-saw ar (make-mce (list 200 200.37 201)) 0)) 0.03)) - (encoded (add (pan-b2 p -0.5 1) (pan-b2 q -0.5 1))) - (rotated (rotate2 (mce-channel encoded 1) - (mce-channel encoded 2) - (mouse-x kr -1 1 0 0.1))) - (decoded (decode-b2 4 - (mce-channel encoded 0) - (mce-channel rotated 0) - (mce-channel rotated 1) - 0.5))) - (audition (out 0 decoded)))

Rotation of stereo sound, via LFO.

(let ((x (mul (pink-noise ar) 0.4)) - (y (mul (lf-tri ar 800 0) (mul (lf-pulse kr 3 0 0.3) 0.2)))) - (audition (out 0 (rotate2 x y (lf-saw kr 0.1 0)))))

Rotation of stereo sound, via mouse.

(let ((x (mix-fill 4 (lambda (_) (mul (lf-saw ar (rand 198 202) 0) 0.1)))) - (y (mul (sin-osc ar 900 0) (mul (lf-pulse kr 3 0 0.3) 0.2)))) - (audition (out 0 (rotate2 x y (mouse-x kr 0 2 0 0.1)))))

2.350 (decode-b2 numChannels w x y orientation)

2D Ambisonic B-format decoder.

Decode a two dimensional ambisonic B-format signal to a set of +right, +1 is behind.

(let* ((p (mul (white-noise ar) 0.05))
       (q (mul (mix (lf-saw ar (make-mce (list 200 200.37 201)) 0)) 0.03))
       (encoded (add (pan-b2 p -0.5 1) (pan-b2 q -0.5 1)))
       (rotated (rotate2 (mce-channel encoded 1)
                         (mce-channel encoded 2)
                         (mouse-x kr -1 1 0 0.1)))
       (decoded (decode-b2 4
                          (mce-channel encoded 0)
                          (mce-channel rotated 0)
                          (mce-channel rotated 1)
                          0.5)))
  (audition (out 0 decoded)))

Rotation of stereo sound, via LFO.

(let ((x (mul (pink-noise ar) 0.4))
      (y (mul (lf-tri ar 800 0) (mul (lf-pulse kr 3 0 0.3) 0.2))))
  (audition (out 0 (rotate2 x y (lf-saw kr 0.1 0)))))

Rotation of stereo sound, via mouse.

(let ((x (mix-fill 4 (lambda (_) (mul (lf-saw ar (rand 198 202) 0) 0.1))))
      (y (mul (sin-osc ar 900 0) (mul (lf-pulse kr 3 0 0.3) 0.2))))
  (audition (out 0 (rotate2 x y (mouse-x kr 0 2 0 0.1)))))

2.350 (decode-b2 numChannels w x y orientation)

2D Ambisonic B-format decoder.

Decode a two dimensional ambisonic B-format signal to a set of speakers in a regular polygon. The outputs will be in clockwise order. The position of the first speaker is either center or left of center.

The number of output speakers is typically 4 to 8.

The parameters w, x and y are the B-format signals.

The parameter orientation should be zero if the front is a vertex of the polygon. The first speaker will be directly in front. Should be 0.5 if the front bisects a side of the polygon. Then the first speaker will be the one left of -center. Default is 0.5.

(let* ((p (pink-noise ar)) - (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1)) - (decoded (decode-b2 4 - (mce-channel encoded 0) - (mce-channel encoded 1) - (mce-channel encoded 2) - 0))) - (audition (out 0 decoded)))

2.351 (pan2 in pos level)

Two channel equal power panner. The pan position is bipolar, -1 is -left, +1 is right. The level is a control rate input.

(let ((p (f-sin-osc kr 2 0))) - (audition (out 0 (pan2 (pink-noise ar) p 0.3))))

(let ((x (mouse-x kr -1 1 0 0.1)) - (y (mouse-y kr 0 1 0 0.1))) - (audition (out 0 (pan2 (pink-noise ar) x y))))

2.352 (pan-b2 in azimuth gain)

2D Ambisonic B-format panner. Encode a mono signal to two +center. Default is 0.5.

(let* ((p (pink-noise ar))
       (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1))
       (decoded (decode-b2 4
                          (mce-channel encoded 0)
                          (mce-channel encoded 1)
                          (mce-channel encoded 2)
                          0)))
  (audition (out 0 decoded)))

2.351 (pan2 in pos level)

Two channel equal power panner. The pan position is bipolar, -1 is +left, +1 is right. The level is a control rate input.

(let ((p (f-sin-osc kr 2 0)))
  (audition (out 0 (pan2 (pink-noise ar) p 0.3))))
(let ((x (mouse-x kr -1 1 0 0.1))
      (y (mouse-y kr 0 1 0 0.1)))
  (audition (out 0 (pan2 (pink-noise ar) x y))))

2.352 (pan-b2 in azimuth gain)

2D Ambisonic B-format panner. Encode a mono signal to two dimensional ambisonic B-format. The azimuth parameter is the position around the circle from -1 to +1. -1 is behind, -0.5 is -left, 0 is forward, +0.5 is right, +1 is behind.

(let* ((p (pink-noise ar)) - (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1)) - (decoded (decode-b2 4 - (mce-channel encoded 0) - (mce-channel encoded 1) - (mce-channel encoded 2) - 0.5))) - (audition (out 0 decoded)))

2.353 (detect-silence in amp time doneAction)

If the signal at ‘in’ falls below ‘amp’ for ‘time’ seconds then -‘doneAction’ is raised.

(let ((s (mul (sin-osc ar 440 0) (mouse-y kr 0 0.4 0 0.1)))) - (audition (mrg2 (detect-silence s 0.1 0.2 remove-synth) - (out 0 s))))

(with-sc3 display-server-status)

2.354 (line rate start end dur doneAction)

Generates a line from the start value to the end value.

start - starting value +left, 0 is forward, +0.5 is right, +1 is behind.

(let* ((p (pink-noise ar))
       (encoded (pan-b2 p (mouse-x kr -1 1 0 0.1) 0.1))
       (decoded (decode-b2 4
                          (mce-channel encoded 0)
                          (mce-channel encoded 1)
                          (mce-channel encoded 2)
                          0.5)))
  (audition (out 0 decoded)))

2.353 (detect-silence in amp time doneAction)

If the signal at ‘in’ falls below ‘amp’ for ‘time’ seconds then +‘doneAction’ is raised.

(let ((s (mul (sin-osc ar 440 0) (mouse-y kr 0 0.4 0 0.1))))
  (audition (mrg2 (detect-silence s 0.1 0.2 remove-synth)
                  (out 0 s))))

(with-sc3 display-server-status)

2.354 (line rate start end dur doneAction)

Generates a line from the start value to the end value.

start - starting value end - ending value dur - duration in seconds

Note: The SC3 UGen reorders the mul and add inputs to precede the -doneAction input.

(let ((f (line kr 200 17000 5 remove-synth))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.355 (free trig nodeID)

When triggered frees a node.

trig - when triggered, frees node -nodeID - node to be freed

(with-sc3 - (lambda (fd) - (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1))) - (send-synth fd "b" (mrg2 (out 1 (mul (pink-noise ar) 0.1)) - (free (dust ar 6) 1001))) - (send fd (s-new0 "a" 1001 0 0)) - (send fd (s-new0 "b" -1 0 0))))

(with-sc3 reset)

2.356 (pause-self-when-done src)

pause the synth when the ’done’ flag of the unit at ‘src’ is set.

(let* ((x (mouse-x kr -1 1 0 0.1)) - (e (linen x 1 0.1 1 pause-synth))) - (audition (out 0 (mul (sin-osc ar 440 0) e))))

(let* ((x (mouse-x kr -1 1 0 0.1)) - (e (linen x 2 0.1 2 do-nothing))) - (audition (mrg2 (pause-self-when-done e) - (out 0 (mul (sin-osc ar 440 0) e)))))

2.357 (pause-self src)

pause enclosing synth when input signal crosses from non-positive +doneAction input.

(let ((f (line kr 200 17000 5 remove-synth)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.355 (free trig nodeID)

When triggered frees a node.

trig - when triggered, frees node +nodeID - node to be freed

(with-sc3
 (lambda (fd)
   (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1)))
   (send-synth fd "b" (mrg2 (out 1 (mul (pink-noise ar) 0.1))
                           (free (dust ar 6) 1001)))
   (send fd (s-new0 "a" 1001 0 0))
   (send fd (s-new0 "b" -1 0 0))))

(with-sc3 reset)

2.356 (pause-self-when-done src)

pause the synth when the ’done’ flag of the unit at ‘src’ is set.

(let* ((x (mouse-x kr -1 1 0 0.1))
       (e (linen x 1 0.1 1 pause-synth)))
  (audition (out 0 (mul (sin-osc ar 440 0) e))))
(let* ((x (mouse-x kr -1 1 0 0.1))
       (e (linen x 2 0.1 2 do-nothing)))
  (audition (mrg2 (pause-self-when-done e)
                  (out 0 (mul (sin-osc ar 440 0) e)))))

2.357 (pause-self src)

pause enclosing synth when input signal crosses from non-positive to positive. If the synth is restarted and the gate reset the -synthesis *not* paused a second time.

(audition - (mrg2 (pause-self (mouse-x kr -1 1 0 0.1)) - (out 0 (mul (sin-osc ar 440 0) 0.1))))

2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

A segment based envelope generator. Note that the SC3 language +synthesis *not* paused a second time.

(audition
 (mrg2 (pause-self (mouse-x kr -1 1 0 0.1))
       (out 0 (mul (sin-osc ar 440 0) 0.1))))

2.358 (env-gen rate gate levelScale levelBias timeScale doneAction envelope)

A segment based envelope generator. Note that the SC3 language reorders the inputs to this UGen so that the envelope is the first argument.

There are utilities for contructing the envelope argument.

The arguments for levelScale, levelBias, and timeScale are polled when the env-gen is triggered and remain constant for the duration @@ -3470,73 +823,16 @@ of the envelope.

envelope - an breakpoint set

gate - this triggers t envelope (e.g. Env.adsr, Env.asr), the envelope is held open until the gate becomes 0, at which point is released.

levelScale - scales the levels of the breakpoints.

levelBias - offsets the levels of the breakpoints.

timeScale - scales the durations of the segments.

doneAction - an integer representing an action to be executed when the env is finished playing. This can be used to free - the enclosing synth, etc.

(import (rhs) (rsc3))

Percussive envelope -(let* ((d (env-perc 0.01 1 1 (list -4 -4))) - (e (env-gen kr 1 0.1 0 1 remove-synth d))) - (audition (out 0 (mul e (sin-osc ar 440 0)))))

The break-point assistant makes a static envelope from a -co-ordinate list. There is a duration and amplitude scalar. -(let* ((d (env-coord (list (cons 0 0) - (cons 0.75 1) - (cons 1 0)) - 1 1 (replicate 3 "linear"))) - (e (env-gen kr 1 0.1 0 1 remove-synth d))) - (audition (out 0 (mul e (sin-osc ar 440 0)))))

Trapezoidal -(let* ((d (env-trapezoid 0 0.25 2 0.1)) - (e (env-gen kr 1 0.1 0 1 remove-synth d))) - (audition (out 0 (mul e (sin-osc ar 440 0)))))

0.0 3 -1 -1 0.1 0.5 1.0 0.0 0.1 0.0 1.0 0.0 0.0 1.5 1.0 0.0 -(env-trapezoid 0 0.25 2 0.1)

2.359 (free-self-when-done src)

free the synth when the ’done’ flag of the unit at ‘src’ is set.

(let* ((x (mouse-x kr -1 1 0 0.1)) - (e (linen x 1 0.1 1 remove-synth))) - (audition (out 0 (mul (sin-osc ar 440 0) e))))

(let* ((x (mouse-x kr -1 1 0 0.1)) - (e (linen x 2 0.1 2 do-nothing))) - (audition (mrg2 (free-self-when-done e) - (out 0 (mul (sin-osc ar 440 0) e)))))

2.360 (pause gate nodeID)

When triggered pauses a node.

gate - when gate is 0, node is paused, when 1 it runs -nodeID - node to be paused

(with-sc3 - (lambda (fd) - (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1))) - (send-synth fd "b" (letc ((g 1)) - (Mrg (out 1 (mul (pink-noise ar) 0.05)) - (pause g 1001)))) - (send fd (/s_new "a" 1001 0 0)) - (send fd (/s_new "b" 1002 0 0)) - (sleep 1) - (send fd (/n_set 1002 "g" 0)) - (sleep 1) - (send fd (/n_set 1002 "g" 1)) - (sleep 1) - (reset fd)))

2.361 (x-line rate start end dur doneAction)

Exponential line generator. Generates an exponential curve from + the enclosing synth, etc.

(import (rhs) (rsc3))

Percussive envelope

(let* ((d (env-perc 0.01 1 1 (list -4 -4)))
       (e (env-gen kr 1 0.1 0 1 remove-synth d)))
  (audition (out 0 (mul e (sin-osc ar 440 0)))))

The break-point assistant makes a static envelope from a +co-ordinate list. There is a duration and amplitude scalar.

(let* ((d (env-coord (list (cons 0 0)
                           (cons 0.75 1)
                           (cons 1 0))
                     1 1 (replicate 3 "linear")))
       (e (env-gen kr 1 0.1 0 1 remove-synth d)))
  (audition (out 0 (mul e (sin-osc ar 440 0)))))

Trapezoidal

(let* ((d (env-trapezoid 0 0.25 2 0.1))
       (e (env-gen kr 1 0.1 0 1 remove-synth d)))
  (audition (out 0 (mul e (sin-osc ar 440 0)))))

0.0 3 -1 -1 0.1 0.5 1.0 0.0 0.1 0.0 1.0 0.0 0.0 1.5 1.0 0.0

(env-trapezoid 0 0.25 2 0.1)

2.359 (free-self-when-done src)

free the synth when the ’done’ flag of the unit at ‘src’ is set.

(let* ((x (mouse-x kr -1 1 0 0.1))
       (e (linen x 1 0.1 1 remove-synth)))
  (audition (out 0 (mul (sin-osc ar 440 0) e))))
(let* ((x (mouse-x kr -1 1 0 0.1))
       (e (linen x 2 0.1 2 do-nothing)))
  (audition (mrg2 (free-self-when-done e)
                  (out 0 (mul (sin-osc ar 440 0) e)))))

2.360 (pause gate nodeID)

When triggered pauses a node.

gate - when gate is 0, node is paused, when 1 it runs +nodeID - node to be paused

(with-sc3
 (lambda (fd)
   (send-synth fd "a" (out 0 (mul (sin-osc ar 800 0) 0.1)))
   (send-synth fd "b" (letc ((g 1))
                        (Mrg (out 1 (mul (pink-noise ar) 0.05))
                             (pause g 1001))))
   (send fd (/s_new "a" 1001 0 0))
   (send fd (/s_new "b" 1002 0 0))
   (sleep 1)
   (send fd (/n_set 1002 "g" 0))
   (sleep 1)
   (send fd (/n_set 1002 "g" 1))
   (sleep 1)
   (reset fd)))

2.361 (x-line rate start end dur doneAction)

Exponential line generator. Generates an exponential curve from the start value to the end value. Both the start and end values must be non-zero and have the same sign.

start - starting value end - ending value dur - duration in seconds doneAction - a doneAction to be evaluated when the x-line is - completed. See env-gen for details.

(let ((f (x-line kr 200 17000 10 remove-synth))) - (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.362 (done src)

outputs a unit signal if the ’done’ flag of the unit at ‘src’ is -set, else output zero.

(let* ((x (mouse-x kr -1 1 0 0.1)) - (e (linen x 0.1 0.1 0.5 do-nothing)) - (l (mul (sin-osc ar 880 0) 0.1)) - (r (sin-osc ar 440 0))) - (audition (out 0 (mce2 (mul (done e) l) - (mul e r)))))

2.363 (linen gate attackTime susLevel releaseTime doneAction)

A linear envelope generator. The done flag is set when the + completed. See env-gen for details.

(let ((f (x-line kr 200 17000 10 remove-synth)))
  (audition (out 0 (mul (sin-osc ar f 0) 0.1))))

2.362 (done src)

outputs a unit signal if the ’done’ flag of the unit at ‘src’ is +set, else output zero.

(let* ((x (mouse-x kr -1 1 0 0.1))
       (e (linen x 0.1 0.1 0.5 do-nothing))
       (l (mul (sin-osc ar 880 0) 0.1))
       (r (sin-osc ar 440 0)))
  (audition (out 0 (mce2 (mul (done e) l)
                         (mul e r)))))

2.363 (linen gate attackTime susLevel releaseTime doneAction)

A linear envelope generator. The done flag is set when the envelope reaches zero.

Note that the sustain level input is consulted only at the instant -when the gate is opened.

(let ((e (linen (impulse kr 2 0) 0.01 0.1 0.4 do-nothing))) - (audition (out 0 (mul (sin-osc ar 440 0) e))))

(let* ((y (mouse-y kr 0.1 0.5 0 0.1)) - (x (mouse-x kr -1 1 0 0.1)) - (e (linen x 1 y 1.0 do-nothing)) - (o (sin-osc ar 440 0))) - (audition (out 0 (mul o e))))

Open gate for a random interval.

(let* ((r (rand 0.05 0.4)) - (u (letc ((gate 0)) - (let ((e (linen gate 0.1 0.2 0.1 do-nothing))) - (out 0 (mul (sin-osc ar 440 0) e))))) - (g (encode-graphdef (synthdef "linen" u)))) - (with-sc3 - (lambda (fd) - (async fd (d-recv g)) - (send fd (s-new0 "linen" 1001 1 1)) - (send fd (bundle (utc) (n-set1 1001 "gate" 1))) - (send fd (bundle (+ (utc) r) - (n-set1 1001 "gate" 0))) - (sleep (* r 4)) - (send fd (n-free1 1001)))))

2.364 (free-self src)

free enclosing synth when the input signal ‘src’ crosses from -non-positive to positive.

(audition - (mrg2 (free-self (mouse-x kr -1 1 0 0.1)) - (out 0 (mul (sin-osc ar 440 0) 0.1))))

 
\ No newline at end of file +when the gate is opened.

(let ((e (linen (impulse kr 2 0) 0.01 0.1 0.4 do-nothing)))
  (audition (out 0 (mul (sin-osc ar 440 0) e))))
(let* ((y (mouse-y kr 0.1 0.5 0 0.1))
       (x (mouse-x kr -1 1 0 0.1))
       (e (linen x 1 y 1.0 do-nothing))
       (o (sin-osc ar 440 0)))
  (audition (out 0 (mul o e))))

Open gate for a random interval.

(let* ((r (rand 0.05 0.4))
       (u (letc ((gate 0))
            (let ((e (linen gate 0.1 0.2 0.1 do-nothing)))
              (out 0 (mul (sin-osc ar 440 0) e)))))
       (g (encode-graphdef (synthdef "linen" u))))
  (with-sc3
   (lambda (fd)
     (async fd (d-recv g))
     (send fd (s-new0 "linen" 1001 1 1))
     (send fd (bundle (utc) (n-set1 1001 "gate" 1)))
     (send fd (bundle (+ (utc) r)
                    (n-set1 1001 "gate" 0)))
     (sleep (* r 4))
     (send fd (n-free1 1001)))))

2.364 (free-self src)

free enclosing synth when the input signal ‘src’ crosses from +non-positive to positive.

(audition
 (mrg2 (free-self (mouse-x kr -1 1 0 0.1))
       (out 0 (mul (sin-osc ar 440 0) 0.1))))
 
\ No newline at end of file diff --git a/util/README.org b/util/README.org new file mode 100644 index 0000000..e9f54f3 --- /dev/null +++ b/util/README.org @@ -0,0 +1,32 @@ +# -*- mode: org; coding: utf-8; -*- +#+title: rsc3 related utilities + +* schelp2scrbl + +(sc3) → schelp → racket (scribble) + +This is a quikc & dirty parser to convert .schelp files to scribble with the renaming seen in rsc3 (as closely as possible) and should be usable as part of the racket documentation system which uses the [[https://docs.racket-lang.org/scribble/index.html][scribble format]]. partially complete. partially automated. + +#+BEGIN_SRC shell +racket schelp2scrbl.rkt -v ../doc-schelp/HelpSource/Classes/LFSaw.schelp +#+END_SRC + +further options… +#+BEGIN_SRC shell + ./scm2scrbl.rkt -h +#+END_SRC + +* scm2scrbl + +(schelp → scm ) → racket (scribble) + +This is a qucik & dirty parser to convert .help.scm files as seen in rsc3 to something usable as part of the racket documentation system which uses the [[https://docs.racket-lang.org/scribble/index.html][scribble format]]. partially complete. partially automated. + +#+BEGIN_SRC shell +racket scm2scrbl.rkt ..doc/help/server-command/n-map.help.scm +#+END_SRC + +further options… +#+BEGIN_SRC shell + ./scm2scrbl.rkt -h +#+END_SRC diff --git a/util/scm2scrbl.rkt b/util/scm2scrbl.rkt index f3bbf80..f686d2f 100755 --- a/util/scm2scrbl.rkt +++ b/util/scm2scrbl.rkt @@ -72,26 +72,43 @@ ;; title as first comment line (define $title - (parser-compose - (manyTill (char #\;) $space) ;; assume a space separation - (x <- (many1 (and $anyChar (noneOf ";")))) - (return (format-title x)))) - -;; text as any scheme comment line -(define $text - (parser-compose - (manyTill (char #\;) $space) ;; assume a space separation - (x <- (many1 (and $anyChar (noneOf ";")))) - (return (format-text x)))) + ( (parser-compose + (manyTill (char #\;) $space) ;; assume a space separation + (x <- (manyTill $anyChar $eol)) + (return (format-title x))) + "title")) ;; s-expressions (not strictly, but...) (define $sexp - (parser-seq - (char #\() (many1 ( (noneOf "()") $eol $sexp)) (char #\)))) + ( (parser-seq + (char #\() (many ( $sexp (and $anyChar (noneOf "()")))) (char #\))) + "sexp")) + +;; text as any scheme comment line +(define $text-terminator ( $eol "text terminator")) + +(define $text-line + ( (parser-compose + (parser-seq (many1 (char #\;)) $space) ;; assume a space separation of comments + (x <- (manyUntil $anyChar $text-terminator)) + (return (format-text x))) + "text")) + +;; block comment +(define $text-block + ( (parser-compose + (string "#|") + (x <- (many (and $anyChar ( (try (char #\|)))))) + (string "|#") + (return (format-text x))) + "text")) + +;; blank line +(define $blank ( ( $newline $space $eol) "blank line")) ;; code block formatting (define $code - (parser-seq $sexp #:combine-with format-racketblock)) + ( (parser-seq $sexp #:combine-with format-racketblock) "code")) ;; a help file usually starts with a one line function followed by a new line ;; then either text blocks (as comments) and/or example code. @@ -99,7 +116,7 @@ (define $help-file (parser-seq $title - (many ( $code $text $eol)) + (many ( $code $text-line $text-block $blank)) $eof)) ;; parser -> string -> string @@ -115,17 +132,19 @@ (define scribble-postamble "") ;; wrap codeblock -(define format-racketblock - (lambda (a . z) - (format "~n@racketblock[~n~a~n]" (format-result (cons a z))))) +(define (format-racketblock a . z) + (verbose "format racket block: ~a~n" (cons a z)) + (format "~n@racketblock[~n~a~n]" (format-result (cons a z)))) ;; wrap title (define (format-title s) + (verbose "format title: ~a~n" s) (format "~n@title{~a}~n~n" (string-trim (list->string s)))) ;; generic text (define (format-text s) - (format "~a" (list->string s))) + (verbose "format text: ~a~n" s) + (format "~a~n" (list->string s))) (define (format-result l) (verbose "formatting result: ~s~n" l) @@ -139,10 +158,10 @@ ;; parse a .help.scm file into formatted string (define (parse-help-file f) - (let* ((path (build-path help-path f)) + (let* ((path (build-path (help-path) f)) (body (port->string (open-input-file path)))) - (printf "parsing file: ~a~n" path) + (verbose "parsing file: ~a~n" path) (format-result (parse-result $help-file body)))) @@ -151,8 +170,8 @@ (define (read-write-scribble f) (let ((body (parse-help-file f)) (path (string-replace - (string-append help-path f) ".scm" ".scrbl"))) - (printf "writing file: ~a~n" path) + (string-append (help-path) f) ".scm" ".scrbl"))) + (verbose "writing file: ~a~n" path) (with-output-to-file #:exists 'replace path @@ -161,6 +180,109 @@ (printf "~a~n" body) (printf "~a~n" scribble-postamble))))) +;; testing +(define sc0 ";; (demand-env-gen rate levels times shapes curves gate reset levelScale levelOffset timeScale doneAction) + +;; levels - a demand ugen or any other ugen + +;; times - a demand ugen or any other ugen if one of these ends, +;; the doneAction is evaluated + +;; shapes - a demand ugen or any other ugen, the number given is +;; the shape number according to Env + +;; curves - a demand ugen or any other ugen, if shape is 5, this +;; is the curve factor some curves/shapes don't work if +;; the duration is too short. have to see how to improve +;; this. also some depend on the levels obviously, like +;; exponential cannot cross zero. + +;; gate - if gate is x >= 1, the ugen runs, if gate is 0 > x > 1, +;; the ugen is released at the next level (doneAction), if +;; gate is x < 0, the ugen is sampled end held + +;; reset - if reset crosses from nonpositive to positive, the ugen +;; is reset at the next level, if it is > 1, it is reset +;; immediately. + +;; Frequency envelope with random times. + +(let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200)))) + (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0)))) + (y (mouse-y kr 0.01 3 1 0.1)) + (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing))) + (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.01)) 0) 0.1)))) + +;; Frequency modulation + +(let* ((x (mouse-x kr -0.01 -4 0 0.1)) + (y (mouse-y kr 1 3000 1 0.1)) + (l (lambda () (dseq dinf (clone 32 (exp-rand 200 1000))))) + (t (mul sample-dur y)) + (f (demand-env-gen ar (mce2 (l) (l)) t 5 x 1 1 1 0 1 do-nothing))) + (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) + +;; gate. Mouse x on right side of screen toggles gate. + +(let* ((x (mouse-x kr 0 1 0 0.1)) + (l (u:round (dwhite dinf 300 1000) 100)) + (f (demand-env-gen kr l 0.1 5 0.3 (gt x 0.5) 1 1 0 1 do-nothing))) + (audition (out 0 (mul (sin-osc ar (mul f (mce2 1 1.21)) 0) 0.1)))) +") + +(define ss0 "(let* ((x (mouse-x kr -0.01 -4 0 0.1)) + (y (mouse-y kr 1 3000 1 0.1)) + (l (lambda () (dseq dinf (clone 32 (exp-rand 200 1000))))) + (t (mul sample-dur y)) + (f (demand-env-gen ar (mce2 (l) (l)) t 5 x 1 1 1 0 1 do-nothing))) + (audition (out 0 (mul (sin-osc ar f 0) 0.1)))) +") + +(define bc0 ";; (pv-jensen-andersen buffer propsc prophfe prophfc propsf threshold waittime) + +#| + +fft feature detector for onset detection based on work described in +Jensen,K. & Andersen, T. H. (2003). Real-time Beat Estimation Using +Feature Extraction. in Proceedings of the Computer Music Modeling and +Retrieval Symposium, Lecture Notes in Computer Science. springer +Verlag. + +First order derivatives of the features are taken. Threshold may +need to be set low to pick up on changes. + +buffer - fft buffer to read from. +propsc - Proportion of spectral centroid feature. +prophfe - Proportion of high frequency energy feature. +prophfc - Proportion of high frequency content feature. +propsf - Proportion of spectral flux feature. +threshold - Threshold level for allowing a detection +waittime - If triggered, minimum wait until a further frame can + cause another spot (useful to stop multiple detects on + heavy signals) + +Default values in sclang are: propsc=0.25, prophfe=0.25, +prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04. + +|# + +(with-sc3 + (lambda (fd) + (async fd (b-alloc 0 2048 1)))) + +(let* ((source (sound-in 0)) + (detect (pv-jensen-andersen (fft* 0 source) + 0.25 0.25 0.25 0.25 + (mouse-x kr 0.01 1.0 1 0.1) + 0.04))) + (audition + (out 0 (mul (sin-osc ar (mce2 440 445) 0) + (decay (mul 0.1 detect) 0.1))))) +") + +;(format-result (parse-result $code ss0)) + +;(format-result (parse-result $help-file sc0)) ;; cli edition (read-write-scribble (filename))