SoundCloud integration: add all tracks from a SoundCloud playlist
Opened this issue · 11 comments
As outlined on romainchalut#34, I'm thinking how to use MT5 to coordinate learning resources for a choir.
In our case, everything is stored on SoundCloud. I'd like MT5 to be able to interact with what we have on SoundCloud.
To start with:
The ability to add all tracks from a SoundCloud playlist into the player.
E.g. https://soundcloud.com/newchoir/sets/with-a-little-help
Why:
- Our recorded tracks are on SoundCloud, (in some cases stored across multiple accounts.)
- Any given song has 4-8 parts. e.g. Soprano (1,2), Alto (1,2), Tenor (1,2), Baritone, Bass.
- Any given song has many resources, e.g. a sung tracks, piano tracks, coaching tracks. I built a piece of software that uses the names of the song, part to place related tracks into soundcloud playlists. We embed SoundCloud playlists those into a wiki so to present lyrics, notes, alongside the tracks.
I should give you a sense of scale. We have 1600 tracks for our repertoire of 30 songs this year. We have 160 people in the choir singing 4-8 parts. Each song is distributed with a sung training track for each part. We rehearse every week for 2 hours and record all rehearsals, splitting the recorded tracks into new tracks relevant to the parts.
1600+ tracks is a lot of hours, a lot of data. We have them in the cloud as they would swamp our server!
Thanks,
Martin.
Ok, so you would like a way to play soundcloud files directly. Hmmm this seems possible. MT5 V2 (still not public) has metadata for song structure / parts, possibility to jump directly to any part, loop on a part, define parts directly from the user interface, etc. I looked at the example song you provided ans yes, that seems to be definitely a good idea. I will look to a way to do that this week or the next. I keep you informed.
After a quick look, it appears that soundcloud is a bit like youtube, you cannot download easily the songs. You can stream them, or embed them in your web site, or write your own player using the soundcloud SDK, but getting the file itself, or its content for playing in your own player using we audio (MT5 uses web audio + samples in memory in order to loop, etc.), then you need to first download the songs then save them in MT5 server's directories. It haven't found a way to get the song files with Ajax through their SDK. So what you can do is use of the many soundcloud downloaders available, get the files, and put the files on the MT5 server.
I will keep investigating...
https://developers.soundcloud.com/docs/api/reference#tracks
Attribute "download_url", if of course the public download flag has been
set by the author.
:)
2015-03-09 0:41 GMT+01:00 micbuffa notifications@github.com:
After a quick look, it appears that soundcloud is a bit like youtube, you
cannot download easily the songs. You can stream them, or embed them in
your web site, or write your own player using the soundcloud SDK, but
getting the file itself, or its content for playing in your own player
using we audio (MT5 uses web audio + samples in memory in order to loop,
etc.), then you need to first download the songs then save them in MT5
server's directories. It haven't found a way to get the song files with
Ajax through their SDK. So what you can do is use of the many soundcloud
downloaders available, get the files, and put the files on the MT5 server.I will keep investigating...
—
Reply to this email directly or view it on GitHub
#5 (comment).
Our intent is to always have our songs downloadable.
Thanks, M.
Ok, here is a small jsbin.com example that plays a public soundcloud track, how can I get the corresponding URLs for your tracks ? I cannot find it (I'm not familiar with soundcloud).
In the jsbin, the URL is something like: http://api.soundcloud.com/tracks/6981096/stream' +
'?client_id=YOUR_CLIENT_ID';
Apparently for a public track the client_id is not important, but the track id is (6981096) here.
Also, if I read the documentation, in order to get the downloadable_url for a song, I also need this id:
curl "http://api.soundcloud.com/tracks/13158665.json?client_id=YOUR_CLIENT_ID", I guess that here the 131.... value is the track id.
Just tell me how to get this id, for example for the tracks of your song: https://soundcloud.com/newchoir/sets/with-a-little-help, and I think it's gonna be easy.
What I imagine : instead of using the current menu, propose an option to load soundcloud songs. Then what would you like? Enter your client ID and browse all your songs (public or private), or being able to play any tacks of any public song (in that case the best thing would be to enter directly something like https://soundcloud.com/newchoir/sets/with-a-little-help and the API will give the list of tracks, then the ids of each track, then I can get all the downloadable_url).
I need to get all the URLs for downloading the tracks in Ajax
Client ID identifies your developer account at SoundCloud. So, anyone using your code would need to either create their own developer account & client id or use your client id.
Yes, that 131... is the track id.
Note that we want to load a set (playlist) of tracks, not from a single track. These are the different voices of the same song.
https://developers.soundcloud.com/docs/api/reference#playlists
A playlist == set.
E.g. these are our sets: https://soundcloud.com/newchoir/sets
We also have a set of playlists that we build using a set of scripts: https://soundcloud.com/newchoir_playlists/sets
e.g. : http://soundcloud.com/newchoir_playlists/sets/y10-with-a-little-help-choir which is
https://api.soundcloud.com/playlists/58126254
https://developers.soundcloud.com/docs/api/reference#resolve looks like it will take a playlist URL to get you a playlist id. (Usually I interface via the Ruby so this is an assumption).
What I imagine : instead of using the current menu, propose an option to load soundcloud songs. Then what would you like? Enter your client ID
- No, I think I would embed that in config, so the user does not need to be bothered with that.
- I would either embed the user owning the playlists, and allow the user to pick the playlist, or directly supply the playlist url.
and browse all your songs (public or private), or being able to play any tracks of any public song
Note that SoundCloud does not know how we do multiple tracks for the same song. Playlists are assumed to be played sequentially, not at the same time, which is why we are excited about MT5.
(in that case the best thing would be to enter directly something like https://soundcloud.com/newchoir/sets/with-a-little-help and the API will give the list of tracks, then the ids of each track, then I can get all the downloadable_url).
Looks good.
Does that help? Thanks. M.
Hello Michel, I just found your MT5 player for using HTML5 to simultaneously play and mute multiple audio tracks. I am a Web developer and I thought that I might have a use for it. I want to develop a Web application that is useful for singers. Many songs have different parts that are sung by different voice types (soprano, alto, tenor, bass, etc.). I want my app to help teach a song to singers so they can learn the part of the song that is created for their voice type. A tenor would learn the tenor part, the soprano would learn the soprano part, etc. But using MT5 they could hear all of the other parts and how the song comes together in perfect harmony. They could adjust or mute the volume on the other tracks as they learn the part for their own voice type.
Before I get started on such a project, I thought I would contact you and ask if you could point me in the right direction. My vision is just to show the various tracks on the screen (hopefully a mobile-friendly responsive site in the Bootstrap framework) by voice type, with a range volume slider next to each track. The left extreme is Mute and the right extreme is full volume, like this:
EXAMPLE:
[^----------] Bass
[^----------] Tenor
[----------^] Alto
[---^-------] Soprano
Above, the Bass and the Tenor would be muted. The Alto is at full volume. The Soprano is audible but less than full volume.
This is a crude example that I am merely describing in text. For the volume, in actual practice I would use the browser's built-in HTML5 control for a range (using the browser's built-in control would hopefully offer better performance than a custom-designed simulated range slider).
Can you recommend anything for me to get started? Is there a quick template that I can follow which doesn't require the full sound-display in your demo? Should I dual-encode all my source files in both patent-laden formats (MP3) and open source formats (OGG vorbis)?
Thank you in advance for your reply. If it's helpful, I would gladly donate to the project to compensate for any help you might provide. Have a nice day!
Hey @jasonmcneill - I used MT5 to help learn the web audio api and I created https://github.com/kmattimo/multitrack for that same purpose- a practice tool for multi-part songs. MT5 was pretty complex and feature- filled so I took the route of studying it and selectively poaching code rather than forking it. I'd be happy to collaborate if it's more like what you're looking for.
@kmattimo - That is exactly what I had in mind! Thank you!
MT5 uses Web Audio so providing audio source files in different formats is
complicated. I'd go for mp3 as this format is supported on all browsers
now. About templates, the GUI code is simple while not very clear. You can
give a loot at the view.js file, it has a small function that renders the
code specific to each track (mute, slider etc.). This is the only really
specific code you need to change. Also, if you don't need the "waveform"
view, then remove the canvas from the index.html. All waveforms are drawn
into a single canvas. You will have to look also in sound.js and remove all
the code that calls the waveform drawer for drawing in this canvas.
I'm glad you find this useful. Please keep me informed if you do anything
interesting with MT5 :-)
Michel
Can you recommend anything for me to get started? Is there a quick
template that I can follow which doesn't require the full sound-display in
your demo? Should I dual-encode all my source files in both patent-laden
formats (MP3) and open source formats (OGG vorbis)?Thank you in advance for your reply. If it's helpful, I would gladly
donate to the project to compensate for any help you might provide. Have a
nice day!
Le mer. 18 mai 2016 à 08:55, Jason McNeill notifications@github.com a
écrit :
@kmattimo https://github.com/kmattimo - That is exactly what I had in
mind! Thank you!—
You are receiving this because you commented.Reply to this email directly or view it on GitHub
#5 (comment)
Ah I just found your demo + github. Well done! Looks nice!
Le mer. 18 mai 2016 à 09:17, michel buffa micbuffa@gmail.com a écrit :
MT5 uses Web Audio so providing audio source files in different formats is
complicated. I'd go for mp3 as this format is supported on all browsers
now. About templates, the GUI code is simple while not very clear. You can
give a loot at the view.js file, it has a small function that renders the
code specific to each track (mute, slider etc.). This is the only really
specific code you need to change. Also, if you don't need the "waveform"
view, then remove the canvas from the index.html. All waveforms are drawn
into a single canvas. You will have to look also in sound.js and remove all
the code that calls the waveform drawer for drawing in this canvas.I'm glad you find this useful. Please keep me informed if you do anything
interesting with MT5 :-)Michel
Can you recommend anything for me to get started? Is there a quick
template that I can follow which doesn't require the full sound-display in
your demo? Should I dual-encode all my source files in both patent-laden
formats (MP3) and open source formats (OGG vorbis)?Thank you in advance for your reply. If it's helpful, I would gladly
donate to the project to compensate for any help you might provide. Have a
nice day!Le mer. 18 mai 2016 à 08:55, Jason McNeill notifications@github.com a
écrit :@kmattimo https://github.com/kmattimo - That is exactly what I had in
mind! Thank you!—
You are receiving this because you commented.Reply to this email directly or view it on GitHub
#5 (comment)