src/Examples/FLOSS Manual Examples/12 Csound and other Languages/12B05_pyassigni.csd
raw| 1 | <CsoundSynthesizer> |
| 2 | <CsOptions> |
| 3 | -ndm0 |
| 4 | </CsOptions> |
| 5 | <CsInstruments> |
| 6 | |
| 7 | pyinit |
| 8 | |
| 9 | instr 1 ;assign 3/2 to the python variable "x" |
| 10 | pyassigni "x", 3/2 |
| 11 | endin |
| 12 | |
| 13 | instr 2 ;calculate cent distance of this proportion |
| 14 | pyruni {{ |
| 15 | from math import log |
| 16 | cent = log(x,2)*1200 |
| 17 | print cent |
| 18 | }} |
| 19 | endin |
| 20 | |
| 21 | </CsInstruments> |
| 22 | <CsScore> |
| 23 | i 1 0 0 |
| 24 | i 2 0 0 |
| 25 | </CsScore> |
| 26 | </CsoundSynthesizer> |
| 27 | ;example by joachim heintz |