I have to make relaxing music using pyo package in python. I am not very experienced with audio processing . Any advice for that?
There are a few examples on the GitHub and potentially other sources on the internet. I recommend checking it out and trying a few different experiments with the program to get an understanding to move forward. It might and probably will help https://github.com/belangeo/pyo
Related
I have made a script in Python to visualize the intersection of a line between two points and 2 circles. The code runs really well but I'd like to also be able to share this with people who don't have to install python or library to run it. Like in a web browser.
I have found a library called mpld3 that could do the job but unfortunately the sliders that I used don't work at all, and they are glitched for some reason. The glitch in question
So I was wondering first if mpld3 was a good solution and if so, how can I solve my problem? I really can't find anything online related to my issue so it's really bothering me. Thanks in advance.
It may be a stupid noob question, but I am a total beginner, so I would appreciate any help.
I spent over an hour searching through youtube and google for tutorials, but libpython-clj doesn't have much info out there.
In the examples I found, the python libraries being imported are from independent repos. I looked through the libpython-clj's readme and Gigasquid's tutorial, but I am totally lost.
How do I use my own python file?
Suppose I have a project with foo.py.
How do I integrate it with my Clojure script using libpython-clj?
I would be very grateful for the answer.
I gave this a try today because I was also curious about it too, so I created a small Clojure project to call a simple python package. The idea is that you can build trivial packages from your own Python code, install them in a virtualenv directory and use them from Clojure.
https://github.com/dfuenzalida/clj-python-interop
EDIT: I noticed that projects using libpython-clj are now using the clj tool with deps.edn and it works as expected. I've updated the repo above with a fully working example.
I want to create MIDI tracks in a Python program and be able to play them instantly (preferably without writing to disk). I have recently discovered the package python-midi which looks great. However I haven't figured out how to play the tracks created with this package. Do I need an additional package? Help would be appreciated.
My solution if anyone is interested:
I ended up using mido for my Python MIDI API, with Pygame as the backend.
Works like a charm :)
I recently finished up a small game I wrote in python, using pygame, at the request of some of my friends. Currently, I have the .pyw game file, and an assets folder containing all files used in the program. I used py2exe to distribute the game, which worked fine, although it still does not seem very user friendly to people downloading the game. One of my friends requested a mac version of it, and although I know about py2app, I am unsure of how to use it, and whether or not it is the best way to package my game.
Basically, I want a single file that I can send to any mac user, so they can easily use the program I have made, while preferably not seeing the source code.
I have googled around for a simple solution, but have not found one. If anyone could give a very simple explanation of how to easily do this, that would be great. Please keep in mind I am fairly new to programming, and may not understand all the programming lingo, so if you could keep it simple, I would appreciate it.
Thanks in advance.
The answer to How can I distribute python programs? suggests Pyinstaller which looks promising, although I have not tried it myself.
See this tutorial by Irwin Kwan to see how Pyinstaller can actually be used with Pygame. He describes a procedure for preparing a Windows executable as well as one for OS X.
First things first, I am a Python beginner, with a typical C++/Java background for object oriented stuff.
I was convinced to try Python for this current endeavor I am working on, and so far I like it. One issue I am having though is finding a good mp3 module.
I have tried TkSnack, which installed and ran fine with no errors(as long as my audio device wasn't busy) but it could never actually produce a sound, it just did nothing... I went online for help, and was disappointed with the amount of documentation.
So I decided to switch. I tried PyMad because it is in the standard repositories for Ubuntu as well. There was even less documentation on this, but I could make it play a sound. The only problem is that it requires a loop to constantly write/play the audio buffer. This makes it particularly hairy to handle playback control(in my opinion) cause I would have to run this in a separate thread or process, and somehow control the seek position for pause and such. This is a little too low level for why I am using Python. I liked the simplicity of TkSnack for its easy commands like "mysound.play()" or "mysound.pause()" rather than controlling a loop.
I also looked at pyMedia, which looks like it is the most up to date with documentation, but I can't get it to install on my machine. I get a "gcc exited with value 1" error or something like that when running the "python setup.py build" command.
So I am looking for any suggestions or help on one of these modules, or a completely different one, that is high level and easy to use for mp3s(and preferably other formats too) I am trying to have basic playback control(pause, stop, skip, seek) and I may also be streaming files too eventually(if I ever get there).
EDIT: I like the python bindings for Gstreamer, but is this a cross-platform solution?? I forgot to mention that as a requirement. But I always just associated GStreamer with Linux, would this work on other OSs?
EDIT: Wikipedia says yes.
Sorry I can't help you with PyMad or pyMedia, but I have other suggestions.
Existing music players written in Python:
Exaile
FUPlayer
Listen
All of the above use the Python bindings for the GStreamer multimedia framework. Docs for the bindings are scarce, but check here, here, here, and examples from the source distribution here.
I just had to deal with this, and from my research I think your best bets are pyglet and pygame. They're interface packages with built-in a/v support.