; the sample rate, control rate, the duration of 1.0 and the duration of the piece can be changed
; the sample rate and control rate must be identical
; should be at least 48kHz; higher values are preferred
sr = 192000
kr = 192000
ksmps = 1
nchnls = 1
; define the length of 1.0 in seconds; every fraction will be scaled according to this value
; this value should be at least .0019 seconds
#define sec1 #.05208333#
#define gr #(sqrt(5)/2+.5)#
#define sp1 #round(sr*$sec1)#
; piece duration can be defined in score below
; the instrument should not be edited
instr 1
kres timek
if (kres == kr+1) then
kn = 0
kc = kres
endif
kv = (kn*$gr)-floor(kn*$gr)
ks = round(kv*$sp1)
if (kc+ks == kres) goto click
if (ks == 0) goto zerosamples
goto silence
zerosamples:
kc = kres-1
kn = kn+1
goto end
click:
kc = kres
kn = kn+1
aclick = 20223
out aclick
goto end
silence:
asilence = 0
out asilence
end:
endin
i1 1 60 ; replace value to the left of semicolon to change length of piece (in seconds)