Safe Haskell | None |
---|
Data
- table :: Sig -> Tab -> Sig
- tablei :: Sig -> Tab -> Sig
- table3 :: Sig -> Tab -> Sig
- tableD :: D -> Tab -> D
- tableiD :: D -> Tab -> D
- table3D :: D -> Tab -> D
- tab_i :: D -> Tab -> D
- tab :: Sig -> Tab -> Sig
- inch :: CsdTuple a => [Sig] -> a
- outch :: [(Sig, Sig)] -> SE ()
- flooper2 :: Sig -> Sig -> Sig -> Sig -> Sig -> Tab -> Sig
- sndloop :: Sig -> Sig -> Sig -> D -> D -> (Sig, Sig)
- soundin :: CsdTuple a => Str -> a
- diskin2 :: CsdTuple a => Str -> Cps -> a
- mp3in :: Str -> (Sig, Sig)
- filelen :: Str -> D
- filesr :: Str -> D
- filenchnls :: Str -> D
- filepeak :: Str -> D
- filebit :: Str -> D
- fout :: [Sig] -> SE ()
- class Val a => Nums a
- downsamp :: Sig -> Sig
- upsamp :: Sig -> Sig
- interp :: Sig -> Sig
- ampdb :: Nums a => a -> a
- ampdbfs :: Nums a => a -> a
- dbamp :: Nums a => a -> a
- dbfsamp :: Nums a => a -> a
- cent :: Nums a => a -> a
- cpsmidinn :: Nums a => a -> a
- cpsoct :: Nums a => a -> a
- cpspch :: Nums a => a -> a
- octave :: Nums a => a -> a
- octcps :: Nums a => a -> a
- octmidinn :: Nums a => a -> a
- octpch :: Nums a => a -> a
- pchmidinn :: Nums a => a -> a
- pchoct :: Nums a => a -> a
- semitone :: Nums a => a -> a
- fracD :: D -> D
- floorD :: D -> D
- ceilD :: D -> D
- intD :: D -> D
- roundD :: D -> D
- fracSig :: Sig -> Sig
- floorSig :: Sig -> Sig
- ceilSig :: Sig -> Sig
- intSig :: Sig -> Sig
- roundSig :: Sig -> Sig
- printi :: [D] -> SE ()
- printk :: D -> Sig -> SE ()
- sprintf :: Str -> [D] -> Str
- sprintfk :: Str -> [Sig] -> Str
- strcat :: Str -> Str -> Str
- strcatk :: Str -> Str -> Str
Buffer and Function tables
Reading From Tables
table :: Sig -> Tab -> SigSource
Accesses table values by direct indexing.
ares table andx, ifn [, ixmode] [, ixoff] [, iwrap] ires table indx, ifn [, ixmode] [, ixoff] [, iwrap] kres table kndx, ifn [, ixmode] [, ixoff] [, iwrap]
tablei :: Sig -> Tab -> SigSource
Accesses table values by direct indexing with linear interpolation.
ares tablei andx, ifn [, ixmode] [, ixoff] [, iwrap] ires tablei indx, ifn [, ixmode] [, ixoff] [, iwrap] kres tablei kndx, ifn [, ixmode] [, ixoff] [, iwrap]
table3 :: Sig -> Tab -> SigSource
Accesses table values by direct indexing with cubic interpolation.
ares table3 andx, ifn [, ixmode] [, ixoff] [, iwrap] ires table3 indx, ifn [, ixmode] [, ixoff] [, iwrap] kres table3 kndx, ifn [, ixmode] [, ixoff] [, iwrap]
Accesses table values by direct indexing.
ires table indx, ifn [, ixmode] [, ixoff] [, iwrap]
tableiD :: D -> Tab -> DSource
Accesses table values by direct indexing with linear interpolation.
ires tablei indx, ifn [, ixmode] [, ixoff] [, iwrap]
table3D :: D -> Tab -> DSource
Accesses table values by direct indexing with cubic interpolation.
ires table3 indx, ifn [, ixmode] [, ixoff] [, iwrap]
Fast table opcodes. Faster than table and tablew because don't allow wrap-around and limit and don't check index validity. Have been implemented in order to provide fast access to arrays. Support non-power of two tables (can be generated by any GEN function by giving a negative length value).
ir tab_i indx, ifn[, ixmode]
tab :: Sig -> Tab -> SigSource
Fast table opcodes. Faster than table and tablew because don't allow wrap-around and limit and don't check index validity. Have been implemented in order to provide fast access to arrays. Support non-power of two tables (can be generated by any GEN function by giving a negative length value).
kr tab kndx, ifn[, ixmode] ar tab xndx, ifn[, ixmode]
Signal Input and Output, Sample and Loop Playback, Soundfonts
Signal Input And Output
inch :: CsdTuple a => [Sig] -> aSource
Reads from numbered channels in an external audio signal or stream.
ain1[, ...] inch kchan1[,...]
outch :: [(Sig, Sig)] -> SE ()Source
Writes multi-channel audio data, with user-controllable channels, to an external device or stream.
outch kchan1, asig1 [, kchan2] [, asig2] [...]
Sample Playback With Optional Looping
flooper2 :: Sig -> Sig -> Sig -> Sig -> Sig -> Tab -> SigSource
This opcode implements a crossfading looper with variable loop parameters and three looping modes, optionally using a table for its crossfade shape. It accepts non-power-of-two tables for its source sounds, such as deferred-allocation GEN01 tables.
asig flooper2 kamp, kpitch, kloopstart, kloopend, kcrossfade, ifn \ [, istart, imode, ifenv, iskip]
sndloop :: Sig -> Sig -> Sig -> D -> D -> (Sig, Sig)Source
This opcode records input audio and plays it back in a loop with user-defined duration and crossfade time. It also allows the pitch of the loop to be controlled, including reversed playback.
asig, krec sndloop ain, kpitch, ktrig, idur, ifad
File Input and Output
Sound File Input
soundin :: CsdTuple a => Str -> aSource
Reads audio data from an external device or stream. Up to 24 channels may be read before v5.14, extended to 40 in later versions.
ar1[, ar2[, ar3[, ... a24]]] soundin ifilcod [, iskptim] [, iformat] \ [, iskipinit] [, ibufsize]
diskin2 :: CsdTuple a => Str -> Cps -> aSource
Reads audio data from a file, and can alter its pitch using one of several available interpolation types, as well as convert the sample rate to match the orchestra sr setting. diskin2 can also read multichannel files with any number of channels in the range 1 to 24 in versions before 5.14, and 40 after. . diskin2 allows more control and higher sound quality than diskin, but there is also the disadvantage of higher CPU usage.
a1[, a2[, ... aN]] diskin2 ifilcod, kpitch[, iskiptim \ [, iwrap[, iformat [, iwsize[, ibufsize[, iskipinit]]]]]]
mp3in :: Str -> (Sig, Sig)Source
Reads stereo audio data from an external MP3 file.
ar1, ar2 mp3in ifilcod[, iskptim, iformat, iskipinit, ibufsize]
Sound File Queries
Returns the length of a sound file.
ir filelen ifilcod, [iallowraw]
Returns the sample rate of a sound file.
ir filesr ifilcod [, iallowraw]
filenchnls :: Str -> DSource
Returns the number of channels in a sound file.
ir filenchnls ifilcod [, iallowraw]
Returns the peak absolute value of a sound file.
ir filepeak ifilcod [, ichnl]
Returns the number of bits in each sample in a sound file.
ir filebit ifilcod [, iallowraw]
Sound File Output
fout outputs N a-rate signals to a specified file of N channels.
fout ifilename, iformat, aout1 [, aout2, aout3,...,aoutN]
Non-Soundfile Input And Output
Converters of Data Types
Rate conversions
Modify a signal by down-sampling.
kres downsamp asig [, iwlen]
Modify a signal by up-sampling.
ares upsamp ksig
Converts a control signal to an audio signal using linear interpolation.
ares interp ksig [, iskip] [, imode]
Amplitude conversions
ampdb :: Nums a => a -> aSource
Returns the amplitude equivalent of the decibel value x. Thus:
- 60 dB = 1000
- 66 dB = 1995.262
- 72 dB = 3891.07
- 78 dB = 7943.279
- 84 dB = 15848.926
- 90 dB = 31622.764
ampdb(x) (no rate restriction)
ampdbfs :: Nums a => a -> aSource
Returns the amplitude equivalent of the full scale decibel (dB FS) value x. The logarithmic full scale decibel values will be converted to linear 16-bit signed integer values from −32,768 to +32,767.
ampdbfs(x) (no rate restriction)
dbamp :: Nums a => a -> aSource
Returns the decibel equivalent of the raw amplitude x.
dbamp(x) (init-rate or control-rate args only)
dbfsamp :: Nums a => a -> aSource
Returns the decibel equivalent of the raw amplitude x, relative to full scale amplitude. Full scale is assumed to be 16 bit. New is Csound version 4.10.
dbfsamp(x) (init-rate or control-rate args only)
Pitch conversions
cent :: Nums a => a -> aSource
Calculates a factor to raise/lower a frequency by a given amount of cents.
cent(x) (no rate restriction)
cpsmidinn :: Nums a => a -> aSource
Converts a Midi note number value to cycles-per-second.
cpsmidinn (MidiNoteNumber) (init- or control-rate args only)
cpsoct :: Nums a => a -> aSource
Converts an octave-point-decimal value to cycles-per-second.
cpsoct(oct) (no rate restriction)
cpspch :: Nums a => a -> aSource
Converts a pitch-class value to cycles-per-second.
cpspch (pch) (init- or control-rate args only)
octave :: Nums a => a -> aSource
Calculates a factor to raise/lower a frequency by a given amount of octaves.
octave(x) (no rate restriction)
octcps :: Nums a => a -> aSource
Converts a cycles-per-second value to octave-point-decimal.
octcps (cps) (init- or control-rate args only)
octmidinn :: Nums a => a -> aSource
Converts a Midi note number value to octave-point-decimal.
octmidinn (MidiNoteNumber) (init- or control-rate args only)
octpch :: Nums a => a -> aSource
Converts a pitch-class value to octave-point-decimal.
octpch (pch) (init- or control-rate args only)
pchmidinn :: Nums a => a -> aSource
Converts a Midi note number value to octave point pitch-class units.
pchmidinn (MidiNoteNumber) (init- or control-rate args only)
pchoct :: Nums a => a -> aSource
Converts an octave-point-decimal value to pitch-class.
pchoct (oct) (init- or control-rate args only)
semitone :: Nums a => a -> aSource
Calculates a factor to raise/lower a frequency by a given amount of semitones.
semitone(x) (no rate restriction)
Integer and fractional parts
Printing and Strings
Simple Printing
These units will print orchestra init-values.
print iarg [, iarg1] [, iarg2] [...]
printk :: D -> Sig -> SE ()Source
Prints one k-rate value at specified intervals.
printk itime, kval [, ispace]
Formatted Printing
String Variables
sprintf :: Str -> [D] -> StrSource
sprintf write printf-style formatted output to a string variable, similarly to the C function sprintf(). sprintf runs at i-time only.
Sdst sprintf Sfmt, xarg1[, xarg2[, ... ]]
sprintfk :: Str -> [Sig] -> StrSource
sprintfk writes printf-style formatted output to a string variable, similarly to the C function sprintf(). sprintfk runs both at initialization and performance time.
Sdst sprintfk Sfmt, xarg1[, xarg2[, ... ]]
String Manipulation And Conversion
strcat :: Str -> Str -> StrSource
Concatenate two strings and store the result in a variable. strcat runs at i-time only. It is allowed for any of the input arguments to be the same as the output variable.
Sdst strcat Ssrc1, Ssrc2