DeastinY / musicsaur

Music synchronization using browsers and a Python server - great for LAN systems!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

MusicSAUR (formerly the un-googleable "μsic")

Music Synchronization And Uniform Relaying

Version 1.2 Join the chat at https://gitter.im/schollz/musicsaur


Update 12/19/2015: Version 1.2 released!

Major features include:

  • Improved server performance
  • State variables for reloading position in playlist and faster boot-up
  • Bug fixes
  • Fewer dependencies

Want to sync up your music on multiple computers? This accomplishes exactly that - using only a simple Python server and a browser. Simply run the Python server, and open up a browser on each computer you want to sync up - that's it!

This program is powered by the excellent howler.js library from goldfire. Essentially all the client computers sync their clocks and then try to start a song at the same time. Any dissimilarities between playback are also fixed, because the clients will automatically seek to the position of the server.

Installation

Tested on Python2.7 and Python3.4. Requires setuptools. To install simply use

pip install setuptools
git clone https://github.com/schollz/sync-music-player.git
python setup.py install

Usage

Open up the configuration file, config.cfg, and edit line 42 by inputting your music folder, e.g.:

music_folder = /my/music/folder

Now start the server using

python syncmusic.py

which should print out something like

############################################################
# Starting server with 346 songs
# To use, open a browser to http://W.X.Y.Z:5000
# To stop server, use Ctl + C
############################################################

Your server is up and running! Now, for each computer that you want to play music from, just go and load up a browser to the url http://W.X.Y.Z:5000. You will see the playlist and the music will automatically synchronize and start playing!

Auto-start Raspberry Pis!

If you'd like the server to automatically start up the Raspberry Pis, its easy to do. First, from your server computer (which can also be a Raspberry Pi) copy your ssh-key using the following command:

ssh-copy-id pi@YOUR_PIS_IP

Now sign-in to your Pi (you shouldn't have to use a password now) and install midori:

ssh pi@YOUR_PIS_IP
sudo apt-get install midori

Finally, open up the config.cfg and change line 16 to include the address of the computer:

clients = pi@YOUR_PIS_IP

If you have more then one, just seperate them by commas.

Some notes

chrome://flags/#disable-gesture-requirement-for-media-playback
  • If you want to play music from a Raspberry Pi, just type this command (works on headless):
xinit /usr/bin/midori -a http://W.X.Y.Z:5000

OR

xinit /usr/bin/luakit -u http://W.X.Y.Z:5000

Screenshot

Screenshot

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

  • 12/19/2015 (morning): Version 1.2 Release
  • 12/18/2015 (evening): Version 1.1 Release
  • 12/18/2015 (morning): Version 1.0 Release

Credits

About

Music synchronization using browsers and a Python server - great for LAN systems!

License:MIT License


Languages

Language:JavaScript 55.8%Language:HTML 21.1%Language:Python 12.1%Language:CSS 11.0%