Compare commits

...

10 commits

Author SHA1 Message Date
a9b30fc182 p5.sound -> Tone.js 2022-01-18 23:20:44 +09:00
10e8395739 image server url update 2021-11-18 13:28:42 +09:00
3f5ef14ff2 update. 2020-11-13 13:47:53 +09:00
23b09e069f resolve CSP issue.. 2020-11-13 01:48:24 +09:00
be165e5094 // 2020-11-13 01:14:27 +09:00
b05dc9f7ed .. 2020-11-13 01:13:03 +09:00
1f22f64b5d socket io origin. 2020-11-13 00:47:17 +09:00
cdf4d662c3 error fix. 2020-11-13 00:41:21 +09:00
6a026970d0 port change. 2020-11-13 00:32:52 +09:00
60382e8649 grabbing all contents from glitch 2020-11-13 00:10:26 +09:00
36 changed files with 807 additions and 742 deletions

39
downloads/download.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/bash
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2Fmessagesound.mp3" -o "messagesound.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F020.mp3" -o "020.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F018.mp3" -o "018.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F017.mp3" -o "017.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F019.mp3" -o "019.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F015.mp3" -o "015.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F016.mp3" -o "016.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F013.mp3" -o "013.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F011.mp3" -o "011.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F012.mp3" -o "012.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F014.mp3" -o "014.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F13.png" -o "13.png"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2Flogo.png" -o "logo.png"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2Flogo02.png" -o "logo02.png"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F018.mp3" -o "018.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F011.mp3" -o "011.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F15.mp3" -o "15.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F14.mp3" -o "14.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F012.mp3" -o "012.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F17.mp3" -o "17.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F19.mp3" -o "19.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F11.mp3" -o "11.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F013.mp3" -o "013.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F022.mp3" -o "022.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F020.mp3" -o "020.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F021.mp3" -o "021.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F014.mp3" -o "014.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F16.mp3" -o "16.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F015.mp3" -o "015.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F18.mp3" -o "18.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F12.mp3" -o "12.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F019.mp3" -o "019.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F13.mp3" -o "13.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F016.mp3" -o "016.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F017.mp3" -o "017.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F023.mp3" -o "023.mp3"
curl "https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F_silence.wav" -o "_silence.wav"

View file

@ -12,7 +12,7 @@ var app = express();
// maybe... 'flyio' is interfering the middle (http://pzzz.ink <- flyio -> https://dianaband-paradezzz.glitch.me) // maybe... 'flyio' is interfering the middle (http://pzzz.ink <- flyio -> https://dianaband-paradezzz.glitch.me)
// ==> so, we won't do it. but we will let the client do it. -> public/sketch.js #7 ~ #11 // ==> so, we won't do it. but we will let the client do it. -> public/sketch.js #7 ~ #11
var server = http.createServer(app); var server = http.createServer(app);
var port = process.env.PORT || 3000; var port = process.env.PORT || 9009;
server.listen(port); server.listen(port);
// //
app.use(express.static("public")); app.use(express.static("public"));

BIN
public/audio/011.mp3 Normal file

Binary file not shown.

BIN
public/audio/012.mp3 Normal file

Binary file not shown.

BIN
public/audio/013.mp3 Normal file

Binary file not shown.

BIN
public/audio/014.mp3 Normal file

Binary file not shown.

BIN
public/audio/015.mp3 Normal file

Binary file not shown.

BIN
public/audio/016.mp3 Normal file

Binary file not shown.

BIN
public/audio/017.mp3 Normal file

Binary file not shown.

BIN
public/audio/018.mp3 Normal file

Binary file not shown.

BIN
public/audio/019.mp3 Normal file

Binary file not shown.

BIN
public/audio/020.mp3 Normal file

Binary file not shown.

BIN
public/audio/021.mp3 Normal file

Binary file not shown.

BIN
public/audio/022.mp3 Normal file

Binary file not shown.

BIN
public/audio/023.mp3 Normal file

Binary file not shown.

BIN
public/audio/11.mp3 Normal file

Binary file not shown.

BIN
public/audio/12.mp3 Normal file

Binary file not shown.

BIN
public/audio/13.mp3 Normal file

Binary file not shown.

BIN
public/audio/14.mp3 Normal file

Binary file not shown.

BIN
public/audio/15.mp3 Normal file

Binary file not shown.

BIN
public/audio/16.mp3 Normal file

Binary file not shown.

BIN
public/audio/17.mp3 Normal file

Binary file not shown.

BIN
public/audio/18.mp3 Normal file

Binary file not shown.

BIN
public/audio/19.mp3 Normal file

Binary file not shown.

BIN
public/audio/_silence.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
public/imgs/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
public/imgs/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
public/imgs/logo02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -8,13 +8,10 @@
name="viewport" name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/> />
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.js"></script> <script src="./js/p5-v1.1.9.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js"></script> <script src="./js/socket-v2.3.0.io.slim.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script> <script src="./js/Tone-14.8.36.min.js"></script>
<link <link href="https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap" rel="stylesheet"/>
href="https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap"
rel="stylesheet"
/>
<script src="sketch.js"></script> <script src="sketch.js"></script>
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />

1
public/js/Tone-14.8.36.min.js vendored Normal file

File diff suppressed because one or more lines are too long

28
public/js/p5-v0.3.11.sound.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
public/js/p5-v1.1.9.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,15 @@ if (http_confirm == "http") {
window.location.replace("https://" + location.host); window.location.replace("https://" + location.host);
} }
var socket = io("https://dianaband-paradezzz.glitch.me/"); function AudioImport(url) {
return new Promise(function(resolve, reject) {
var audio = new Tone.Player(url, function() {
resolve(audio);
}).toDestination();
});
}
var socket = io(location.host);
var n = 0; var n = 0;
var fr = 20; var fr = 20;
var arr = []; var arr = [];
@ -20,78 +28,41 @@ var score;
let logo; let logo;
var silence; var silence;
function preload() { async function preload() {
loadJSON("/score.json", function(json) { loadJSON("/score.json", function(json) {
score = json; score = json;
}); });
silence = loadSound( silence = await AudioImport("./audio/_silence.wav");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F_silence.wav?v=1605079435755"
);
} }
function setup() { async function setup() {
noCanvas(); noCanvas();
if (windowWidth > 1500 && windowWidth > windowHeight) {
fr = 30;
} else {
fr =20;
}
frameRate(fr); frameRate(fr);
voice[0] = loadSound( voice[0] = await AudioImport("./audio/018.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F018.mp3?v=1605065703249" voice[1] = await AudioImport("./audio/011.mp3");
); voice[2] = await AudioImport("./audio/14.mp3");
voice[1] = loadSound( voice[3] = await AudioImport("./audio/012.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F011.mp3?v=1605065704890" voice[4] = await AudioImport("./audio/17.mp3");
); voice[5] = await AudioImport("./audio/11.mp3");
voice[2] = loadSound( voice[6] = await AudioImport("./audio/013.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F14.mp3?v=1605065705431" voice[7] = await AudioImport("./audio/022.mp3");
); voice[8] = await AudioImport("./audio/020.mp3");
voice[3] = loadSound( voice[9] = await AudioImport("./audio/021.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F012.mp3?v=1605065705852" voice[10] = await AudioImport("./audio/014.mp3");
); voice[11] = await AudioImport("./audio/16.mp3");
voice[4] = loadSound( voice[12] = await AudioImport("./audio/015.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F17.mp3?v=1605065706201" voice[13] = await AudioImport("./audio/18.mp3");
); voice[14] = await AudioImport("./audio/12.mp3");
voice[5] = loadSound( voice[15] = await AudioImport("./audio/019.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F11.mp3?v=1605065707520" voice[16] = await AudioImport("./audio/13.mp3");
); voice[17] = await AudioImport("./audio/016.mp3");
voice[6] = loadSound( voice[18] = await AudioImport("./audio/017.mp3");
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F013.mp3?v=1605065707851" voice[19] = await AudioImport("./audio/023.mp3");
);
voice[7] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F022.mp3?v=1605065708590"
);
voice[8] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F020.mp3?v=1605065708800"
);
voice[9] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F021.mp3?v=1605065709256"
);
voice[10] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F014.mp3?v=1605065709488"
);
voice[11] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F16.mp3?v=1605065710421"
);
voice[12] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F015.mp3?v=1605065710641"
);
voice[13] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F18.mp3?v=1605065710830"
);
voice[14] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F12.mp3?v=1605065711069"
);
voice[15] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F019.mp3?v=1605065711343"
);
voice[16] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F13.mp3?v=1605065711531"
);
voice[17] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F016.mp3?v=1605065712590"
);
voice[18] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F017.mp3?v=1605065712783"
);
voice[19] = loadSound(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2F023.mp3?v=1605065713039"
);
randomvoiceplay(); randomvoiceplay();
} }
@ -110,7 +81,7 @@ socket.on("connect", function() {
// plogo.position(windowWidth/2, 50); // plogo.position(windowWidth/2, 50);
plogo = createImg( plogo = createImg(
"https://cdn.glitch.com/b121cdbd-e958-4ffd-99dd-76922c2c225b%2Flogo02.png?v=1604966478405", "./imgs/logo02.png",
"퍼레이드진진진 로고", "퍼레이드진진진 로고",
"", "",
function(im) { function(im) {
@ -128,7 +99,7 @@ socket.on("connect", function() {
for (var idx = 9; idx > 0; idx--) { for (var idx = 9; idx > 0; idx--) {
var b = createButton(str(idx), str(idx)); var b = createButton(str(idx), str(idx));
b.mouseClicked(function() { b.mouseClicked(function() {
silence.play(); silence.start();
myroom = parseInt(this.value()); myroom = parseInt(this.value());
socket.emit("room", myroom, function(res) { socket.emit("room", myroom, function(res) {
@ -141,7 +112,7 @@ socket.on("connect", function() {
windowWidth / 2 - windowWidth/10, windowWidth / 2 - windowWidth/10,
windowHeight / 2 windowHeight / 2
); );
}, 500); }, 1000);
} else { } else {
console.log("rejected!"); console.log("rejected!");
} }
@ -180,8 +151,24 @@ socket.on("post", function(post) {
var img = createImg(object.src, object.alt, "", function(im) { var img = createImg(object.src, object.alt, "", function(im) {
im.show(); im.show();
if (windowWidth > windowHeight) {
im.size( im.size(
(windowHeight * (object.size.base + object.size.random * Math.random())) / (windowHeight *
(object.size.base * 1.4 + object.size.random * Math.random())) /
100,
AUTO
);
im.position(
windowWidth,
(windowHeight *
(object.y.base + object.y.random * Math.random()) *
0.5) /
100
);
} else {
im.size(
(windowHeight *
(object.size.base + object.size.random * Math.random())) /
100, 100,
AUTO AUTO
); );
@ -189,6 +176,7 @@ socket.on("post", function(post) {
windowWidth, windowWidth,
(windowHeight * (object.y.base + object.y.random * Math.random())) / 100 (windowHeight * (object.y.base + object.y.random * Math.random())) / 100
); );
}
im.attribute("data-type", object.type); im.attribute("data-type", object.type);
im.attribute("data-showtime", object.showtime / 1000); //milli-sec. -> seconds. im.attribute("data-showtime", object.showtime / 1000); //milli-sec. -> seconds.
@ -232,7 +220,7 @@ function draw() {
function randomvoiceplay() { function randomvoiceplay() {
(looper = function(timeout) { (looper = function(timeout) {
setTimeout(function() { setTimeout(function() {
voice[int(random(19))].play(); voice[int(random(19))].start();
looper(random(8000, 12000)); looper(random(8000, 12000));
}, timeout); }, timeout);
})(8000); })(8000);