genregenerator/genregen.coffee

196 lines
2.5 KiB
CoffeeScript
Raw Normal View History

2011-10-09 20:14:57 +02:00
genres = [
'Aggrotech',
'Ambient',
'Beat',
'Bluegrass',
'Blues',
'Chiptune',
'Core',
'Country',
'Cumbia',
'Dance',
'Dancehall',
'Drum and Bass',
'Dub',
'Dubstep',
'EBM',
'Flamenco',
'Grunge',
'Goa',
'Gospel',
'Hardstyle',
'Hip-hop',
'House',
'Humppa',
'Industrial',
'Jazz',
'Metal',
'Oi!',
'Polka',
'Pop',
'Punk',
'Rap',
'Rave',
'Reggae',
'Rockabilly',
'Samba',
'Schranz',
'Ska',
'Soul',
'Techhouse',
'Techno',
'Tekkno',
'Trance',
'Triphop',
'Twostep',
'Western',
]
subgenres = [
'30s',
'40s',
'50s',
'60s',
'70s',
'80s',
'Acid',
'Alternative',
'Ambient',
'Anatolian',
'Arena',
'Art',
'Australian',
'Australian',
'Avantgarde',
'Balearic',
'Balkan',
'Battle',
'Black',
'Body',
'Bossa nova',
'Brit',
'Celtic',
'Chinese',
'Christian',
'Comedy',
'Conscious',
'Cow',
'Crust',
'Dark',
'Death',
'Dirty',
'Doom',
'Drone',
'East Coast',
'Electroclash',
'Electronic',
'Emo',
'Euro',
'Experimental',
'Extreme',
'Flower',
'Folk',
'Free',
'Freestyle',
'Fucking',
'Fun',
'Funk',
'Fusion',
'Future',
'Gangsta',
'Garage',
'Ghetto',
'Glam',
'Gospel',
'Gothic',
'Grind',
'Groove',
'Happy',
'Hard',
'Hardcore',
'Harmonica',
'Handsup',
'Heavy',
'Horror',
'Indian',
'Indie',
'Independent',
'Industrial',
'Instrumental',
'Latin',
'Lounge',
'Mainstream',
'Medieval',
'Melodic',
'Minimal',
'Neo',
'New age',
'Ninja',
'Nintendo',
'Noise',
'Nu',
'Pagan',
'Pirate',
'Post',
'Power',
'Progressive',
'Psychedelic',
'Skate',
'Sludge',
'Southern',
'Space',
'Speed',
'Stoner',
'Street',
'Sunshine',
'Surf',
'Swedish',
'Swing',
'Symphonic',
'Synth',
'Teutonic',
'Traditional',
'Trash',
'Viking',
'Vocal',
'Wave',
'West Coast',
'World',
]
cities = [
'Berlin',
'Bakersfield',
'Detroit',
'Frankfurt',
'Gothenburg',
'Ibiza',
'London',
'New Orleans',
'Rio',
'Rotterdam',
'San Francisco',
]
rand_choose = (array) ->
array[Math.floor(Math.random() * array.length)]
chance = (percent) ->
Math.floor(Math.random() * 100) < percent
generate_genre = ->
parts = []
parts.push rand_choose(cities) if chance 20
parts.push rand_choose(subgenres) if chance 70
parts.push rand_choose(subgenres)
parts.push rand_choose(genres)
genre = parts.join(' ')
$('#genre a').text(genre)
$('title').text('Listen to ' + genre)
$(document).ready ->
$('#genre a').click(generate_genre)
generate_genre()