semvec/pypi-packages huggingface dataset:
PyCsound 1.1.0
Working with Csound in Python...
Keywords: csound,sound,sound synthesis,python

## PyCsound  

A package to run Csound from python.

```console

pip install pycsound

````

```python

from pycsound import PyCsound
import random

cs = PyCsound()
cs.option = "-o dac"
cs.header = {"sr": 44100, "kr": 44100, "nchnls": 2, "0dbfs": 1}

cs.orc = """

instr 1
a1 = poscil(p4 * expseg:k(.001, .01, 1, p3 - .01, .001), p5)
outs(a1, a1)
endin

"""

atk, dur = 0, 0
for i in range(10):
    atk += random.uniform(0, 3)
    dur = random.uniform(0, 5)
    score = cs.add_score_statement(statement="i", params=[1, atk, dur, 0.5, 110 * (i + 1)])

cs.add_to_score(statement="f", params=[1, 0, 4096, 10, 1])
cs.add_to_score(statement="t", params=[0, 240])

cs.compile()
cs.run()

```

It is also possible to run csound file: .orc, .sco

```python

cs.orc = "path_to_file.orc"
cs.sco = "path_to_file.sco"

```

or

```python

cs.run("path_to_file.orc", "path_to_file.sco")

```

or


```python

cs.run("path_to_file.csd")

```

For save generated file:

```python

cs.save_csound_file(mode="csd", name="file_generated.csd", path="path_to_save_the_file_generated")

```
cipetpet 0.0.0.0.2
cipetpet cicikus
Keywords: python,cipetpet,cici kus cici kus


            cibili cibili cibili şak şak şak şak şak
            cibili? cibili cibili şak şak şak şak şak
            hadi yavrum bi daha vur
            şak şak şak şak şak
            bunlar lezzetli. bi de şimdi;
            ciriling ciriling prrrr ciyak ciyak ciyak ciyak
            bijining bijining aniyeeaaaa zrrrrrr
            bunlar kuş değil, ötüyo, amatörü eğlendirir.