• Stars
    star
    492
  • Rank 89,476 (Top 2 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created about 12 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Music player - endlessly plays your music

Music player

First, if you wonder about what is supposed to be a music player or what makes a music player different from a simple media player, read this: What is a music player

Annoyed by all existing players because some subset of:

  • not open source
  • missing sound format (FLAC, Ogg, ...)
  • bugs (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...)
  • missing output possibility (RAOP, PulseAudio, ...)
  • none or too limited intelligent automatic queue (iTunes calls this DJ mode, others call this PartyShuffle)
  • no library / database

Features of this player:

  • open source (simplified BSD license, see License.txt)
  • simple
  • support of most important sound formats
  • advanced intelligent automatic queue which is the main mode to play music
  • simple music database
  • ReplayGain / audio volume normalization
  • Last.fm scrobbling
  • AcoustID fingerprint
  • Gapless playback
  • MPD backend

MusicPlayer screenshot

About the intelligent automatic queue, what I want (maybe some of these somewhat configurable):

  • continuously always add songs when queue becomes too empty
  • liked songs more often
  • context-based choices, e.g. related songs more likely
  • possibility to easily manually add songs to the list
  • easy way to restrict to a subset of songs (like a genre, a playlist, a filesystem directory, etc.)

About the database:

  • main function: search
  • should be fast and optional for playback, i.e. music can be played even when the database is currently not ready for some reason
  • should automatically be filled by a filesystem directory
  • import like-state from local players like iTunes and also online services like Last.fm

TODO / possible additional missing features:

  • BPM determination and clever DJ-like fading
  • use tags given by Last.fm (mostly more tags)
  • watch music directory for changes (e.g. new files added)
  • other GUI implementations

Comparison to other music players:

Installation:

So far, there is a prebuild MacOSX app bundle in the download section which should just work. Otherwise, to get the source working, you need these requirements (e.g. install on MacOSX via Homebrew):

  • ffmpeg
  • portaudio
  • chromaprint

(Debian/Ubuntu: apt-get install python-dev libsnappy-dev libtool yasm libchromaprint-dev portaudio19-dev libboost-dev. FFmpeg in Debian/Ubuntu is too old (lacks libswresample), so either do add-apt-repository ppa:jon-severinsson/ffmpeg && apt-get update && apt-get install libavformat-dev libswresample-dev or install it from source. Chromaprint depends on FFmpeg, so if you have a custom FFmpeg install, you might also want to install that manually. ./configure && make && sudo make install should work for FFmpeg and PortAudio. You might also want to use --enable-shared for FFmpeg. cmake . && sudo make install for Chromaprint.)

Then call ./compile.py to build the Python modules (it will build the Python modules ffmpeg.so and leveldb.so).

To start the player, just call ./main.py.

The current GUI is Cocoa only. Additional Qt support is planned. The music player also works without any GUI.

You can also control the player via an interactive Python shell. You can get the shell directly by passing --shell to main.py or you can use tools/shell.py. Via the shell, you can do just anything. By default, the shell exports already the two main objects state and queue. Here some useful actions:

  • import utils: common imports you might need for the other commands
  • state.curSong: returns the current song
  • state.player.playing = True: start playing. or start/stop via state.playPause()
  • state.nextSong(): skips to next song
  • state.queue.shuffle(): shuffles the queue
  • utils.formatTime(sum([s.get("duration", accuracy=0, fastOnly=True)[0] or 0 for s in queue.queue.list])): get the amount of time of all songs in the queue
  • import guiCocoa; reload(guiCocoa): reload Cocoa GUI. this might be useful if it crashed (which shouldn't happen, though)

You can use dir to get a list of attributes of an object. E.g. dir(state) returns list of all state-attributes. This might be useful if you want to figure out what you can do. But it might be easier to just look at the source. And you can use tab-autocompletion, e.g. type state. and press tab.

Also, don't hesitate to play around with the code. You might be interested in the automatic queue handling code.

Authors:

More Repositories

1

PyCParser

C parser and interpreter written in Python with automatic ctypes interface generation
Python
345
star
2

openlierox

OpenLieroX - Liero clone / Worms realtime / 2D shooter
C++
264
star
3

mouse-scroll-wheel-acceleration-userspace

Mouse scroll wheel acceleration in user space
Python
129
star
4

pydbattach

attach to running Python process
Python
105
star
5

python-embedded

Python build script to create a small embeddable static Python lib
C
82
star
6

music-player-core

Music player core Python module
C++
76
star
7

RandomFtpGrabber

Random FTP grabber - downloads all the interesting stuff
Python
59
star
8

playground

some space to try things out
Python
50
star
9

py_better_exchook

nice Python exception hook replacement
Python
41
star
10

python-preloaded

Bundle Python executable with preloaded modules
Python
41
star
11

commandergenius

Commander Genius - Commander Keen compatible clone -- main repo here: https://github.com/gerstrong/Commander-Genius
C++
40
star
12

Pyjector

inject PyTerminal into any running application via SIMBL
Objective-C
36
star
13

simbl

SIMBL is the SIMple Bundle Loader.
C
34
star
14

helpers

some small helper tools
Python
34
star
15

timecapture

captures your current topmost application and the URL/file with timestamps
Python
32
star
16

PySDL

PySDL is a pure Python SDL binding via on-the-fly ctypes generation
Python
29
star
17

wiki

some useful information
28
star
18

PythonHotswap

Hotswap Python functions. And persistence of runtime.
Python
28
star
19

grub-fuse

GRUB filesystem support <-> FUSE bridge
C
26
star
20

Xee

lightweight, fast and convenient image viewer and browser for MacOSX
C
24
star
21

png-db

Database for PNG images
C
23
star
22

dotfiles

my dotfiles
Shell
23
star
23

google-books-export

export PDF from Google Books preview
Python
21
star
24

Coding-Game-Intro

Coding Introduction / Tutorial, mostly by writing small little fun games
21
star
25

PyTerminal

Python Terminal framework - embed a Python GUI Terminal in your app
Objective-C
21
star
26

chrome-ext-google-takeout-downloader

JavaScript
19
star
27

learn-midi

Learn-midi learns to procude MIDI output based on any audio input
Python
17
star
28

background-zmq-ipython

Background ZMQ IPython/Jupyter kernel
Python
17
star
29

PyCPython

interpret CPython in pure Python
Python
16
star
30

IdeaResolveSymlinks

Java
14
star
31

mac-suppress-mouse-keyboard

Suppress mouse & keyboard events on MacOSX. Baby-proof my Mac!
Objective-C
14
star
32

PyLua

interpret Lua (the C source code) in pure Python with PyCParser
C
14
star
33

binstruct

binary structure serialization (like binary JSON or BSON) with cryptography
Python
10
star
34

FScriptAnywhereSIMBL

FScript Anywhere via SIMBL
Objective-C
10
star
35

RemoteControl

secure remote control of your computer from your iPhone
Python
10
star
36

PyOverheadGame

simple Python game with 2D top-down perspective
Scilab
9
star
37

smf-openid-server

SMF OpenID server
PHP
9
star
38

navit

Navit is a car navigation system with routing engine
C
9
star
39

planet_wars-cpp

Google AI challenge: Planet Wars game engine and co, C++ implementation
C++
9
star
40

timidity-macosx

TiMidity++ for MacOSX
C
8
star
41

literal-python-to-pickle

Convert literal Python code to binary Pickle -- faster ast.literal_eval
C++
7
star
42

pyclibrary

pure-python C parser + ctypes automation library
Python
7
star
43

backup_system

Python
6
star
44

py-tui-editor

Simple Python terminal (TUI) multi-line editor
Python
5
star
45

TeXShop

Objective-C
5
star
46

system-tools

Python
5
star
47

pynsh

the Python dynamic shell
JavaScript
4
star
48

AutoSleep

automatically suspend not-needed processes - safe battery
Python
4
star
49

iphone-ssh-relay

iPhone port/SSH relay daemon and client for USB connections
C
4
star
50

CPython

fork of CPython - to try out own hacks
Python
4
star
51

chromehacking

Chrome hacking
Python
4
star
52

screenshooting

scripts for handling screenshots and analyzing them
Python
4
star
53

foreground_app_info

get details about the application and opened url which is in foreground
Python
3
star
54

ChromeWebApps

turn a website into a native-like app on your Mac
Python
3
star
55

SaveTheRock

Save The Rock! is a 2D platformer bundled with a user-friendly in-game level editor
C++
3
star
56

iphone-backup

iPhone backup scripts
Shell
3
star
57

intelligent-patcher

scripts to patch source code in an intelligent way
Python
3
star
58

clang

copy of git://repo.or.cz/clang.git
C++
3
star
59

WebAudioPlayer

audio player in HTML/JS
JavaScript
3
star
60

getraenke

Getränkeabrechnungssystem fürs Wohnheim
Python
3
star
61

9eyes-fetcher

fetches all images from 9-eyes.com
Python
3
star
62

ImageViewer

view images
C++
2
star
63

play-with-the-brain

PyBrain experiments
Python
2
star
64

openlierox-distrib

OpenLieroX - distrib scripts & files
C++
2
star
65

planetwars

PlanetWars Google AI Challenge 2010
Python
2
star
66

reiserfs-fuse

ReiserFS for FUSE
C
2
star
67

PictureSlider

MacOSX picture screen saver
Objective-C
2
star
68

turingmachine

Non-deterministic Turing machine simulator framework
C++
2
star
69

MathExercisesJavaAppletBase

Java (Applet) code base for math exercises
Java
2
star
70

zinssaetze

Python
2
star
71

tor

C
2
star
72

automatic_object_locking

demonstrating how the GIL could be removed in Python
C++
2
star
73

google-contacts-sync

Google contact syncing and merging
Python
2
star
74

diplom-thesis-automata

Diplom thesis for Computer Science in Automata theory
TeX
1
star
75

memos

manage memos
Python
1
star
76

ParseOggVorbis

C++ OGG Vorbis decoder
C
1
star
77

errordb

error message database - with list of solutions to each error
1
star
78

live-helper

Python
1
star
79

PyJitDev

Just-in-Time Python development
Python
1
star
80

ffmpeg

build tools, Xcode project
C
1
star
81

google-breakpad

OpenLieroX Google Breakpad copy
C++
1
star
82

diplom-thesis-math

Diplom thesis for Mathematics
Python
1
star
83

sdl

copy of SDL svn trunk
C
1
star
84

itunes-scripts

some simple Python scripts for iTunes and the iTunes music library
Python
1
star
85

streamplay

Objective-C
1
star
86

Sport-RWTH-Aachen

exaktes Kursprogramm (nach Zeit) von Sportkursen vom Hochschulsport der RWTH Aachen
1
star