2013年1月17日 星期四

smaf to wav solution


Survey

midi -> smaf(mmf,spf) -> wav
  1. midi-> smaf(mmf) : RetroCode<support MA2,3,5>
  2. smaf-> wav :
  • recorder software : total recorder, mp3mymp3(free), Audacity(free)
  • auto-play script : sikuli

    figure. the sikuli script
  • recording by python api : pyaudio
    recorder.py
    import pyaudio
    import wave
    p = pyaudio.PyAudio()
    stream = p.open(format = FORMAT,
                    channels = CHANNELS,
                    rate = RATE,
                    input = True)
                    #frames_per_buffer = chunk)
    print "* recording"
    all = []
    for i in range(0, RATE / chunk * RECORD_SECONDS):
        data = stream.read(chunk)
        all.append(data)
    print "* done recording"

Final version

System structure
Step by step
1. open stereo mode

figure. setting stereo mix mode on Windows 7
hint
the option is hidden on Windows 7
2. open recorder(server)
  • make sure the softwares
    • python 2.7
    • pyaduio
  • execution server
    • command line : #python server_recorder.py
    • IDEL : execfile("C:\server_recorder.py")
3. open player(client)
  • open mexa emulator
  • create folder /sampleData/jscl_storage_root/mc/(the StorageConnection use)
  • copy smaf music in /sampleData/jscl_storage_root/mc/MEXA/*.spf
  • running MIDlet
4. collection data
you can see the wav file in Default path - C:\Python27\smaf2wav\

Reference

python lib for midi
open source project for smaf player

沒有留言:

張貼留言