crossfm — Two mutually frequency and/or phase modulated oscillators.
a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]
ifn1 -- function table number for oscillator #1. Requires a wrap-around guard point.
ifn2 -- function table number for oscillator #2. Requires a wrap-around guard point.
iphs1 (optional, default=0) -- initial phase of waveform in table ifn1, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped.
iphs2 (optional, default=0) -- initial phase of waveform in table ifn2, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped.
xfrq1 -- a factor that, when multipled by the kcps parameter, gives the frequency of oscillator #1.
xfrq2 -- a factor that, when multipled by the kcps parameter, gives the frequency of oscillator #2.
xndx1 -- the index of the modulation of oscillator #2 by oscillator #1.
xndx2 -- the index of the modulation of oscillator #1 by oscillator #2.
kcps -- a common denominator, in cycles per second, for both oscillators frequencies.
crossfm implements a crossed frequency modulation algorithm. The audio-rate output of oscillator #1 is used to modulate the frequency input of oscillator #2 while the audio-rate output of oscillator #2 is used to modulate the frequency input of oscillator #1. This double feedback structure produces a rich set of sounds with some chaotic behaviour. crossfmi behaves like crossfm except that linear interpolation is used for table lookup.
crosspm and crosspmi implement cross phase modulation between two oscillators.
crossfmpm and crossfmpmi implement cross frequency/phase modulation between two oscillators. Oscillator #1 is frequency-modulated by oscillator #2 while oscillator #2 is phase-modulated by oscillator #1.
You can read my paper in the Csound Journal for more information.
Warning | |
---|---|
Those opcodes may produce very rich spectra, especially with high modulation indexes, and in some cases foldover aliases may occur if the sampling rate is not high enough. Moreover the audio output may vary in function of the sampling rate, due to the non-linearity of the algorithm. In Csound, two other opcodes have this characteristic: planet and chuap. |
Here is an example of the crossfm opcode. It uses the file crossfm.csd.
Example 173. Example of the crossfm opcode.
<CsoundSynthesizer> <CsOptions> -d -o dac </CsOptions> <CsInstruments> sr = 96000 ksmps = 10 nchnls = 2 0dbfs = 1 FLpanel "crossfmForm", 600, 400, 0, 0 gkfrq1, ihfrq1 FLcount "Freq #1", 0, 20000, 0.001, 1, 1, 200, 30, 20, 50, -1 gkfrq2, ihfrq2 FLcount "Freq #2", 0, 20000, 0.001, 1, 1, 200, 30, 20, 130, -1 gkndx1, gkndx2, ihndx1, ihndx2 FLjoy "Indexes", 0, 10, 0, 10, 0, 0, -1, -1, 200, 200, 300, 50 FLsetVal_i 164.5, ihfrq1 FLsetVal_i 263.712, ihfrq2 FLsetVal_i 1.5, ihndx1 FLsetVal_i 3, ihndx2 FLpanelEnd FLrun maxalloc 1, 2 instr 1 kamp linen 0.5, 0.01, p3, 0.5 a1,a2 crossfm gkfrq1, gkfrq2, gkndx1, gkndx2, 1, 1, 1 outs a1*kamp, a2*kamp endin </CsInstruments> <CsScore> f1 0 16384 10 1 0 i1 0 60 e </CsScore> </CsoundSynthesizer>
In this example, an FLTK GUI is used to control in real-time the oscillators frequency with two Flcount widgets and the cross modulation indexes with one FLjoy widget. It uses a sampling rate of 96000Hz.
More information on this opcode: http://www.csoundjournal.com/issue12/crossfm.html , written by François Pinot