| User-Defined Opcode Database |
|---|
frequency calculation for one step of an equal tempered scale
Download UDO Filefrequency calculation for one step of an equal tempered scale. the unit for the scale can be an octave, a duodecim, or whatever
ifreq FreqByEqScale iref_freq, iumult, istepspu, istep
iref_freq: reference frequency
iumult: unit multiplier (2 = octave, 3 = Bohlen-Pierce scale, 5 = stockhausen scale in Studie2)
istepspu: steps per unit (12 for semitones, 13 for complete Bohlen-Pierce scale, 25 for studie2 scale)
istep: selected step (0 = reference frequency, 1 = one step higher, -1 = one step lower)
opcode FreqByEqScale, i, iiii iref_freq, iumult, istepspu, istep xin ifreq = iref_freq * (iumult ^ (istep / istepspu)) xout ifreq endop
<CsoundSynthesizer> <CsOptions> -n </CsOptions> <CsInstruments> opcode FreqByEqScale, i, iiii iref_freq, iumult, istepspu, istep xin ifreq = iref_freq * (iumult ^ (istep / istepspu)) xout ifreq endop instr 1 ifreq FreqByEqScale 440, 2, 12, p4 print ifreq endin </CsInstruments> <CsScore> i 1 0 0 0 i . . . 1 i . . . -1 e </CsScore> </CsoundSynthesizer>
joachim heintz 1/2010
| Previous | Home | Next |
| FreqByCentTab | FreqByRatioTab |