Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

proof of concept: loading and playing tracks

  • Loading branch information...
commit 58734e448d3fcb6337aa220f13894986e914c1d1 1 parent 1857deb
@theophani authored
View
685 public/mandolin-string-e.json
@@ -0,0 +1,685 @@
+{
+ "id": 827567,
+ "created_at": "2011/05/31 12:47:44 +0000",
+ "user_id": 375367,
+ "duration": 48286,
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "mandolin-string-e",
+ "description": "",
+ "streamable": true,
+ "downloadable": true,
+ "genre": "",
+ "release": "",
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": "",
+ "type": "",
+ "playlist_type": "",
+ "ean": "",
+ "title": "Mandolin string e",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "license": "cc-by",
+ "uri": "http://api.soundcloud.com/playlists/827567",
+ "permalink_url": "http://soundcloud.com/fronx/sets/mandolin-string-e",
+ "artwork_url": null,
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "tracks": [{
+ "id": 16259318,
+ "created_at": "2011/05/31 12:42:15 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e0-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e0",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259318",
+ "permalink_url": "http://soundcloud.com/fronx/e0-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/lsJSGBEd81tG_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259318/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259318/download",
+ "playback_count": 105,
+ "download_count": 8,
+ "favoritings_count": 0,
+ "comment_count": 3,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259318/attachments"
+ }, {
+ "id": 16259300,
+ "created_at": "2011/05/31 12:41:48 +0000",
+ "user_id": 375367,
+ "duration": 3815,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e1-1",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e1",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259300",
+ "permalink_url": "http://soundcloud.com/fronx/e1-1",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/hdpEcIRyP7B4_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259300/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259300/download",
+ "playback_count": 91,
+ "download_count": 7,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259300/attachments"
+ }, {
+ "id": 16259272,
+ "created_at": "2011/05/31 12:41:20 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e2-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e2",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259272",
+ "permalink_url": "http://soundcloud.com/fronx/e2-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/3W6WyoQvnEsg_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259272/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259272/download",
+ "playback_count": 72,
+ "download_count": 7,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259272/attachments"
+ }, {
+ "id": 16259258,
+ "created_at": "2011/05/31 12:40:52 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e3-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e3",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259258",
+ "permalink_url": "http://soundcloud.com/fronx/e3-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/YqyiDfmg9p9j_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259258/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259258/download",
+ "playback_count": 66,
+ "download_count": 8,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259258/attachments"
+ }, {
+ "id": 16259237,
+ "created_at": "2011/05/31 12:40:24 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e4-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e4",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259237",
+ "permalink_url": "http://soundcloud.com/fronx/e4-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/kiySKgVjEMNS_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259237/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259237/download",
+ "playback_count": 45,
+ "download_count": 6,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259237/attachments"
+ }, {
+ "id": 16259220,
+ "created_at": "2011/05/31 12:39:56 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e5-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e5",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259220",
+ "permalink_url": "http://soundcloud.com/fronx/e5-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/wTV4QoakTxrp_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259220/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259220/download",
+ "playback_count": 31,
+ "download_count": 6,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259220/attachments"
+ }, {
+ "id": 16259203,
+ "created_at": "2011/05/31 12:39:30 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e6-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e6",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259203",
+ "permalink_url": "http://soundcloud.com/fronx/e6-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/TnNLV0aYXbQ1_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259203/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259203/download",
+ "playback_count": 20,
+ "download_count": 7,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259203/attachments"
+ }, {
+ "id": 16259181,
+ "created_at": "2011/05/31 12:39:01 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e7-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e7",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259181",
+ "permalink_url": "http://soundcloud.com/fronx/e7-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/YehKwpRxk2IW_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259181/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259181/download",
+ "playback_count": 15,
+ "download_count": 7,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259181/attachments"
+ }, {
+ "id": 16259166,
+ "created_at": "2011/05/31 12:38:35 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e8-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e8",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259166",
+ "permalink_url": "http://soundcloud.com/fronx/e8-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/ANmQpEJFcIsq_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259166/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259166/download",
+ "playback_count": 10,
+ "download_count": 6,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259166/attachments"
+ }, {
+ "id": 16259137,
+ "created_at": "2011/05/31 12:38:08 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e9-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e9",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259137",
+ "permalink_url": "http://soundcloud.com/fronx/e9-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/uTWoMX07nlLF_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259137/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259137/download",
+ "playback_count": 12,
+ "download_count": 7,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259137/attachments"
+ }, {
+ "id": 16259118,
+ "created_at": "2011/05/31 12:37:42 +0000",
+ "user_id": 375367,
+ "duration": 4050,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e10-2",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e10",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259118",
+ "permalink_url": "http://soundcloud.com/fronx/e10-2",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/DVzhaKuTaiUQ_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259118/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259118/download",
+ "playback_count": 10,
+ "download_count": 6,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259118/attachments"
+ }, {
+ "id": 16259107,
+ "created_at": "2011/05/31 12:37:29 +0000",
+ "user_id": 375367,
+ "duration": 3971,
+ "commentable": true,
+ "state": "finished",
+ "sharing": "public",
+ "tag_list": "",
+ "permalink": "e11-wav",
+ "description": null,
+ "streamable": true,
+ "downloadable": true,
+ "genre": null,
+ "release": null,
+ "purchase_url": null,
+ "label_id": null,
+ "label_name": null,
+ "isrc": null,
+ "video_url": null,
+ "track_type": null,
+ "key_signature": null,
+ "bpm": null,
+ "title": "e11.wav",
+ "release_year": null,
+ "release_month": null,
+ "release_day": null,
+ "original_format": "wav",
+ "license": "all-rights-reserved",
+ "uri": "http://api.soundcloud.com/tracks/16259107",
+ "permalink_url": "http://soundcloud.com/fronx/e11-wav",
+ "artwork_url": null,
+ "waveform_url": "http://w1.sndcdn.com/6n2VlLJ18lsg_m.png",
+ "user": {
+ "id": 375367,
+ "permalink": "fronx",
+ "username": "fronx",
+ "uri": "http://api.soundcloud.com/users/375367",
+ "permalink_url": "http://soundcloud.com/fronx",
+ "avatar_url": "http://i1.sndcdn.com/avatars-000003575192-wqnp00-large.jpg?406f947"
+ },
+ "stream_url": "http://api.soundcloud.com/tracks/16259107/stream",
+ "download_url": "http://api.soundcloud.com/tracks/16259107/download",
+ "playback_count": 12,
+ "download_count": 6,
+ "favoritings_count": 0,
+ "comment_count": 0,
+ "created_with": {
+ "id": 158,
+ "name": "Scup",
+ "uri": "http://api.soundcloud.com/apps/158",
+ "permalink_url": "http://soundcloud.com/apps/scup"
+ },
+ "attachments_uri": "http://api.soundcloud.com/tracks/16259107/attachments"
+ }]
+}
View
8 public/playchords.html
@@ -1,5 +1,13 @@
<html>
<head><title>play chords!</title></head>
+<style>
+ button {
+ display: none;
+ }
+ .loaded button {
+ display: inherit;
+ }
+</style>
<body>
<button>play a chord</button>
</body>
View
53 public/playchords.js
@@ -0,0 +1,53 @@
+"use strict";
+
+try {
+ var context = new webkitAudioContext();
+} catch (e) {
+ var el = document.createElement('p');
+ el.innerHTML = 'Sorry, your browser doesn\'t support this experiment. Try <a href="http://www.google.com/chrome">Chrome</a>.';
+ document.body.appendChild(el);
+}
+
+var ready = function (sounds) {
+ var chord = [sounds.e0, sounds.e1, sounds.e2, sounds.e3, sounds.e4];
+ // allow the user to see the interface, indicating that they can play now
+ document.body.className = 'loaded';
+ document.querySelector('button').addEventListener('click', function () {
+ playChord(chord);
+ });
+};
+
+var frets = (function () {
+ var hash = {};
+ var permalinks = ["e0-2", "e1-1", "e2-2", "e3-2", "e4-2", "e5-2", "e6-2", "e7-2", "e8-2", "e9-2", "e10-2", "e11-wav"];
+
+ permalinks.forEach( function (permalink, i) {
+ hash['e' + i] = '/fronx/' + permalink + '/audio';
+ });
+
+ return hash;
+}());
+
+var sounds = loadSounds(frets, ready);
+
+// requires context to exist in global scope
+var playSound = function (buffer, at) {
+ at = at || 0;
+ var source = context.createBufferSource(); // creates a sound source
+ source.buffer = buffer; // tell the source which sound to play
+ source.connect(context.destination); // connect the source to the context's destination (the speakers)
+ source.noteOn(at); // play the source at time 'a'
+};
+
+// requires context and playSound to exist in global scope
+var playChord = function (chord) {
+ var delta = 0.020;
+ var startTime = context.currentTime + 0.100;
+
+ // play each string in chord
+ chord.forEach(function (string, i) {
+ playSound(string, i * delta + startTime);
+ });
+};
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.