xxxxxxxxxx
70
let adjective, music, button, coolGenre, coolName;
let genreData = [];
let adjectiveData = [];
let crazy = 1;
let r=100
let g=100
let b=100
function preload() {
genreData = loadJSON('genres.json');
adjectiveData = loadJSON('adj.json');
}
function setup() {
console.log('loading json data');
createCanvas(600, 400);
// noCanvas();
button = createButton('Dame un género bien MELO para mi música // Give me some coooooool NEW KIND OF Music for my BAND');
button.mousePressed(giveName);
createP();
button1 = createButton('Dejá esa cosa quieta puess // I cant reaaad, stop it');
button1.mousePressed(reset);
// coolGenre = createP (adjective + ' ' + music);
// print(data);
}
function draw() {
background(r, g, b, 100);
music = genreData.genres[floor(random(genreData.genres.length))];
adjective = adjectiveData.adjs[floor(random(adjectiveData.adjs.length))];
fill(255);
textSize(26);
text(coolName, (10) + (random(crazy)), (height / 3) + (random(crazy)));
}
function processGenre(genres) {
genreData = genres;
console.log('genre done');
console.log(genreData);
}
function processAdj() {
console.log('adj done');
}
function giveName() {
coolName = (adjective + ' ' + music);
r = random(255);
g = random(255);
b = 0;
crazy++;
// coolGenre.html (adjective + ' ' + music);
}
function reset(){
crazy=1
}