Csound Csound-dev Csound-tekno Search About

[Csnd] Some CSOUND stuff

Date1999-11-08 01:32
Fromsherlock_abc
Subject[Csnd] Some CSOUND stuff
SoI cheated and used BASIC to generate my Csound score file.
I use Csound to generate patches for Timidity.
the following will work in BASIC.

--------------------------------------------------------------------------------------

10 TIMER ON: RANDOMIZE TIMER
20 DIM FREQ(100), VOLUME(100), DUR(100)
30 start = INT(RND(1) * 1000) + 1000: REM ORC DOES not use first 37 notes so add 38 to make up
40 volstart = INT(RND(1) * 10000) + 5000
51 i = .25
50 FOR j = 1 TO 10
60 X = X + i
70 M = COS(X) * 3.141592 / 180
80 Y = SIN(X) * 3.141592 / 180
90 FREQ(j) = start + 500 * M: DUR(j) = j: VOLUME(j) = volstart + 20000 * Y
100 NEXT
110 OPEN "test.sco" FOR OUTPUT AS 1
120 PRINT #1, "; Test.sco (C) 1999 Robert McNulty Junior"
130 PRINT #1, "f1   0    4096 10 1      ; sine wave"
140 PRINT #1, ""
150 PRINT #1, "t0 120"
160 PRINT #1, ""
170 PRINT #1, ";p1", "p2", "p3,", "p4", "p5", "p6", "p7"
180 PRINT
200 FOR M = 1 TO 3: j = 8
210 PRINT #1, "i"; M, 0, DUR(j), VOLUME(j), FREQ(j), RND(.99999), RND(.99999); ""

220 NEXT M
230 CLOSE #1
--------------------------------------------------------------------------------------


The Following is the TEST.orc;===========
; toot03.orc
;===========

sr        =         44100
kr        =         44100
ksmps     =         1
nchnls    =         1

          instr 1                       ; p3=duration of note
k1         linen      p4, p6, p3, p7      ; p4=amp
asrc        oscil     k1, p5, 1           ; p5=freq
adiff       diff      asrc
anew        balance   adiff, asrc
agate       reson     asrc, 0,p5
asamp       samphold  anew, agate
a1          tone      asamp, p5
          out       a1                  ; p6=attack time
          endin                         ; p7=release time
          instr 2                       ; p3=duration of note
k1         linen      p4, p6, p3, p7      ; p4=amp
asrc        oscil     k1, p5/4, 1           ; p5=freq
adiff       diff      asrc
anew        balance   adiff, asrc
agate       reson     asrc, 0,p5
asamp       samphold  anew, agate
a1          tone      asamp, p5
          out       a1                  ; p6=attack time
          endin                         ; p7=release time
          instr 3                       ; p3=duration of note
k1         linen      p4, p6, p3, p7      ; p4=amp
asrc        oscil     k1, p5/2, 1           ; p5=freq
adiff       diff      asrc
anew        balance   adiff, asrc
agate       reson     asrc, 0,p5
asamp       samphold  anew, agate
a1          tone      asamp, p5
          out       a1                  ; p6=attack time
          endin                         ; p7=release time
-----------------------------------------------------------------------------

And finally, a sample test score.
-------------------------------------------------------------------------------
; Test.sco (C) 1999 Robert McNulty Junior
f1   0    4096 10 1      ; sine wave

t0 120

;p1           p2            p3,           p4            p5            p6            p7
i 1            0             8             11905.4       1107.368      .1718953      .6061823
i 2            0             8             11905.4       1107.368      7.083839E-02                .311819
i 3            0             8             11905.4       1107.368      .8715311      .7819333
-----------------------------------------------------------------------------------
Works greats. Runs smooth.
I'm planning on adding more as i find them.
BTW I now have an 8 Gigagbyte hard drive. Still running a P166.
My brother is using my old hard drive, a Quantum.
I love my new drive.
The move to the new drive was painless.
I had to get a new one as by next christmas, i will have a CD-RW.
May your higher power bless you.
Robert McNulty junior
sherlock_abc@netzero.net


__________________________________________
NetZero - Defenders of the Free World
Get your FREE Internet Access and Email at
http://www.netzero.net/download/index.html
--