[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Tone Generator with Pygame, SciKits AudioLab & SciPy - Less laggy method?



Thank for the reply Mark,

I looked up Audiere and I saw some posts about it not being maintained anymore in Ubuntu and Debian Linux. (I'm doing this is Linux BTW :D )
I looked up CSound, it looked ok. I was able to install it with apt-get. I can run "csound" from the command line but I cannot find the csnd.py file or get "import csnd.py" to run in python.

Are you using CSound in a .py file? Does anyone have any tips for installing csound in ubuntu 12.04?


Here is my output from installing from source:

*********************************************
bgryderclock@LinuxSatelliteLappy:~/Csound5.18.02$ sudo python install.py
[sudo] password for user:
Csound5 Linux installer by Istvan Varga

/usr/local
 === Installing executables ===
  /usr/local/bin/brkpt
  /usr/local/bin/linseg
  /usr/local/bin/tabdes
 === Installing libraries ===
 === Installing plugins ===
 === Installing header files ===
  /usr/local/include/csound/cfgvar.h
  /usr/local/include/csound/cscore.h
  /usr/local/include/csound/csdl.h
  /usr/local/include/csound/csound.h
  /usr/local/include/csound/csound.hpp
  /usr/local/include/csound/csoundCore.h
  /usr/local/include/csound/cwindow.h
  /usr/local/include/csound/msg_attr.h
  /usr/local/include/csound/OpcodeBase.hpp
  /usr/local/include/csound/pstream.h
  /usr/local/include/csound/pvfileio.h
  /usr/local/include/csound/soundio.h
  /usr/local/include/csound/sysdep.h
  /usr/local/include/csound/text.h
  /usr/local/include/csound/version.h
  /usr/local/include/csound/float-version-double.h
  /usr/local/include/csound/float-version.h
  /usr/local/include/csound/CppSound.hpp
  /usr/local/include/csound/filebuilding.h
  /usr/local/include/csound/CsoundFile.hpp
  /usr/local/include/csound/csPerfThread.hpp
 === Installing language interfaces ===
 === Installing Localisation files ===
install: cannot stat `po/de/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/de/LC_MESSAGES/csound5.mo
install: cannot stat `po/en_GB/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/en_GB/LC_MESSAGES/csound5.mo
install: cannot stat `po/en_US/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/en_US/LC_MESSAGES/csound5.mo
install: cannot stat `po/es_CO/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/es_CO/LC_MESSAGES/csound5.mo
install: cannot stat `po/fr/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/fr/LC_MESSAGES/csound5.mo
install: cannot stat `po/it/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/it/LC_MESSAGES/csound5.mo
install: cannot stat `po/ro/LC_MESSAGES/csound5.mo': No such file or directory
 *** error copying /usr/local/share/locale/ro/LC_MESSAGES/csound5.mo
 === Installing documentation ===
  /usr/local/share/doc/csound/COPYING
  /usr/local/share/doc/csound/ChangeLog
  /usr/local/share/doc/csound/INSTALL
  /usr/local/share/doc/csound/readme-csound5.txt
 === Installing Tcl/Tk modules and scripts ===
  /usr/local/lib/csound/tcl/nsliders.tk
  /usr/local/bin/matrix.tk
 === Installing uninstall script ===
  /usr/local/bin/uninstall-csound5
 === Installing MD5 checksums ===
  /usr/local/csound5-2012-10-13.md5sums

 *** Errors occured during installation, deleting files...

*********************************************



On 10/13/2012 07:35 PM, Mark Brophy wrote:
I've used Audiere with numpy. I prefer using CSound.

Mark Brophy

On Sat, Oct 13, 2012 at 4:29 PM, brian <bgryderclock@xxxxxxxxx> wrote:
I wrote a simple pygame program to read MIDI events and generate/play sine wave sounds using scikits audiolab and scipy modules. (The code is here: pastebin.com/VTBQxjQm )

It is working, but it takes about half a second to repeat the “scikits.audiolab.play()” method.

    f = 440*(2**((mymidinumber-69)/12))  

    x = scipy.cos((2*scipy.pi*f/fs)*scipy.arange(fs*T))
    print "before method, this is quick!"
    scikits.audiolab.play(x,fs)          #<====this is the laggy method
    print "after method, this is laggy"

Can anyone recommend a faster method for playing sine waves? Perhaps there is a better Audiolab method or different module?


Any suggestions, snippets or links would be greatly appreciated.