! CS-DEMO.CMD
!
!  by Greg Schiemer '97
!
!  Creates Csound .SCO and .ORC files using data tuned from Scala.
!  Before running this program, select Scale (.SCL file) from Scales
!  archive and load it into SCALA directory. Lexical functions of
!  the ECHO command write tuning data straight into .ORC file.
!
set pause off
load *.scl 0
set pause on
!  show/frequency
!
!  writes 1st Csound file in the user's directory
!
file SCALE.ORC
!
! Start of Csound .ORC template
!
echo ; ------------------------------ SCALE.ORC ------------------------
echo ;
echo ; This Csound program allows a user to hear diatonic scales, melodic
echo ; and chordal passages played in a variety of JI tunings. An ORC file
echo ; allows a SCO file to read tables of diatonic pitch data. Data is
echo ; based on JI tunings found in Scales archive and converted to Csound
echo ; pitch information using Scala. Scala is by Manuel Op de Coul. The
echo ; Scales archive was created by Manuel Op de Coul and John Chalmers.
echo ; -----------------------------------------------------------------
echo sr=44100                               ; sampling rate : 44.1 kHz
echo kr=44100                               ; control rate  : 44.1 kHz
echo ksmps=1                                ; samples/ctrl period (sr/kr)
echo
echo nchnls  = 2                            ; stereo output
echo
echo instr   1
echo
echo i2      = p2                           ; p2 : start time
echo i3      = p3                           ; p3 : duration
echo
echo ipitch  = p5                           ; pitch  [1,2,3,4,5,6,7]
echo ioct    = p6 - 8                       ; octave [3,4,.........,12,13]
echo ; ___________________________________________________________________
echo
echo iton    = %octcps(%0)            ; 0: %image(%0) %name(%0)
echo isupton = %octcps(%1)            ; 1: %image(%1) %name(%1)
echo imed    = %octcps(%2)            ; 2: %image(%2) %name(%2)
echo isubdom = %octcps(%3)            ; 3: %image(%3) %name(%3)
echo idom    = %octcps(%4)            ; 4: %image(%4) %name(%4)
echo isubmed = %octcps(%5)            ; 5: %image(%5) %name(%5)
echo ileadn  = %octcps(%6)            ; 6: %image(%6) %name(%6)
echo
echo kamp    =      ampdb(p4)/2
echo
echo if (ipitch==1) igoto tonic
echo if (ipitch==2) igoto supertonic
echo if (ipitch==3) igoto mediant
echo if (ipitch==4) igoto subdominant
echo if (ipitch==5) igoto dominant
echo if (ipitch==6) igoto submediant
echo if (ipitch==7) igoto leadingnote
echo
echo print ipitch
echo
echo tonic:
echo         inote=iton
echo         igoto out
echo supertonic:
echo         inote=isupton
echo         igoto out
echo mediant:
echo         inote=imed
echo         igoto out
echo subdominant:
echo         inote=isubdom
echo         igoto out
echo dominant:
echo         inote=idom
echo         igoto out
echo submediant:
echo         inote=isubmed
echo         igoto out
echo leadingnote:
echo         inote=ileadn
echo         igoto out
echo
echo out:
echo print   inote
echo
echo         asig   pluck    kamp,cpsoct(inote+ioct),cpsoct(inote+ioct),0,1
echo         outs     asig, asig                        ; stereo signals
echo
echo         endin
!
! End of Csound .ORC template
!
close
!
!  writes 2nd Csound file in the user's directory
!
file SCALE.SCO
!
! Start of Csound .SCO template
!
echo ;------------------------------ SCALE.SCO -----------------------------
echo
echo f1    0    16384     10   1
echo ;---------------------------------
echo ;p1   p2   p3   p4   p5   p6
echo,
echo ;Ins  Stt  Dur  Vol  Pch  Oct
echo ;               db    %
echo
echo ;p1   p2   p3   p4   p5   p6
echo ;---------------------------------
echo
echo i1    0   0.5  90    3    7
echo i1    +    .   75    2    .
echo i1    .    .    .    3    .
echo i1    .   1.5   .    2    .
echo
echo i1    0    1   90    7    .
echo i1    +   1.5  85    4    .
echo i1    .   0.5   .    7    .
echo
echo i1    0    2    .    5    .
echo i1    +    1    .    6    .
echo
echo i1    3   0.5  90    7    8
echo i1    +    .   85    2    .
echo i1    .    .    .    7    .
echo i1    .   1.5   .    2    .
echo
echo i1    3    1    .    3    .
echo i1    +   1.5   .    5    .
echo i1    .   0.5   .    3    .
echo i1    3    2    .    6    .
echo i1    +    1    .    4    .
echo
echo i1    6   0.5  90    3    8
echo i1    +    .    .    4    .
echo i1    .    .    .    3    .
echo i1    .   1.5   .    4    .
echo
echo i1    6    1    .    7    .
echo i1    +   1.5   .    2    .
echo i1    .   0.5   .    7    .
echo
echo i1    6    2    .    5    .
echo i1    +    1    .    6    .
echo
echo i1    9   0.5  90    5    8
echo i1    +    .    .    6    .
echo i1    .    .    .    4    .
echo i1    .   1.5   .    2    .
echo
echo i1    9    1    .    7    .
echo i1    +   1.5   .    5    .
echo i1    .   0.5   .    7    .
echo
echo i1    9    2    .    3    .
echo i1    +    1    .    5    .
echo
echo i1    12  0.5  90    2    8
echo i1    +    .    .    7    .
echo i1    .    .    .    2    .
echo i1    .   1.5   .    7    .
echo
echo i1    12   1    .    5    .
echo i1    +   1.5   .    4    .
echo i1    .   0.5   .    5    .
echo
echo i1    12   2    .    3    7
echo i1    +    1    .    6    8
echo
echo i1    15  0.5  90    3    .
echo i1    +    .    .    2    .
echo i1    .    .    .    2    .
echo i1    .   1.5   .    7    .
echo
echo i1    15   1    .    3    .
echo i1    +   1.5   .    5    .
echo i1    .   0.5   .    3    .
echo
echo i1    15   2    .    6    .
echo i1    +    1    .    4    .
echo
echo i1    18  0.5  90    5    8
echo i1    +    .    .    2    .
echo i1    .    .    .    5    .
echo i1    .   1.5   .    2    .
echo
echo i1    18   1    .    7    .
echo i1    +   1.5   .    6    .
echo i1    .   0.5   .    7    .
echo
echo i1    18   2    .    4    .
echo i1    +    1    .    3    .
echo
echo i1    21  0.5  90    5    8
echo i1    +    .    .    6    .
echo i1    .    .    .    4    .
echo i1    .   1.5   .    2    .
echo
echo i1    21   1    .    7    .
echo i1    +   1.5   .    3    .
echo i1    .   0.5   .    7    .
echo
echo i1    21   2    .    2    .
echo i1    +    1    .    5    .
echo
echo i1    24  0.25 90    2    8
echo i1    +    .    .    3    .
echo i1    .    .    .    2    .
echo i1    .   0.75  .    3    .
echo
echo i1    24  0.5   .    7    .
echo i1    +   0.75  .    4    .
echo i1    .   0.25  .    7    .
echo
echo i1    24   1    .    5    .
echo i1    +   0.5   .    6    .
echo
echo i1   25.5 0.25 90    4    8
echo i1    +    .    .    7    .
echo i1    .    .    .    4    .
echo i1    .   0.75  .    7    .
echo
echo i1   25.5 0.5   .    2    .
echo i1    +   0.75  .    6    .
echo i1    .   0.25  .    2    .
echo
echo i1   25.5  1    .    3    9
echo i1    +   0.5   .    5    8
echo
echo i1   27   0.25 90    2    8
echo i1    +    .    .    7    .
echo i1    .    .    .    2    .
echo i1    .   0.75  .    7    .
echo
echo i1   27   0.5   .    4    .
echo i1    +   0.75  .    5    .
echo i1    .   0.25  .    4    .
echo
echo i1   27    1    .    6    .
echo i1    +   0.5   .    3    9
echo
echo i1  28.5  0.25 90    6    8
echo i1    +    .    .    3    9
echo i1    .    .    .    5    8
echo i1    .   0.75  .    7    .
echo
echo i1  28.5  0.5   .    4    .
echo i1    +   0.75  .    2    .
echo i1    .   0.25  .    4    .
echo
echo i1  28.5   1    .    7    .
echo i1    +   0.5   .    6    .
echo
echo i1   30   0.25 90    2    8
echo i1    +    .    .    7    .
echo i1    .    .    .    2    .
echo i1    .   0.75  .    7    .
echo
echo i1   30   0.5   .    4    .
echo i1    +   0.75  .    5    .
echo i1    .   0.25  .    4    .
echo
echo i1   30    1    .    6    .
echo i1    +   0.5   .    3    9
echo
echo i1  31.5  0.25 90    4    8
echo i1    +    .    .    7    .
echo i1    .    .    .    4    .
echo i1    .   0.75  .    7    .
echo
echo i1  31.5  0.5   .    2    .
echo i1    +   0.75  .    6    .
echo i1    .   0.25  .    2    .
echo
echo i1  31.5   1    .    3    9
echo i1    +   0.5   .    5    .
echo
echo i1   33   0.25 90    2    8
echo i1    +    .    .    7    .
echo i1    .    .    .    2    .
echo i1    .   0.75  .    7    .
echo
echo i1   33   0.5   .    4    .
echo i1    +   0.75  .    5    .
echo i1    .   0.25  .    4    .
echo
echo i1   33    1    .    6    .
echo i1    +   0.5   .    3    9
echo
echo i1  34.5  0.25 90    6    8
echo i1    +    .    .    3    9
echo i1    .    .    .    5    8
echo i1    .   3.25  .    7    .
echo
echo i1  34.5  0.5   .    4    .
echo i1    +   0.75  .    2    .
echo i1    .   2.75  .    4    .
echo
echo i1  34.5   1    .    7    .
echo i1    +   3.0   .    6    .
echo
echo i1  34.5  4.0   .    3    7
echo
echo e
!
! End of Csound .SCO template
!
close
