Giter VIP home page Giter VIP logo

soundtrack's Introduction

collaborative music streaming over a peer-to-peer network

Build Status Coverage Status GitHub contributors Community

soundtrack.io is a collaborative online radio, almost like a jukebox for the Internet.

Vote on what plays next, like Reddit for music.

The "Queue" shows all requested tracks, ordered by oldest first. Upvote or downvote a track to add your vote, pushing it to the top or the bottom as per your preference.

Reliable Streams

Soundtrack aggregates streams from sources like YouTube and SoundCloud, so when a song is queued, it has multiple locations to play from if any one source fails for any particular reason.

Earn Bitcoin

Help others with reliability by hosting streams, earning Bitcoin in exchange for your node's work. Deposit and withdraw using normal Bitcoin addresses, compatible with all major wallets.

Quick Start

  1. npm install -g FabricLabs/soundtrack
  2. soundtrack

Configuration

Supply environment variables FABRIC_PORT and/or FABRIC_SEED for Fabric peer-to-peer communication and persistent storage, respectively.

Earning Bitcoin

Income can only be generated for online nodes, through an opt-in program.

To enable earning, be sure to provide FABRIC_SEED with a mnemonic and use:

$ soundtrack --earn

Be sure to back up your keys — we are not responsble for any losses!

API

TODO: npm run make:api

Contributing

Fork. Commit. Pull request.

soundtrack's People

Contributors

chastagi avatar chrisinajar avatar eah13 avatar fractaloop avatar lucas-c avatar martindale avatar naterchrdsn avatar phlare avatar thesoftwarejedi avatar tyrelsouza avatar unusualbob avatar vorathe avatar zbeekman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soundtrack's Issues

Broken Bio Page #Bug

Hey so by accident I managed to break the bio page for myself. It has to do with the way the pages are rendered with the information you put into the textbox.

Current broken page:
https://docs.google.com/file/d/0B6dAeVdSmX3-R0NBMkp6aVZEekU/

Inspected Elements:
https://docs.google.com/file/d/0B6dAeVdSmX3-N1NjVUdWTVppbVE

As you can see the html code is still there but it's stuck inside the <style> tag I tried to add to mark up the page a little.

I would image that @martindale would simply have to remove my bio from the database and it would reset everything back to normal.

Issue being that anyone can do this and break the bio page.

Setting for Dark / Light Styles

We need the ability to default to the dark style (available on the darkness branch), but toggle to the cleaner "white" style. Probably an option in the settings.

Track skips so The Machine won't play songs that are often skipped.

Sometimes when we get off-genre or play a "troll" song, the machine remembers and replays these tracks. Users end up skipping a lot of those specific songs when played by the machine for a variety of reasons (distraction, bad flow, off-genre, initial humor wore off...).

Could we track how often a song is skipped, and find a threshold or ranking algorithm that would make the machine NOT replay songs that are often skipped?

Copyright is broken.

“Overprotecting intellectual property is as harmful as underprotecting it. Culture is impossible without a rich public domain. Nothing today, likely nothing since we tamed fire, is genuinely new: Culture, like science and technology, grows by accretion, each new creator building on the works of those who came before. Overprotection stifles the very creative forces it's supposed to nurture.”
― Alex Kozinski, Chief Judge of the United States Court of Appeals for the Ninth Circuit

Copyright, especially as it applies to music, is fundamentally broken. Archaic laws restrict where and how music can be used, and by whom. Music, like all information, deserves to be free in the same way that musicians deserve to be free from the tyranny of inept sycophants.

Back button resets chat

To recreate:

  1. Go to soundtrack.io, see current state of chat
  2. watch chat happen
  3. click off the page (link)
  4. use back button to go back to soundtrack.io, see state of chat as it was in (1), losing the messages that have happened since.

Volume Bar Bug

It seems that you can only drag the volume bar to get a desired level. Clicking on it results in no change from the original volume as shown in picture:

wotmeight

clicking it somewhere else once more results in a totally random volume not having anything to do with the 0-100 scale:

meightwon

Proper playlist management

User playlists should be accessible via the UI. This should likely be done via angular.js.

Features that should be included:

  • Track preview
  • pdj import
  • add track to room

Issue with Usernames

When a User's username contains special characters or non-UTF8 characters their profile cannot be viewed.

For instance the User "{-_-}" cannot be viewed at http://soundtrack.io/{-_-} because it is infact an invalid URL. So there needs to be a fallback inplace when a username contains special characters, or this should be disallowed completely.

All hashes and salts compromised for logged in users

Hey guess what, since we don't have a community review and all of martindales pushes go in without any oversight, things get missed. This time a big one got missed and all of the salts and hashes of currently logged in users are compromised.

Due to me being nice I won't post any hashes or the exploit, but since @martindale hasn't responded to my hangout messages I figured this was the best place for disclosure.

Btw, here's martindale's salt "salt": "d59957add4b099c65e1c2e511e730db59f5eef691e7b08e879737396054326ab"

The passwords are encrypted with 2500 rounds of pbkdf2 so they are fairly secure, but this is one of the reasons I do no like our current code structure.

YouTube is the only available source for audio

YouTube is currently the only available audio source for tracks on soundtrack.io, making us very vulnerable to the transient nature of YouTube videos (the uploader can remove the track, is not available within certain geographic contexts, or might not be accessible from certain devices due to arbitrary restrictions on the content (see #1)). We should add more sources for every audio track so that no one source being unavailable inhibits the listening experience for a user.

Connected clients restart currently playing track on reconnect

When a reconnect event happens, the currently playing track is reset to 00:00 on the client instead of correctly returning to the seekTo value sent in the track event.

Refreshing the window restores the correct position of the song, so the server is keeping state...

UX Concepts for soundtrack.io

I've been working on some UX ideas guys. Would love some feedback!

Disclaimer: This is by no means a completed design. No design is ever really "finished", but it's still missing key components to the UI...

Main Concept -

concept-2-feedback

Concept v1 - Where Add Track overlaps the main content

concept-2-feedback-add-track-sidebar

Concept v2 - Where Add Track is "inserted" between the Playlist Queue and the Video Player. This briefly pushes content off the screen for some small resolutions.

concept-2-feedback-add-track-sidebar-insert

List of things to do:

  • I'm not attached to the 'spin it, lame' language. My goal was to visualize the amount of votes the track has received (the green/red bars increase in width as the votes accumulate)
  • I think we can do something more interesting with our logo. Though I have no idea where to go with that yet. For now, it's similar to what we currently have.
  • Volume/Mute Icon next to the volume slider
  • Create the Add Track button that triggers the Add Track search/import menu.
  • More sample tracks in the queue to visualize how a fully populated queue might look like.
  • The 'Logged In' user settings bar on the far left side needs to be figured out. SMALL menu that is heavily icon based. Maybe no text at all? ie: Gear for account settings, logout button, another manage playlist icon (similar to the shortcut found above the playing video), etc
  • More examples of what each page (About, History, People) might look like using the overall design. I really like the minimalism of "inserting" those page's content the way the "Add Track" content is inserted into the main view. Ideally--- I don't think we ever want to take the user away from the main page. If we can keep the content of those pages short and sweet, maybe we can fit it all in a similar way?

Take note of...

concept-2-feedback - copy

  • The heart (shown as active) should toggle the Add to Playlist fancybox (or whatever it is we use), and slide up the text above to reflect when the user first added this song to their specified playlist.
  • Google+ Sign in? Please? 👍
  • Eric mentioned he likes Blynde's sidebar for the songs queue. I made the design with the left sidebar in mind, but this could easily be reworked so that the sidebars are fixed to the right.

The Geolocation Visualizer

Obviously this would take significant work to bring into fruition, but I think it would be slick to visualize where users are coming from, their profile, and what our peak hours are for each day. If you guys don't like that idea, ignore the entire bottom half of the main content area.
concept-2-feedback-add-track-sidebar-insert - copy

I'll add more later. Bed time now... zzzzzzzz

Toggle Video Button none responsive #Bug

Line 580: if (parseInt($('#messages').css('height')) != 230) { doesn't seem to evaluate correctly on my machine (chrome/OSX).

The button is non responsive when I try and use it.

Notes:
When I change the if statement from above to this:
if (parseInt($('#messages').css('height')) == 230) { the statement evaluates and my video toggles off and I have a full chat screen. This however breaks the else statement and I can't toggle the video back in.

I am pretty sure I can fix the logic of this statement though I'm unsure as to how it broke in the first place.

Hosting

I'd like to get a dedicated box for soundtrack.io. I'll be doing this regardless, but I'd like to see what resources people have.

Requirements mainly are Linux. Ideally, the hosting would be outside of the US.

Domain as a Resource

I'd like soundtrack.io to be viewed as a resource (as in the Uniform Resource Identifier), almost like a "device" on the network. This means exposing various services via protocols that make sense and are predictable and semantic.

For example, http://soundtrack.io currently serves a hypertext copy of the soundtrack.io service, and ws://soundtrack.io/stream [1] serves the websocket stream of the service events. Similarly, irc://soundtrack.io would connect to the chat and perhaps eventually rtsp://soundtrack.io would connect to the raw media stream.

We'll use this issue to keep track of an index of supported protocols and services available on soundtrack.io.

[1]: as part of the "semantic" discussion, this really should be simply ws://soundtrack.io (without /stream) to subscribe to all events, and any additional filter should be appended as a path.

Federated servers

Federation

soundtrack.io would benefit from federated servers. In the context of federation, each server maintains an internal message queue and is referred to as a broker. Brokers can discover each other and join a federation. The network must support

Discovery

Servers will need the ability to discover one another. This will require at least 1 central peer that can provide other nodes. Each server is responsible for maintaining a list of the servers it is responsible to.

Chat

Each server is responsible for it's own channel. Server name requirements are TBD. Additionally, there will be an optional global chat, or lobby, that allows users to broadcast messages to all connected users in the federation.

Implementation

The federation is represented as a directed acyclic graph. Each broker can have at most 1 parent broker, and any number of children brokers. When links are established between brokers, a dialback is required to establish the identity of the server.

When a message is generated on a server, it is broadcast to its parent and all of its children, which is replicated across the network until all nodes have been visited.

Network splits

In the event of a network partition, all users that are no longer members of a brokers federation will be removed from the list of active users. After partition recovery they will rejoin the list of active users.

UTF in URLs

Currently, an artist with a UTF name (かな for example) has their name run through the slug engine, which results in a completely empty URL, making their name unlinkable.

This should be fixed in yields/slug as a parameter to enable UTF characters in slugs.

Error on visit

I've seen the following error page twice upon visiting with old cookies. Deleting my cookies fixes the problem.

TypeError: /root/soundtrack.io/views/index.jade:113
    111|               for playlist in playlists
    112|                 li(data-playlist-id="#{playlist._id}")
  > 113|                   a(href="/#{user.slug}/#{playlist.slug}")
    114|                     small.pull-right #{playlist._tracks.length}
    115|                     input(type="checkbox", data-action="toggle-playlist-visibility", data-playlist-id="#{playlist._id}", checked=(playlist.public ? "checked" : undefined))
    116|                     |  #{playlist.name}

Cannot read property 'slug' of undefined
    at eval (eval at <anonymous> (/root/soundtrack.io/node_modules/jade/lib/jade.js:164:8))
    at eval (eval at <anonymous> (/root/soundtrack.io/node_modules/jade/lib/jade.js:164:8))
    at exports.compile (/root/soundtrack.io/node_modules/jade/lib/jade.js:165:35)
    at Object.exports.render (/root/soundtrack.io/node_modules/jade/lib/jade.js:199:14)
    at View.exports.renderFile [as engine] (/root/soundtrack.io/node_modules/jade/lib/jade.js:226:13)
    at View.render (/root/soundtrack.io/node_modules/express/lib/view.js:76:8)
    at Function.app.render (/root/soundtrack.io/node_modules/express/lib/application.js:505:10)
    at ServerResponse.res.render (/root/soundtrack.io/node_modules/express/lib/response.js:756:7)
    at Promise.<anonymous> (/root/soundtrack.io/controllers/pages.js:9:13)
    at Promise.onResolve (/root/soundtrack.io/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)

Intro #5 obscured

Mac 10.7 Chrome 28.0.1500.71

I think the dialog should be to the left of the div.

screen shot 2013-07-18 at 8 09 10 am

Responsive UI

We should make sure that the soundtrack.io site looks good on all display sizes.

Chat only mode (new feature suggestion)

Often I want to keep chat open and turn off music or play something different. But muting and hiding video don't save any system resources (CPU over 50% on my old system). It would be nice if there were a chat only mode where no video or audio is involved.

Failed to parse JSON body on start

Hi,

Trying to install/configure on Ubuntu and getting the error as below when starting nodejs server. Any ideas? See below:

[TypeError: Failed to parse JSON body: Cannot call method 'toObject' of undefined]

/home/owen/owen/soundtrack.io/soundtrack.js:368
backupTracks.push( track.toObject() );
^
TypeError: Cannot call method 'toObject' of undefined
at /home/owen/owen/soundtrack.io/soundtrack.js:368:36

User is logged in as wrong user

Sometimes when a page is reloaded the currently logged in user will be incorrect and appear as another user.

The current hypothesis is that this is related to server restarts.

Note: This does not appear to affect the user's privileges. My playlists are still mine even when I am displayed as another user.

Vizualizations

For tracks that don't have an accompanying video (or for users who don't want to have accompanying videos), it'd be nice to have some sort of visualization of the music that is playing.

Multiple Stations / Rooms

We need to break the soundtrack.io app out into multiple rooms, so communities of different tastes can use the service as well.

IDEA: Alert on skip track

Would be nice to have an alert when skip button is pressed. You know, for those "oops" moments.

Are you sure?

Branch Cleanup

Right now there are a bunch of branches (most of which have been merged into Master). Keeping things clean would make it easier for people getting started in the repo.

Track Flow Control Dependent on Track Insertion Time

Currently, controlling the order of tracks (say, to follow the currently playing track with another that provides a smooth transition) is controlled first by the number of votes (+1, 0, or -1), while ties are resolved by preferring the track that has been waiting to play for the longest amount of time.

Opening this issue so alternative methods can be proposed.

IDEA: Inherent afk timer to show active/inactive users

Just an idea, not sure how anyone else feels about it. Thoughts and discussion are welcome here.

My idea consists of adding a timer based off chat entries that would show who is active or inactive in the user list. Possibly have users fade out of user list if they are inactive for a period of time.

Sets & Playlists

Goals:

  • improved playlist / set management UX
  • import playlists from YouTube
  • export playlists to YouTube
  • synchronize playlists with YouTube
  • import playlists from plug.dj
  • export playlists to plug.dj
  • synchronize playlists with plug.dj
  • import playlists from Spotify
  • export playlists to Spotify
  • synchronize playlists with Spotify
  • import playlists from SoundCloud
  • export playlists to SoundCloud
  • synchronize playlists with SoundCloud

Original request, "Import youtube playlists into s.io playlists.":
Just wanted to get the discussion going on this feature. Obviously it would be sick to have playlists sync with your youtube account, but I dunno the limitations of the youtube API.

I'd be content with just importing from youtube. Personally I try to keep my music added to playlists on youtube so Google has data on what my tastes are, and can increase the intelligence of suggested songs.

So--- is this theoretically possible with the current Youtube API?

Refactoring / Plugin architecture?

Just thinking outloud here... Would @martindale be open to if I played around with refactoring the app a bit? soundtrack.js is starting to become a really long file. Would it be worth exploring breaking it out into little modules? (For example, last.fm would be a plugin...)

This could make extending it easier going forward as well.

This is more of a question / start the discussion than any particular idea on how we do it.

Single Sources Array

Currently, the "sources" property of a track is a map of the sources:

track = {
  [...],
  sources: {
    youtube: [ { id: 'dVy...' }, [...] ],
    soundcloud: [ { id: 125... }, [...] ]
  }
}

It should instead be a flat array, ordered by quality / reliability / preference:

track = {
  [...],
  sources: [
    { type: 'video/youtube', id: 'dVy...',  uri: 'http://s.youtube.com/v/dVy...' },
    { type: 'video/youtube', id: 'xQr...',  uri: 'http://s.youtube.com/v/xQr...' },
    { type: 'audio/mp3', id: 125...,  uri: 'http://stream.soundcloud.com/125...' },
    { type: 'audio/mp3', uri: 'http://someserver.io/remote-file.mp3' }
  ]
}

Permissions

When someone creates a room, they should have control over how it works; "all queue" might not work for everyone (especially larger communities), so perhaps a room can be set to "DJ Queue Only", and specific users can be added to the list.

Kick / mute [prevent someone from taking action in a room] permissions should also be provided.

  • listener (all)
  • DJ (per room)
  • moderator (per room)
  • supermoderator (all rooms)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.