Online Pharmacy

online viagra buy generic cialis in brisbane identify cialis Viagra without Perscription cialis buy online viagra lawyers Discount viagra cialis overnight Viagra Propecia low cost viagra where can one buy cialis cialis order from us buy cialis generic what is the price of viagra buy viagra in uk buy cheap cialis generic levitra viagra viagra pharmacy buy cialis in canada Discount Pfizer Viagra cheap generic viagra buy cheap cialis online Cheapest Viagra Price buy viagra mastercard viagra cialis levitra cialis commercial Buy Onlinecom Phentermine Viagra cheapest place to buy viagra online viagra pill cialis buy without prescription buy viagra no prescription buy cialis now top internet cialis web sites cialis mastercard buy cheap cialis in australia order cialis now Viagra Faq visa viagra viagra mastercard female viagra Viagra Tablet mastercard buy viagra cialis pro buy online viagra how does cialis work venta de cialis viagra cialis buy generic cialis from india Viagra Facts about viagra Cialis Viagra Online buy tadalafil cialis best price viagra buy cialis generic online Buy Viagra Now Online buy cheap cialis ipharmacy is cialis better than viagra No Prescription Viagra where to buy cialis where can i buy viagra from Viagra Pushups cialis soft tabs buy low price viagra where to buy viagra cialis vs. viagra buy cialis australia buy viagra paypal Buy Viagra Onlines best place to buy cialis where buy viagra cialis india sildenafil cialis generico what dose cialis does cialis work what is the generic name for cialis viagra cialis compare cialis levitra viagra buy viagra on line buy cialis paypal In Man Uk Viagra sales cialis buy cheap cialis ciales cialis buy discrete buy generic cialis online cialis women viagra from health store order viagra cialis viagra online buy cialis online viagra cheap price viagra Drug Viagra viagra buy maile order cialis cialis compared to viagra buy cialis online no prescription buy cheap viagra cialis visa Between Difference Levitra Viagra buy cialis visa discount viagra online Cheap Generic India Viagra viagra sale buy viagra where cialis and alcohol order cialis cheap buy cialis american express cialis 10mg cialis small packs cheap viagra uk sell viagra to buy cialis mastercard buy cialis buy canada cialis buy cheap purchase uk viagra viagra low cost mastercard viagra buy viagra visa viagra visa Viagra Alternative buy cialis drug online rx buy cialis cialis experience buy viagra line viagra sale online Very Cheap Viagra natural viagra Deer Viagra where can i buy viagra Viagra Online Shop is levitra better than cialis viagra prescription order viagra viagra for woman order cialis on line cialis generic buy discrete buy cialis soft tabs online chea Viagra Discount low cost cialis viagra best buy order cialis online herbal cialis prescription cialis us pharmacy buy viagra without prescription Cialis Generic Levitra Viagra cialis side effects cialis archive newest Viagra Concerns cialis visa cialis online no presription buying generic cialis buy viagra online cheap buy cialis without prescription buy cialis tablets buy viagra usa american express buy viagra viagra cialis generica what stores sell viagra cialis canada cialis order cialis europe viagra buy generic cialis viagra and cialis cheap discount viagra mastercard cialis buy cialis without a prescription Compare Levitra And Viagra cialis uk cialis sales cialis daily buy viagra Canadas Viagra Commercial buy cialis and viagra viagra mastercard viagra visa side effects of cialis Viagra for Women Cheapest Viagra cialis message board overnight cialis cheap cialis where to buy levitra cialis viagra online generic viagra viagra price buycialisonline liquid cialis Viagra Generika where can i buy cialis online viagra cialis phentermine soma sell viagra online Comparison Viagra Levitra Cialis buy cialis with no prescription cialis professional viagra dosage generic cialis soft online cheapest cialis cialis smile blog buy generic cialis viagra online generic cialis soft cheap generic cialis order cialis cialis mastercard Cialis Compare Levitra Viagra daily cialis buy cialis viagra Cheapest Cheap Viagra buy cialis online now Can Women Take Viagra buy uk viagra order cheap cialis generic cialis india buy cialis cheap Viagra Generic Drug Levitra Viagra paypal buy cialis Viagra Dangers cialis buy next day delivery buy cialis no prescription cialis forum buying cialis best price cialis Buy Viagra Order Viagra cialis for women viagra buy viagra cheap viagra alternatives american express buy cialis cialis to buy new zealand buy cialis line where to buy levitra cialis viagra no prescription paypal buy viagra visa cialis buy cheap generic cialis online cialis pricing Pill Viagra which is better cialis or viagra How Does Viagra Work Cialis Super Viagra buy cialis where cialis thanks blog Viagra Or Cialis buy cialis from icos 3cialis Generic Levitra Viagra generic viagra viagra on line Herbal Viagra Wholesale Generic India Viagra cialis on line Buy Cheap Uk Viagra Compare Cialis Levitra Viagra viagra cialis online buy generic viagra buy cialis online cialis online order viagra canada Cialis Comparison Levitra Viagra cheap viagra usa buy cialis doctor online buy cialis mastercard Levitra Or Viagra viagra online order viagra Buy Line Viagra viagra online order guide soft cialis cialis viagra cheap Soft Tab Viagra Sales Viagra cheap viagra cialis dosage propecia cialis viagra book buy cialis guest jill org site viagra online purchase cialis buy buy viagra online where can i buy cialis cialis mail order cheap viagra online viagra usa viagra buy online cialis confusion buy generic cialis in australian pharmacy where buy cialis visa buy viagra buy viagra online inu purchase viagra cialis clock buy viagra uk buy cialis custom hrt Viagra Sale Uk buycialis viagra cialis generic cialis best price viagra cialis cialis generic Sildenafil Viagra pfizer viagra viagra UK buy discount cialis buy cialis cheap in the uk Viagra Buy Viagra cheap cialis sale online Viagra Womans cialis online buy viagra in the uk viagra generic Viagra Online Purchase viagra for sale viagra generic buy Cialis Levitra Viagra cialis cost buy cialis in singapore visa buy cialis buy viagra now viagra side effects order viagra online Generic Viagra Sale Ciscount Viagra Viagra Com buy cialis on line buy viagra in canada viagra dose viagra soft tabs Viagra Lowest Price Viagra In The Water viagra pills buy viagra american express viagra order cialis daily use buy online order viagra order generic cialis discount cialis Effects Of Viagra where to buy viagra on line cheap sale viagra Viagra Onlines prices cialis Viagra Perscription viagra online ordering cialis for order Cheapest Viagra Prices Online Viagra Sale

:: Archive for the 'Music' Category ::

Playing mp3s with SoundManager 2

Posted on November 23rd, 2008 in Music, Web Development by Greg

My friend Michael Ross is a musician and he sent me an email with a couple of the songs he recorded recently. I asked him if he would like me to put together a simple web page for his songs so that he didn’t have to send out emails with large attachments, and a week or so later we had a new site up and running for him – www.michaelrossmusic.net. He wanted a page that listed the albums, had links to download mp3 songs, and a way for people to listen to the songs without downloading them. I had used SoundManager 2 previously to have mp3s play on a page, so I knew that it would be a good fit.

I wanted to be able to build a simple page with regular links to the mp3 files and for JavaScript to do the magic of making the songs playable in the browser – this post explains how I made it happen. SoundManager 2 is a JavaScript library built on top of Flash – the music plays through Flash (which has much better audio support than browsers), but everything is controlled via JavaScript. I also used Prototype as a framework to build out the functionality.

Here’s what I did:

  1. Created a simple page with links to mp3 files
  2. Added a SoundManager handler so that as soon as it loads it instantiates PagePlayer, a JavaScript class I created
  3. PagePlayer takes a CSS selector as input (and optionally an options object) and identifies all of the links that match the selector – ‘a.mp3Link’ in this case (all links with the class ‘mp3Link’).
  4. For each of the identified links, PagePlayer creates a SoundManager sound object using the link to the mp3, adds a play button just prior to the song link, creates event handlers for the play button and sound object, and stores the song in a hash
  5. The event handlers take care of all of the logic: playing songs, making sure that only a single song is playing, changing the state of the button from play to stop

Here’s a current snapshot of the script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
PagePlayer = Class.create({
	songCount: 0,
	songs: new Hash(),
	nowPlaying: null,
	options: null,
 
	initialize: function(selector, options) {
		this.options = {
			imgPath: 'images/',
			imgPlay: 'control_play.png',
			imgStop: 'control_stop.png',
			mp3LinkTitle: 'Download song'
		};
		Object.extend(this.options, options || {});
		$$(selector).each(this.addSong,this);
	},
 
	addSong: function(mp3Link) {
		mp3Link.title = this.options.mp3LinkTitle;
		var songId = mp3Link.identify();
		var soundObj = soundManager.createSound({
			id: songId,
			url: mp3Link.href,
			onfinish: this.finishHandler.bind(this,songId)
		});
		var controlBtn = new Element('img',{
			src: this.options.imgPath + this.options.imgPlay,
			className: 'audioControl'
		});
		mp3Link.insert({before: controlBtn});
		controlBtn.observe('click', this.toggleHandler.bind(this,songId));
 
		this.songs.set(songId, {
			controlBtn: controlBtn,
			soundObj: soundObj
		});
 
		this.songCount++;
	},
 
	toggleHandler: function(songId) {
		var oldSong = this.nowPlaying;
		var newSong = this.songs.get(songId);
 
		if(oldSong) {
			oldSong.soundObj.stop();
			oldSong.controlBtn.src = this.options.imgPath + this.options.imgPlay;
			if(oldSong === newSong) {
				this.nowPlaying = null;
				return;
			}
		}
 
		newSong.controlBtn.src = this.options.imgPath + this.options.imgStop;
		newSong.soundObj.play();
		this.nowPlaying = newSong;
	},
 
	finishHandler: function() {
		this.nowPlaying.controlBtn.src = this.options.imgPath + this.options.imgPlay;
		this.nowPlaying = null;
	}
});

And on the page it is started up as follows:

1
2
3
4
5
6
7
8
<script src="js/soundmanager2-nodebug-jsmin.js"></script>
<script src="js/pagePlayer.js"></script>
<script>
	soundManager.url = '';
	soundManager.onload = function() {
		new PagePlayer('a.mp3Link');
	};
</script>

It’s not the prettiest code, but it gets the job done in 1.58 KB of code and works at least in recent versions of Firefox, IE, Safari, and Chrome. So, if you need to add some mp3s to a page, check out SoundManager 2 – it’s easy to use, well documented, and super flexible…


Boys on Trial Live – Radio One Chicago

Posted on February 11th, 2006 in Music by Greg

My good friend Michael’s band Boys on Trial played a live set on Radio One in Chicago. Radio One has posted the entire set, and I’ve extracted the first song for your listening pleasure…so take a listen:

Boys on Trial – Coward or Hero

Or go ahead and download the entire set. They’re great.

Digital Music and the Missing Metadata

Posted on July 5th, 2005 in Music, Technology by Greg

I love music, and I love the tools that make it easier and more convenient for me to listen to music. One of the advances that has made music so much more accessible over the past few years has been the advent of mp3s, digital music, and digital music players. I bought a first generation iPod the day they were released for Windows based computers, I’ve since upgraded to a non-Apple mp3 player, and I’ve got a mp3 CD player in my car. While some new technologies can be a burden on their users, digital music technology lets me listen to more music with more choice, and keeps me from listening to the same album over and over in my car due to my own laziness. I’m not a super audiophile, and I tend not to notice the slight degradation of music quality I get from digital music, and what I do notice in inferior sound quality is greatly outweighed by the convenience of it’s portability, searchability, and ease of use. Despite the great conveniences of digital music, there are a couple things that really bother me – they bother more than they should because I think they’re things that wouldn’t be all that hard to fix.

Before I get going on my rant, I should note that my only credentials on this topic are being both a music enthusiast and a computer enthusiast – I don’t know all the details about every digital music file format or player, I just know what I’ve seen in popular applications such as mp3 players, iTunes, and other digital music players…

And then there was silence…

At least there was silence for a couple of seconds. The biggest gripe I have with digital music is that there seems to be no reliable way to control the ‘gap’ between tracks. For many albums or types of music, I don’t particularly care about the gap. For other music, the gap can really take away from the enjoyment. This is most evident is albums where songs blend together with no gaps – this includes albums from The Beatles’ ‘Abbey Road’ to The Red Hot Chili Pepper’s ‘ Blood Sugar Sex Magik’, just about all classical music, and live music recordings. Some applications and mp3 players have settings to let the user control the time between tracks or even the cross-fade between tracks. This really isn’t enough, as the time between tracks changes from track to track. Sometimes I need no space between tracks, sometimes I need the standard 2 seconds, and sometimes I need more. The key is that this is all dependent on the album and how it was meant to be heard. Another important element is that the gap between tracks should be context-sensitive to the album. If a song typically has no gap between it and the next song, should it also have no gap when it is played on a playlist outside of the album? The problem is that there really is no concept of the ‘album’ in popular digital music, but we’ll get to that later.

From Abbey Road to the White Album

My other problem with digital music is that in mp3 players and digital music players, when I look at a list of albums from a band, I see them alphabetically. An alphabetical list of albums makes it easy to find one you’re looking for, but to me, is not the best way to look at albums. I would rather look at albums chronologically – so that when I’m looking at a list of Led Zeppelin albums I see ‘Led Zeppelin I’ before I see ‘Houses of the Holy’, or The Beatles’ ‘The White Album’ before ‘Abbey Road’. This is an unusual problem because our digital music has metadata, and one of those fields is for the year of the music. So why can’t that be used to show a chronological list of albums? I suppose it could, but it would present problems. Let’s say an album has 10 tracks – in the perfect metadata world, all of these will have the same year, so the application or music player could just look at one of the songs and pick the year. In a more complicated world, the songs could have different years marked, or incomplete data – what should the player do in this case? What if we’re looking at a compilation of songs all recorded in different years – should the file’s metadata list the year the song was recorded and released or the year the compilation was released. I would argue that attached to the song should be the year in which it was recorded, while another entity – ‘the album’ – should keep track of it’s own release date.

The Album – The Metadata that Went Missing

So the common thread here is the album. Right now, popular music systems have no real concept of the album – they infer the existence of an album based on metadata attached to each song – an artist name, an album, year, genre, track number, and whole bunch of other fields. As mentioned earlier, this becomes increasingly complex when songs start belonging to multiple albums or playlists, because the songs can only have one value for each of the aforementioned metadata fields. What we really need is a wrapper around all the files in an album that can store some of this information.

Let’s think about this from the technical perspective. If I were to develop a database-based application to store information about my music collection, how would I do it? I would need to create tables for songs, albums, and song/album mappings. Basically, one table would have all the basic information about each song, another table would have the basic information about each album (artist, release date, record company, producer, credits, etc), and another would connect the two other tables – mapping which songs are on which albums and the order in which they are on those albums. If I wanted to go an extra step further, I could add another table to track information about the artist, but that isn’t really essential for most purposes.

Obviously the files that make up the digital music of today are not databases, so the table concept doesn’t directly translate to what can be done in the real world. So if this had to be done in a file-based manner, we could add one small file that has album information and the album/track mapping – similar to a playlist file but with more information. The album’s year would solve my second issue of chronological sorting of albums, and the tracklist within the album file could have information about the space between tracks, solving the gap between tracks issue.

Overall I think this could add to the experience of digital music and make it easier for people to switch over from the physical realm of music to the digital realm. I still love my liner notes and opening up a new album, so I don’t think I’ll go all digital anytime soon, but making the experience of listing to music closer to what I get with a CD, record, or tape player, will certainly make it easier for me to get rid of that CD player in my living room…

PIXIES

Posted on April 14th, 2005 in Music by Greg

The Pixies are coming back to California (woooooo hoooo, wooooo hooooooo). They’re going to play 2 shows in on May 30th at the Warfield in SF…I just have to pray that I can get some general admission tickets because I really don’t want to be sitting up in the balcony for the Pixies.

I saw them last summer when they played the Greek Theatre in Berkeley and it was a great show. I wrote about it here.

Tickets don’t go on sale until the 17th of April, so…shhhhhhh, don’t tell anyone :)