Ejemplo n.º 1
0
octave = sc.Synth( "xiiOctave2x2" )
octave.pitch1 = 0.1
octave.pitch2 = 1
octave.fxlevel = 1 # processed sound
octave.level = 0 # clean sound

# player > delay > octave > snd card
player.outbus = delay.inbus = 4
delay.outbus = octave.inbus = 6
# octave.outbus = 0 # sound card. It is 0 by default so we dont need to do this one.

player.rate = 1 # play it now

timeout =  time.time()  + 10 # secs
while time.time() < timeout :
    time.sleep(0.1) # every tenth of sec
    delay.feedback += 0.01 # more feedback
    delay.fxlevel +=  0.01 # higher delayed sound level
    octave.pitch1 += 0.01 # increase
    octave.pitch2 -= 0.01 # decrease
    print 'fxlevel: %f / feedback: %f / octave pitch1: %f and pitch2: %f : ' % ( delay.fxlevel, delay.feedback, octave.pitch1, octave.pitch2 ) 

sc.unloadSnd( player.bufnum )
player.free()
sc.quit()
print 'quiting'




Ejemplo n.º 2
0
import time, os

# we need to tell python where the scserver application lives, this
# changes between platforms and systems. You might need to edit it.
# exedir = 'usr/local' # where does scsynth live?
# sc.start(exedir, verbose=1, spew=1 )

sc.start(spew=1, verbose=1, startscsynth=0)

player2 = sc.Synth("StereoPlayer")
player2.bufnum = sc.loadSnd("aaa.wav", wait=True)
print "loading bufnum with ID", player2.bufnum

time.sleep(8)

player = sc.Synth("StereoPlayer")
player.bufnum = sc.loadSnd("numeros.wav", wait=True)
print "loading bufnum with ID", player.bufnum

time.sleep(8)  # wait while both sounds play

sc.unloadSnd(player.bufnum)
sc.unloadSnd(player2.bufnum)

player.free()
player2.free()

sc.quit()

print 'quiting'