xxxxxxxxxx
192
//Credit to all the tiktoks I took sounds from
//Use QWERT to make noises
//Space to clear
//S to save your canvas
let beebeebee
let broken
let crying
let oneday
let remix
let rockstar
let clicky = false
function preload(){
beebeebee = {
sound:loadSound("beebeebee.mp3"),
args:[undefined, undefined, undefined, undefined, 1.4],
cWidth:20,
cInc: 50,
}
// broken = {
// sound:loadSound("broken.mp3"),
// args:[]
// }
crying = {
sound:loadSound("crying.mp3"),
args:[],
opts: ['😳', '😡', '🥲', '😥', '🙃', '🧐', '😭', '😔', '🥺', '😩', '☹️', '😤', '😖']
}
oneday = {
sound:loadSound("oneday.mp3"),
args:[],
btm: 100,
}
remix = {
sound:loadSound("remix.mp3"),
args:[undefined, undefined, undefined, 5.7, 8.65],
line: {x1:600, y1:0, x2:550, y2:40},
weight: 10,
}
rockstar = {
sound:loadSound("beebeebee.mp3"),
args:[undefined, undefined, undefined, 3, 7]
}
}
function setup() {
createCanvas(windowWidth, windowHeight);
console.log(beebeebee)
background(237, 230, 209)
}
function draw() {
if(!clicky){
textAlign(CENTER)
textSize(20)
text("Press and hold Q, W, E, R, T for sound\nPress Space to Clear\nPress S to Save Canvas\n(Click mouse now to remove text.)", width/2, height/2)
}
//background(220);
beebeebee.sound.playMode('restart')
remix.sound.playMode('restart')
rockstar.sound.playMode('restart')
oneday.sound.playMode('restart')
crying.sound.playMode('restart')
//beebeebee sound
if (beebeebee.sound.isPlaying()){
noFill()
setLineDash([0])
strokeWeight(10)
stroke(random(255), random(255), random(255), random(20, 100))
ellipse(50,50,beebeebee.cWidth)
if (frameCount % 15 == 0){
beebeebee.cWidth += beebeebee.cInc
if(beebeebee.cWidth > width){
beebeebee.cInc *= -1
}
}
}
//remix sound
if(remix.sound.isPlaying()){
setLineDash([0])
remix.line.x1 = width
stroke(0, 0, 0, 2)
strokeWeight(remix.weight)
line(remix.line.x1, remix.line.y1, remix.line.x2, remix.line.y2)
if(frameCount % 30 == 0){
remix.line.x2 =- 40
remix.line.y2 += 50
remix.weight = random(1, 20)
}
}
//rockstar sound
if(rockstar.sound.isPlaying()){
if(frameCount % 20 == 0){
noStroke()
fill(random(255), random(255), random(255), 100)
rect(random(width), random(height), random(5, 50), random(5, 100))
}
}
//one day sound
if(oneday.sound.isPlaying()){
stroke(0)
strokeWeight(5)
setLineDash([5, 10, 20, 10]); //another dashed line pattern
if(frameCount % 30 == 0){
x = random(0, width)
line(x, random(100, height/2), x, oneday.btm)
oneday.btm+=20
}
}
//crying sound
if(crying.sound.isPlaying()){
if (frameCount % 40 == 0){
w = random(width)
h = random(height)
for(i=0; i<random(10); i++){
s = random(12,70)
p = random(5,20)
choice = round(random(crying.opts.length-1))
console.log(choice)
textSize(s)
text(crying.opts[choice], w+s+p, h)
}
}
}
}
function keyTyped(){
if (key == 'q'){
beebeebee.sound.play(beebeebee.args)
}
if(key == 'w'){
remix.sound.play(remix.args)
}
if(key == 'e'){
rockstar.sound.play(rockstar.args)
}
if(key == "r"){
oneday.sound.play()
}
if(key=='t'){
crying.sound.play()
}
}
function keyReleased(){
beebeebee.sound.stop()
remix.sound.stop()
rockstar.sound.stop()
oneday.sound.stop()
crying.sound.stop()
}
function keyPressed(){
if (keyCode == 32){
background(237, 230, 209)
}
if (key=='s'){
saveCanvas('musicArt', 'png')
}
}
function mousePressed(){
background(237, 230, 209)
clicky = true
}
function setLineDash(list) {
drawingContext.setLineDash(list);
}