Bandcamp/Soundcloud

User avatar
Sgt. Crackpot
F.U.B.A.R
Posts: 9104
Joined: Wed July 03, 2013 11:21 pm
Twitter: RobertDowneyJr
Location: Lft Craquepeau
Contact:

Re: Bandcamp/Soundcloud

Post by Sgt. Crackpot »

This might be the way to embed a Bandcamp song just via the track ID.

BBCODE USAGE:

Code: Select all

[bandcamp]{NUMBER}[/bandcamp]
BBCODE EXAMPLE:

Code: Select all

[bandcamp]TrackID#[/bandcamp]
HTML REPLACEMENT:

Code: Select all

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100" ><param name="movie" value="http://bandcamp.com/EmbeddedPlayer.swf/track={NUMBER}/size=venti/bgcol=FFFFFF/linkcol=4285BB/" /><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="always" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#FFFFFF" /><embed src="http://bandcamp.com/EmbeddedPlayer.swf/track={NUMBER}/size=venti/bgcol=FFFFFF/linkcol=4285BB/" width="400" height="100" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality=high allowScriptAccess=never allowNetworking=always wmode=transparent bgcolor=#FFFFFF></embed></object>
Rangi Guy wrote:So skating back to the train station after work today things went wrong.....now my skateboard is at the bottom of the harbour :(
User avatar
Heathen
Rank This Poster
Posts: 3988
Joined: Wed January 30, 2013 4:30 pm

Re: Bandcamp/Soundcloud

Post by Heathen »

cutuphalfdead wrote:
Heathen wrote:
cutuphalfdead wrote:What if it was set up similar to the URL code so it's something like [bandcamp=ALBUMID]track number[\bandcamp]?

It would at least be a syntax that's somewhat familiar to codes we already use.
I don't know how that would work when you're embedding the full set (meaning there's no track number). We'd have to be able to write a code that does "if there's a track number use the code for the track player otherwise use the code for the album player", and while this is easily doable in general I'm not certain the custom BBcode feature of the board allows it.

Or did you mean having this code as a separate BBcode for embedding tracks?
The if/then statement regarding the track is ideal, but is it the end of the world having 2 codes?

[BCalbum]ID[/BCalbum]
[BCtrack=track#]albumid[/BCtrack]
No it's no big deal, just not very user-friendly and intuitive. But I don't think we'll have a better option anyway. It's up to the admins now.

@Sarge, that looks like an older version of bc's html code. It looks like this now:

Code: Select all

<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/album=ALBUM_ID/size=medium/bgcol=ffffff/linkcol=0687f5/t=TRACK_NUMBER/transparent=true/" seamless><a href="http://immunerecordings.bandcamp.com/album/with-endless-fire">With Endless Fire by Ilyas Ahmed</a></iframe>
Similar to the album code but with that extra 't=track_number' in the URL. Actually, bandcamp is really fucking with us as there are two different codes for embedding a track ( :| ) depending on whether you're embedding a track that's part of an album (in this case it's what I posted above) or whether it's a single track that exists on its own, in which case it's:

Code: Select all

<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/track=412663488/size=medium/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless><a href="http://footracks.bandcamp.com/track/2-5-1-backing-track-in-c-180-bpm">2-5-1 backing track in C - 180 BPM by Foo Tracks</a></iframe>
They're not making this easy. I think I'm going to ask them if there's a way to embed just from the URL like soundcloud does.
E.H. Ruddock wrote:Just be patient.
:hooray:
cutuphalfdead wrote:so glad i don't see signatures
User avatar
Heathen
Rank This Poster
Posts: 3988
Joined: Wed January 30, 2013 4:30 pm

Re: Bandcamp/Soundcloud

Post by Heathen »

Alternatively, I think there might be a better way to do this that only uses one bbcode for every case while making it much easier/intuitive for the user. I don't have the time to go into details right now but basically instead of using the bandcamp iframe directly, we'd use an iframe that points to a script hosted on tsis.com.

Something like that:

Code: Select all

[bc]{TEXT}[/bc]
html replacement

Code: Select all

<iframe style="border: 0; width: 100%; height: 120px;" src="http://www.theskyiscrape.com/bandcamp.php?string={TEXT}"></iframe>
That script would receive the text typed by the poster within the bbcode and sort it all out with PHP programming. If the parameter is just a number, you display the album player code, if it's a string with both album and track, use the corresponding code, etc.

This would be both the easiest and the most elegant. I'll try to clarify later if it doesn't make sense.
cutuphalfdead wrote:so glad i don't see signatures
User avatar
Heathen
Rank This Poster
Posts: 3988
Joined: Wed January 30, 2013 4:30 pm

Re: Bandcamp/Soundcloud

Post by Heathen »

Heathen wrote:Alternatively, I think there might be a better way to do this that only uses one bbcode for every case while making it much easier/intuitive for the user. I don't have the time to go into details right now but basically instead of using the bandcamp iframe directly, we'd use an iframe that points to a script hosted on tsis.com.
So I made a quick example of how this would work:

http://tsisbctest.byethost33.com/bc_player.php

Go to any bandcamp page, doesn't matter if it's an album, a specific track off an album or an standalone track, click on embed/share, pick any player, select either the wordpress or html code and paste it into the form field. It will display a medium-sized player regardless of which size you chose, thought it was easier that way. It also works if you just use the album ID.

So what the TSIS admins would have to do is upload that kind of script on the server (I've put the code source below, feel free to use it or to make your own version) and then have a new custom BBcode that would look like this:

BBCODE

Code: Select all

[bc]{TEXT}[/bc]
HTML REPLACEMENT

Code: Select all

<iframe style="border: 0; width: 100%; height: 120px;" src="_PATH_TO_THE_SCRIPT_ON_THESKYISCRAPE?bc_string={TEXT}" seamless></iframe>
Script source:
Spoiler: show

Code: Select all

<?php

if (preg_match('#^[0-9]+$#', $_GET['bc_string'])) { // if parameter is just a number, use it as album ID

	echo '<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/album='.$_GET['bc_string'].'/size=medium/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless></iframe>';
	
}

elseif (preg_match('#track=([0-9]+)\D#', $_GET['bc_string'], $track)) { // if a track ID is included, use the standalone track player
	echo '<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/track='.$track[1].'/size=medium/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless></iframe>';
	
}

elseif (preg_match('#album=([0-9]+)\D#', $_GET['bc_string'], $album)) { // if album ID is included

	if(preg_match('#[ /]t=([0-9]+)\D#', $_GET['bc_string'], $track)) { // if a track number is included, play that track
		echo '<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/album='.$album[1].'/size=medium/bgcol=ffffff/linkcol=0687f5/t='.$track[1].'/transparent=true/" seamless></iframe>';
	}

	else {  // otherwise use the standard full album player
		echo '<iframe style="border: 0; width: 100%; height: 120px;" src="http://bandcamp.com/EmbeddedPlayer/album='.$album[1].'/size=medium/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless></iframe>';
	}	
}
?>
That *should* work

The evenbetterest way though would be to just use the URL of the track/album you want to embed and have the script make a request via the Bandcamp API and get the corresponding album/track ID. But they're not handing out any more developer keys for now and you can't use the API without one.
cutuphalfdead wrote:so glad i don't see signatures
User avatar
Sgt. Crackpot
F.U.B.A.R
Posts: 9104
Joined: Wed July 03, 2013 11:21 pm
Twitter: RobertDowneyJr
Location: Lft Craquepeau
Contact:

Re: Bandcamp/Soundcloud

Post by Sgt. Crackpot »

Rangi Guy wrote:So skating back to the train station after work today things went wrong.....now my skateboard is at the bottom of the harbour :(
User avatar
Sgt. Crackpot
F.U.B.A.R
Posts: 9104
Joined: Wed July 03, 2013 11:21 pm
Twitter: RobertDowneyJr
Location: Lft Craquepeau
Contact:

Re: Bandcamp/Soundcloud

Post by Sgt. Crackpot »

Rangi Guy wrote:So skating back to the train station after work today things went wrong.....now my skateboard is at the bottom of the harbour :(
User avatar
LoathedVermin72
The Master
Posts: 33834
Joined: Sun May 25, 2014 9:32 pm

Re: Bandcamp/Soundcloud

Post by LoathedVermin72 »

Does anyone know of any still-operating, trustworthy sites that convert SoundCloud links to MP3s? All the ones I used to use seem to be defunct now.
User avatar
tragabigzanda
Production Police
Posts: 51634
Joined: Tue September 24, 2013 5:56 pm

Re: Bandcamp/Soundcloud

Post by tragabigzanda »

Naomi Klein wrote:"Clout is the values-free currency of the always-online age — both a substitute for hard cash as well as a conduit to it. Clout is a calculus not of what you do, but of how much bulk you-ness there is in the world. You get clout by playing the victim. You get clout by victimizing others. This is something that is understood by the left and the right. If influence sways, clout squats, taking up space for its own sake."
Last edited by tragabigzanda on Sun January 11, 2026 7:23 pm, edited 2 times in total.
User avatar
LoathedVermin72
The Master
Posts: 33834
Joined: Sun May 25, 2014 9:32 pm

Re: Bandcamp/Soundcloud

Post by LoathedVermin72 »

tragabigzanda wrote:
LoathedVermin72 wrote:Does anyone know of any still-operating, trustworthy sites that convert SoundCloud links to MP3s? All the ones I used to use seem to be defunct now.
I don't know of any sites, but if you're on a Mac, Black Hole is a free program that would let you route the audio from the site into Garageband or Audacity.
Recording my computer's audio never even occurred to me. Duh! Thank you!
Post Reply