Peace Synthesizer Framework
0.03
Cross Platform Scriptable Real-Time Visualization & Sound !!
Main Page
Related Pages
Packages
Classes
Examples
tu_005a_NES_Famicom_sound_emulation.py
Play sequence data of NES (famicom) sound emulation V0.03
Click on each functions for more detail
1
##\example tu_005a_NES_Famicom_sound_emulation.py
2
#Play sequence data of NES (famicom) sound emulation V0.03
3
#
4
#\n\n <small>Click on each functions for more detail </small>\n
5
#
6
7
import
peaceaudio
8
import
time
9
import
song.nes.sidepocket_test
as
demosong
10
11
buffersize = 128
12
peaceaudio.init_peaceaudio
(sample_rate = 44100, inch = 0, outch=2, framesPerBuffer = buffersize)
13
peaceaudio.openStream
()
14
15
track =
peaceaudio.createNESTrack
()
16
track.initStringCompiler(demosong.text)
17
track.compileString()
18
19
def
callback():
20
peaceaudio.generate
()
21
peaceaudio.writeBuffer
()
22
return
1
23
24
25
mixer =
peaceaudio.createMixer
()
26
mixer.addTrack(track)
27
28
peaceaudio.setMixer
(mixer)
29
peaceaudio.setCallback
(callback)
30
peaceaudio.start
()
31
32
while
track.stringcompiler.alive:
33
time.sleep(0.1)
34
peaceaudio.stop
()
35
print
"exit"
http://peacedeveloper.appspot.com
http://peacedev.wordpress.com