| 1 |
<CsoundSynthesizer> |
| 2 |
|
| 3 |
<CsInstruments> |
| 4 |
ksmps = 32 |
| 5 |
0dbfs = 1.0 |
| 6 |
nchnls = 2 |
| 7 |
|
| 8 |
instr 1 |
| 9 |
;; rhythm array - these values are multiplied by tempo (ticks) in BPM |
| 10 |
irhythm0[] fillarray 1, 1.5, 0.5, 0.5, 0.5, 0.5, 1.5, 1 |
| 11 |
;; instrument array - instrument number to render for each step |
| 12 |
iinsts0[] fillarray 11, 12, 13, 14, 15, 16, 17, 18 |
| 13 |
;; note array - here cpsmidinn(p4), amps(p5), mod ratios(p6), mod indices(p7) |
| 14 |
;; - esentially the 'p4', 'p5', 'p6' and 'p7' are output from sequ |
| 15 |
inotes[][] init 4,8 ;initialize 4 rows with 8 columns - p4=pitch, p5=amp, p6=modratio, p7=modindex |
| 16 |
inotes fillarray 60, 61, 62, 63, 64, 65, 66, 67, \ |
| 17 |
0.8, 0.3, 0.6, 0.2, 0.7, 0.4, 0.5, 0.6, \ |
| 18 |
1, 2, 3, 4, 5, 6, 7, 8, \ |
| 19 |
1, 11, 2, 12, 3, 21, 4, 22 |
| 20 |
;; NOTE: this can be any sequence of values |
| 21 |
;; variable tempo |
| 22 |
kspeed linseg 85, p3*.7, 85, p3*.3, 240 |
| 23 |
;; rhythms, insts, notes, bpm, length, mode, step, reset, verbose |
| 24 |
kSeq sequ irhythm0, iinsts0, inotes, kspeed, 8, p4 |
| 25 |
endin |
| 26 |
|
| 27 |
instr 11, 12, 13, 14, 15, 16, 17, 18 |
| 28 |
kenv linseg 0, p3*0.01, 1, p3*.99, 0 |
| 29 |
asig foscil p5, cpsmidinn(p4), 1, p6, p7 |
| 30 |
outall asig * kenv |
| 31 |
endin |
| 32 |
|
| 33 |
</CsInstruments> |
| 34 |
|
| 35 |
<CsScore> |
| 36 |
i1 0 15 0 ;; forward mode |
| 37 |
s |
| 38 |
f0 1 |
| 39 |
s |
| 40 |
i1 0 15 -1 ;; backward mode |
| 41 |
s |
| 42 |
f0 1 |
| 43 |
s |
| 44 |
i1 0 15 -2 ;; forward and backward mode |
| 45 |
s |
| 46 |
f0 1 |
| 47 |
s |
| 48 |
i1 0 15 -3 ;; random |
| 49 |
s |
| 50 |
f0 1 |
| 51 |
s |
| 52 |
i1 0 6 -4 ;; play forward once and stop |
| 53 |
s |
| 54 |
f0 1 |
| 55 |
s |
| 56 |
i1 0 6 -5 ;; play backward once and stop |
| 57 |
s |
| 58 |
f0 1 |
| 59 |
s |
| 60 |
i1 0 15 -6 ;; shuffle mode |
| 61 |
s |
| 62 |
f0 1 |
| 63 |
s |
| 64 |
i1 0 30 1 ;; mutate after each step |
| 65 |
s |
| 66 |
f0 1 |
| 67 |
s |
| 68 |
i1 0 30 2 ;; mutate each second step |
| 69 |
s |
| 70 |
f0 1 |
| 71 |
s |
| 72 |
i1 0 30 4 ;; mutate every four steps |
| 73 |
e |
| 74 |
</CsScore> |
| 75 |
</CsoundSynthesizer> |
| 76 |
|
| 77 |
|