File: pycall1.orc

package info (click to toggle)
csound-plugins 1.0.2~dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,960 kB
  • sloc: cpp: 16,586; ansic: 7,522; python: 458; sh: 94; makefile: 25
file content (31 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
sr=44100
kr=4410
ksmps=10
nchnls=1

giSinusoid      ftgen   0,      0, 8192, 10,    1

pyinit

pyruni {{
import random

pool = [(1 + i/10.0) ** 1.2 for i in range(100)]

def get_number_from_pool(n, p):
    if random.random() < p:
        i = int(random.random() * len(pool))
        pool[i] = n

    return random.choice(pool)
}}

instr 1

        k1      oscil   1, 3, giSinusoid

        k2      pycall1 "get_number_from_pool", k1 + 2, p4

                printk  0.01, k2

endin