;; process that sends csound data define process ransco(len, rhy, lb, ub, amp) run with dur = rhy * 2 repeat len for t = elapsed(#t) ; get true score time for k = lb then between(lb,ub) send "cs:i", 1, t , dur, k, amp wait rhy end ;; write a scorfile sprout ransco(10, .2, 60, 72, 1000), "~/test.sco" ;; options for csound scorefiles are: ;; play: if #t call csound after writing file ;; header: header string for scorefile ;; orchestra: path to .orc file ;; write: if #t write the scorefile (default #t) ;; these options are all 'sticky' and except for write: are saved in ;; your preferences file. ;; this next command will call csound after generating the ;; file. Before executing it copy the simp.orc code below into your ;; home directory and use Audio>Csound>Settings... to assign your ;; Csound app. sprout ransco(10, .2, 60, 72, 1000), "~/test.sco", play: #t, orchestra: "~/simp.orc" ;; this will generate a score without writing a file. execute it ;; several times and use the Audio>Csound>Export... item to export all ;; the score data in various formats sprout ransco(10, .2, 60, 72, 1000), "~/test.sco", write: #f ;------------------------------- simp.orc ------------------------------- sr = 44100 ksmps = 10 nchnls = 2 instr 1 ; simple WAVEGUIDE kcps = cpsmidinn(p4) ;convert from midi note number to cycles per second icps = cpsmidinn(p4) a1 pluck p5, kcps, icps, 0, 1 outs a1, a1 endin instr 2 kcps = cpsmidinn(p4) ;convert from midi note number to cycles per second kenv adsr .1, .1, .7, .2 aout oscil kenv*p5, kcps, 1 outs aout, aout endin