sound - FluidSynth fails in script but works in ipython - Ask Ubuntu
i starting test use of fluidsyinth create midi files. first script simple. works in ipython not script in command line, not anything, no errors , no sound. using python2.7 in both (ipython , comand line). using ubuntu. code:
#!/usr/bin/env python2.7 mingus.midi import fluidsynth c import time in range (0,100,1): c.play_note(i,0,100) time.sleep(0.1)
i decided test fluidsynth directly comand line in ubuntu-terminal using
fluidsynth /usr/share/sounds/sf2/fluidr3_gm.sf2 mymusicfile.mid
and got this:
fluidsynth version 1.1.6 copyright (c) 2000-2012 peter hanappe , others. distributed under lgpl license. soundfont(r) registered trademark of e-mu systems, inc. cannot connect server socket err = connection refused cannot connect server request channel jackdmp 1.9.10 copyright 2001-2005 paul davis , others. copyright 2004-2013 grame. jackdmp comes absolutely no warranty free software, , welcome redistribute under conditions; see file copying details no message buffer overruns no message buffer overruns no message buffer overruns jack server starting in realtime mode priority 10 audio_reservation_init acquire audio card audio0 creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit configuring 44100hz, period = 1024 frames (23.2 ms), buffer = 2 periods alsa: final selected sample format capture: 32bit integer little-endian alsa: use 2 periods capture alsa: final selected sample format playback: 32bit integer little-endian alsa: use 2 periods playback type 'help' topics. >
but midi file not reproduced, shouldn't it?
this command works fine in ubuntu-terminal:
fluidsynth -a alsa -m alsa_seq -l -i /usr/share/sounds/sf2/fluidr3_gm.sf2 mymusicfile.midi
but problem remains in python. script copied @ beginning of thread works fine in ipython if run as:
run script.py
however not run when execute ubuntu-terminal on command line as:
python2.7 script.py
i tried following script works in ipython:
#!/usr/bin/env python2.7 import time import fluidsynth fs = fluidsynth.synth() fs.start() sfid = fs.sfload("example.sf2") fs.program_select(0, sfid, 0, 0) fs.noteon(0, 60, 30) fs.noteon(0, 67, 30) fs.noteon(0, 76, 30) time.sleep(1.0) fs.noteoff(0, 60) fs.noteoff(0, 67) fs.noteoff(0, 76) time.sleep(1.0) fs.delete()
and following output when run ubuntu-terminal:
cannot connect server socket err = no such file or directory cannot connect server request channel jackdmp 1.9.10 copyright 2001-2005 paul davis , others. copyright 2004-2013 grame. jackdmp comes absolutely no warranty free software, , welcome redistribute under conditions; see file copying details no message buffer overruns no message buffer overruns no message buffer overruns jack server starting in realtime mode priority 10 audio_reservation_init acquire audio card audio0 creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit configuring 44100hz, period = 1024 frames (23.2 ms), buffer = 2 periods alsa: final selected sample format capture: 32bit integer little-endian alsa: use 2 periods capture alsa: final selected sample format playback: 32bit integer little-endian alsa: use 2 periods playback jacktemporaryexception : quits...
although not make sound.
Comments
Post a Comment