GithubHelp home page GithubHelp logo

infinitej's Introduction

InfiniteJ

InfiniteJukebox version on student server. Credits and Copyright to Paul Lamere (original creator of InfiniteJukebox)

Problem

InfiniteJukebox sparks a lot of conversations and ideas in the field of Music Informatics. Therefore, I want to investigate on how to make Infinite Jukebox on student server so it become accessible to other users in the community to apply and alter it for their own research project.

Process

InfiniteJ's users either play songs that already exists in the suggesting database or upload any songs that the users want. InfiniteJ would put the uploaded song in the storage directory in student server while changing it's name then call Echonest for audio analysis request to output the visualization of beat similarity and a music box that play a song infinitely and everchaningly. It break the song into beats and play the song beat by beat. At every beat there's a chance that it will jump to a different part of song that happens to sound very similar to the current beat.

Dependencies

To use InfiniteJ, you will need:

  • Your Echonest's API_KEY for policy file
  • Your own directory for uploading song and update it in upload.php
  • Update the link directing to your directory in index, upload, and loader file

The user can use the command below to download necessary file for the InfiniteJ to run independently:

wget url . 

Code Explanation

After making an upload.php and a directory to keep all the files for audio analysing works, Dr. Parry advised me to insert these following lines of code in upload.php in order for loader.html to call Echonest for audio analysing works for all uploading files from the user:

$url = $_POST["success_action_redirect"].'?bucket=student.cs.appstate.edu/~tuhq/infiniteJ&key='.urlencode($_POST["key"]);
echo $url. "<br />";
echo $_POST["success_action_redirect"];

The audio analysing works are called in loader.html in:

<input type="hidden" name="success_action_redirect" value= "http://student.cs.appstate.edu/~tuhq/infiniteJ/index.html">

Looking at the code for the InfiniteJukebox at the moment, the option of uploading the song would puts the song in the amazon web services and then call Echonest for the analysis of the song. However, we need to change the storing option to the local folder on the student server. For instance:

<form action="https://s3.amazonaws.com/static.echonest.com" method="post" enctype="multipart/form-data">
	<input id='f-key' type="hidden" name="AWSAccessKeyId" value="YOUR_AWS_ACCESS_KEY">
	<input type="hidden" name="success_action_redirect" value="http://labs.echonest.com/Uploader/index.html">
	<input id='f-policy' type="hidden" name="policy" value="YOUR_POLICY_DOCUMENT_BASE64_ENCODED">
	<input id='f-signature' type="hidden" name="signature" value="YOUR_CALCULATED_SIGNATURE"> 

The code makes a form to Amazon web services with AWSAccessKeyId and other variables that are not in my possession. Therefore, it would be updated with my own upload form in php to upload mp3 and storage space directing to my directory for mp3 file to:

<form enctype="multipart/form-data" action="upload.php" method="POST">
	<input type="hidden" name="success_action_redirect" value= "http://student.cs.appstate.edu/~tuhq/infiniteJ/index.html">

Moreover, I updated the Echonest's API_KEY to my Echonest's API_KEY instead of abusing their API_Key. I called fetchSignature() as a first thing in init() function to fetch in the API_KEY before analyzeAudio get called so Echonest can look at the file. However, there was a problem initially with fetchSignature() fetching the signature slower due to one of the aspects of .getJSON so analyzeAudio ran before API_KEY got fetched to my API_KEY so I updated fetchSignature() function by using the function .ajax instead that force fetchSignature to fetch my API_KEY variable first before doing anything else. (jQuery) Specifically:

$.getJSON(url, {}, function(data) {

is updated to

$.ajax({url:url , dataType:'json', async : false, data:{}, success:function(data)

Moreover, the directory is missing the javascript file Underscore so "_" is treated as undefined variable. Therefore, I downloaded the file from Underscore and put it in my directory while call it in index.html

<script src="underscore.js" type="text/javascript"></script>

infinitej's People

Contributors

mugetsu7 avatar

Watchers

 avatar  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.