# Testing Csound
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tin a 82',
'tie x6 ws,e,14,0,200,16000',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# A Noise Instrument
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tin a 13',
'tie r cs,(whps,e,(bg,rp,(5,10,15,20)),0,.200,.050)',
# set initial low-pass filter cutoff frequency
'tie x2 whps,e,(bg,rp,(5,10,20,2,10)),0,400,18000',
# set final low-pass filter cutoff frequency
'tie x3 whps,e,(bg,rp,(5,10,20,2,10)),0,400,18000',
# panning controlled by fractional noise with infrequent zero-order Markov controlled jumps out of 1/f2 to 1/f0
'tie n n,100,(mv,a{2}b{0}:{a=12|b=1}),0,1',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# A Sample Playback Instrument
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tin a 32',
# set a file path to an audio file
'tie x6 cf,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio/29561.aif',
# line segment absolute rhythm durations
'tie r cs,(ls,e,(ru,5,30),(ru,.03,.15),(ru,.03,.15))',
# start position within audio file in seconds
'tie x5 ru,0,40',
'tie a ls,e,(bg,rc,(3,5,20)),.1,1',
'tie x2 whps,e,(bg,rp,(5,10,20,2,10)),0,100,10000',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# A Sample Playback Instrument with Variable Playback Rate
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tin a 230',
'tie x6 cf,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio/32673.aif ',
# line segment absolute rhythm durations
'tie r cs,(ls,e,(ru,10,30),(ru,.05,.25),(ru,.05,.25))',
'tie x5 ru,0,10',
# initial and final audio playback rate
'tie x7 mv,a{1}b{.75}c{.5}d{.2}e{2}:{a=6|b=3|c=2|d=1|e=1}',
'tie x8 mv,a{1}b{.75}c{.5}d{.2}e{2}:{a=6|b=3|c=2|d=1|e=1}',
# panning controlled by fractional noise with infrequent zero-order Markov controlled jumps out of 1/f2 to 1/f0
'tie n n,100,(mv,a{2}b{0}:{a=12|b=1}),0,1',
'ticp a b',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Composing with Densities using TM TimeFill and a Noise Instrument
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tmo tf',
'tin a 80',
'tie t 0,30',
# total event count is defined as static texture parameter, not a ParameterObject
'tie s3 600',
# start position within texture normalized within unit interval
'tie d0 rb,.3,.3,0,1',
# durations are independent of start time
'tie r cs,(mv,a{.01}b{1.5}c{3}:{a=20|b=1|c=1})',
'tie a ru,.5,.9',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Composing with Densities using TM TimeFill and a Single Sample
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tmo tf',
'tin a 32',
# set a file path to an audio file
'tie x6 cf,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio/27980-high-slow.aif',
# start position within audio file in seconds
'tie x5 ru,0,1',
# vary a low pass filter start and end frequencies
'tie x2 mv,a{200}b{1000}c{10000}:{a=6|b=2|c=1}',
'tie x3 mv,a{200}b{1000}c{10000}:{a=6|b=2|c=1}',
# total event count is defined as static texture parameter, not a ParameterObject
'tie s3 500',
# start position within texture normalized within unit interval
'tie d0 ic,(rg,.2,.1,0,1),(rg,.7,.1,0,1),(bg,rc,(0,1))',
# durations are independent of start time
'tie r cs,(whps,e,(bg,rp,(5,10,15)),0,.010,.100)',
# must reduce amplitudes
'tie a ru,.1,.3',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Polyphonic Sine Grains LineGroove
from athenaCL.libATH import athenaObj
ath = athenaObj.Interpreter()
cmd = [
'emo cn',
'tmo LineGroove',
'tin a 4',
# set a event time between 60 and 120 ms
'tie r cs,(ru,.060,.120)',
# smooth envelope shapes
'tie x0 c,.1',
'tie x1 c,.5',
# set field with a tendency mask converging on a single pitch after 15 seconds
'tie f ru,(ls,t,15,-24,0),(ls,t,15,24,0)',
# set random panning
'tie n ru,0,1',
# create a few more instances
'ticp a b c d e f',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Polyphonic Sine Grains: DroneArticulate
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'apr off',
'tmo DroneArticulate',
# a very large pitch collection made from a Xenakis sieve
'pin a 5@2|7@6,c1,c9',
'tin a 4',
# set a event time between 60 and 120 ms
'tie r cs,(ru,.060,.120)',
# smooth envelope shapes
'tie x0 c,.1',
'tie x1 c,.5',
# set random panning
'tie n ru,0,1',
# reduce amplitudes
'tie a ru,.6,.8',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Polyphonic Sample Grains from a Single Audio File: LineGroove
from athenaCL.libATH import athenaObj
cmd = [
'emo cn',
'tmo LineGroove',
# instrument 32 is a fixed playback rate sample player
'tin a 32',
#set a file path to an audio file
'tie x6 cf,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio/32673.aif',
# set a event time between 60 and 120 ms
'tie r cs,(ru,.060,.120)',
#smooth envelope shapes
'tie x0 c,.01',
'tie x1 c,.5',
# start position within audio file in seconds
'tie x5 ru,0,10',
# set random panning
'tie n ru,0,1',
# create a few more instances
'ticp a b c d e f',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Polyphonic Sample Grains from a Multiple Audio Files: LineGroove
from athenaCL.libATH import athenaObj
ath = athenaObj.Interpreter()
cmd = [
'emo cn',
'apr off',
'tmo LineGroove',
# instrument 32 is a fixed playback rate sample player
'tin a 32',
# set a file path to an directory, a file extension, and a selection method
'tie x6 ds,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio,.aif,rp',
# set a event time between 60 and 120 ms
'tie r cs,(ru,.060,.120)',
# smooth envelope shapes
'tie x0 c,.01',
'tie x1 c,.5',
# start position within audio file in seconds
'tie x5 ru,0,10',
# set random panning
'tie n ru,0,1',
# control a variety of amplitudes
'tie a ru,.2,.4',
# create a few more instances
'ticp a b c',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)
# Polyphonic Sample Grains from a Multiple Audio Files: LineGroove
from athenaCL.libATH import athenaObj
ath = athenaObj.Interpreter()
cmd = [
'emo cn',
'apr off',
'tmo TimeFill',
# instrument 32 is a fixed playback rate sample player
'tin a 32',
# set a file path to an directory, a file extension, and a selection method
'tie x6 ds,/Volumes/xdisc/_sync/_x/src/martingale/martingale/audio,.aif,rp',
# set a event time between 60 and 120 ms
'tie r cs,(ru,.030,.090)',
# smooth envelope shapes
'tie x0 c,.01',
'tie x1 c,.5',
# start position within audio file in seconds
'tie x5 ru,0,10',
# set random panning
'tie n ru,0,1',
# control a variety of amplitudes
'tie a ru,.1,.2',
# set number of events
'tie s3 1000',
# start position within texture normalized within unit interval
'tie d0 rb,.3,.3,0,1',
]
def main(cmdList=[], fp=None, hear=True, render=True):
ath = athenaObj.Interpreter()
for line in cmdList:
ath.cmd(line)
if fp == None:
ath.cmd('eln')
else:
ath.cmd('eln %s' % fp)
if render:
ath.cmd('elr')
if hear:
ath.cmd('elh')
if __name__ == '__main__':
main(cmd)