Giter Club home page Giter Club logo

musicmood.me's Introduction

MusicMood

Music Mood Build Status Coverage Status

How to relate your daily songs to how you feel?

We have always used several resources to identify and share our feelings. That need to share this information to feel part of something, to build connections and enter the whole.

In order to do so, we have to identify our own patterns, our day-to-day actions. How we walk, what we say, what we listen to everyday; in order to understand how we are feeling.

Whenever we make a choice, regarding music, we are creating an statement: when we choose the playlist or the artist of the day, when we listen to something anonymously or even when we decide not to listen to anything. And it is a two way street. The way we feel affects what we choose to listen and vice versa.

As in all forms of representation, we believe that when the music unveils the feeling, it is supposed to emphasize the object in matter: How do you feel? So here comes our idea of highlighting the relation between music and moods. And how to translate that into the world.

If you are looking for our API, head to API

Installing

First, you need to create a config.json file in the root of the node folder and fill with the keys and secrets.

{
    "echonestApiKey": "",
    "lastFmApiKey": "",
    "lastFmApiSecret": "",
    "spotifyClientId": "",
    "spotifyClientSecret":"",
    "spotifyRedirectUri":"",
    "analyticsKey": ""
}

Notice: analyticsKey is optional. If you do not intend to use analytics, skip this key.

You can get the keys here here and here.

For development, we recomend Vagrant and VirtualBox.

After, go to the project folder and run:

~$ vagrant up

And wait for the machine to boot up, and run:

~$ vagrant ssh

Now, inside the machine, go to /vagrant (this is the project root shared folder) and run (sorry, but this may take some time, many heavy libs):

~$ cd /vagrant && sudo sh setup.sh

If god is with you and everything works, this will install and configure all the packages you need to run this repo. If you ran into any problem, feel free to send a pull request or open an issue. You can look the source of setup.sh to adapt it to your system (if you are not using vagrant).

If you do not run on vagrant, you may need to configure these lines on node/lib/tools.js

if (os.hostname() === 'vagrant-ubuntu-trusty-64') {
    // localhost inside vagrant
    socket_server = 'http://localhost';
} else {
    // vagrant private IP
    socket_server = 'http://192.168.33.10';
}

Building

The static files are processed with Grunt, so run:

~$ npm install grunt -g

And, after grunt is installed, go to node/public and run:

~$ npm install
~$ grunt

To generate the build folder. More info here

Running

You have three interfaces to run (as you wish):

The Extractor (node/extractor.js)

This is responsible for processing all song requests, extract all the data from the files and send it to the websocket.

Once connected to the socket, you have 2 options:

Consume the websocket and get mood information about your current song on last.fm

Or, if you have a hardware setup:

Consume the websocket and get the buffer to integrate with your hardware installation

The Processor (node/processor.js)

This is just an example of the websocket connection and use of the data sent over it. You can adapt as your needs. Just a warning: it checks for a serial port, because it is hunger for LEDs :)

The Web Interface (node/app.js)

This little guy will give you a web interface (as seen here) to try and experiment our mood tool. To use as a real-time visualization, head to login and create at least one account (the log will show up on extractor.js)

We have some commented lines on app.js, so you can take a look at a little admin panel to manage the last.fm users (just uncomment).

So, you just need to (processor.js and app.js only if you need to):

~$ node node/extractor.js
~$ node node/processor.js
~$ node node/app.js

API

If you just need to use the moods, and do not want to get your hands dirty, we have an API just for you. Just make a GET request to (we made it GET to help on crossdomain problems):

GET http://api.musicmood.me/mood/{artist}/{song}/

Remember: {artist} and {song} need to be URI Encoded. Here is a sample javascript request using jQuery:

$.ajax({
    url: "http://api.musicmood.me/mood/" + encodeURIComponent("Linkin Park") + "/" + encodeURIComponent("In The End") + "/",
    sucess: function(data) {
        console.log(data);
    }
});

Hardware

Soon (how to and what we have done here at d3.do)

TODO

  • Create a TODO list

musicmood.me's People

Contributors

chr0nu5 avatar juniormag avatar heyvito avatar

Watchers

Subhash Ramesh avatar

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.