Debian Codegraph @

src/Examples/FLOSS Manual Examples/01 Basics/01D07_markov_basics.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -ndm0
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 0dbfs = 1
9 nchnls = 1
10 seed 0
11
12 instr 1
13 iLine[] array .2, .5, .3
14 iVal random 0, 1
15 iAccum = iLine[0]
16 iIndex = 0
17 until iAccum >= iVal do
18 iIndex += 1
19 iAccum += iLine[iIndex]
20 enduntil
21 printf_i "Random number = %.3f, next element = %c!\n", 1, iVal, iIndex+97
22 endin
23 </CsInstruments>
24 <CsScore>
25 r 10
26 i 1 0 0
27 </CsScore>
28 </CsoundSynthesizer>
29 ;example by joachim heintz