WIP: The MuSiCaL Update #1
67
Music/bgm.js
Normal file
67
Music/bgm.js
Normal file
@@ -0,0 +1,67 @@
|
||||
//Based off of the one found at not_found.html but randomizes the songs
|
||||
let song = "/Music/noway.mid"
|
||||
function SongRNG() {
|
||||
//this is actually code from minima and its absolutely NOT made for this BUT WHO CARES????
|
||||
//@ts-check
|
||||
console.log("yo whatap")
|
||||
console.log("picking a song...")
|
||||
let min = 0
|
||||
let max = 13
|
||||
let scarynumber = Math.random() * (max - min + 1) + min;
|
||||
let randint = Math.round(scarynumber)
|
||||
//funni.mid is uhh- 24 hour cinderella
|
||||
let lines = ["AnotherMedium-Updated.mid", "CORE_.mid", "Death_by_Glamour.mid", "maniaStudiopolisZoneAct1.mid", "maniaStudiopolisZoneAct2.mid", "mk7_select_menu.mid", "Mpntbgm1.mid", "MPntBgk2.mid", "portal.mid", "rhythmheaven4thmix.mid", "SmashMenu.mid", "funni.mid", "utruins.mid"]
|
||||
console.log("random number:", randint)
|
||||
//32 lines randomly picked, probably will sometimes return "undefined". i don't feel like fixing it.
|
||||
console.log("today's track:", lines[randint])
|
||||
if (randint > max) {
|
||||
console.warn("song doesn't exist. you know what that means...")
|
||||
//window.open("/not_found.html");
|
||||
//btw the not found page plays noway.mid
|
||||
//ik it would be funny as hell but lets actually NOT send the user to nomans land because of MY bug
|
||||
//doesn't mean they're off the hook though
|
||||
song = "/Music/noway.mid"
|
||||
//YEAH, THAT'S MORE LIKE IT!!
|
||||
} else {
|
||||
song = "/Music/bgm/" + lines[randint]
|
||||
}
|
||||
//could be useful
|
||||
function getSongTitle() {
|
||||
console.log("song info for", randint)
|
||||
let titles = ["Another Medium", "CORE", "Death by Glamour", "Studiopolis Act 1 (Lights, Camera, Action!)", "Studiopolis Act 2", "Select a kart", "Creative Exersise", "Monkeys", "Still Alive", "Remix 4", "Main Menu", "24 Hour Cinderella", "The Ruins"]
|
||||
let games = ["Undertale", "Undertale", "Undertale", "Sonic Mania", "Sonic Mania", "Mario Kart 7", "Mario Paint", "Mario Paint", "Portal", "Rhythm Heaven DS", "SSB Wii U/3DS", "Yakuza", "Undertale"]
|
||||
console.log(titles[randint], "from ", games[randint])
|
||||
|
||||
}
|
||||
//window.addEventListener('DOMContentLoaded', newLine);
|
||||
}
|
||||
//ok, now we actually do stuff
|
||||
SongRNG()
|
||||
//just in case the user has autoplay disabled because they probably do
|
||||
MIDIjs.play(song, true);
|
||||
//idk if it's playing
|
||||
isplaying = "idk"
|
||||
//random ahh google code
|
||||
MIDIjs.player_callback = function(event) {
|
||||
// Check if event object contains time (indicating playback)
|
||||
if (event && event.time !== undefined) {
|
||||
isplaying = "true";
|
||||
} else {
|
||||
isplaying = "false";
|
||||
}
|
||||
};
|
||||
var apbox = document.getElementById("autoplay");
|
||||
console.log("waiting a bit for midijs")
|
||||
setTimeout(function(){
|
||||
checkAudio()
|
||||
}, 5000)
|
||||
function checkAudio() {
|
||||
if (isplaying == "false") {
|
||||
console.log("music isn't playing. i blame chrome")
|
||||
document.getElementById("autoplay").innerHTML = "<p>Music is playing, but your autoplay is turned off.</p><noscript>JS is off, MIDIjs won't be able to play audio anyways.</noscript> <button onclick=MIDIjs.play(song, true)>Play Music</button>"
|
||||
} else if (isplaying == "true"){
|
||||
console.log("music do be the playing")
|
||||
} else if (isplaying == "idk") {
|
||||
console.warn("idk if there be music")
|
||||
}
|
||||
}
|
||||
BIN
Music/bgm/AnotherMedium-Updated.mid
Normal file
BIN
Music/bgm/AnotherMedium-Updated.mid
Normal file
Binary file not shown.
BIN
Music/bgm/CORE_.mid
Normal file
BIN
Music/bgm/CORE_.mid
Normal file
Binary file not shown.
BIN
Music/bgm/Death_by_Glamour.mid
Normal file
BIN
Music/bgm/Death_by_Glamour.mid
Normal file
Binary file not shown.
BIN
Music/bgm/MPntBkg2.mid
Normal file
BIN
Music/bgm/MPntBkg2.mid
Normal file
Binary file not shown.
BIN
Music/bgm/Mpntbgm1.mid
Normal file
BIN
Music/bgm/Mpntbgm1.mid
Normal file
Binary file not shown.
BIN
Music/bgm/SmashMenu.mid
Normal file
BIN
Music/bgm/SmashMenu.mid
Normal file
Binary file not shown.
BIN
Music/bgm/funni.mid
Normal file
BIN
Music/bgm/funni.mid
Normal file
Binary file not shown.
BIN
Music/bgm/maniaStudiopolisZoneAct1.mid
Normal file
BIN
Music/bgm/maniaStudiopolisZoneAct1.mid
Normal file
Binary file not shown.
BIN
Music/bgm/maniaStudiopolisZoneAct2.mid
Normal file
BIN
Music/bgm/maniaStudiopolisZoneAct2.mid
Normal file
Binary file not shown.
BIN
Music/bgm/mk7_select_menu.mid
Normal file
BIN
Music/bgm/mk7_select_menu.mid
Normal file
Binary file not shown.
BIN
Music/bgm/portal.mid
Normal file
BIN
Music/bgm/portal.mid
Normal file
Binary file not shown.
BIN
Music/bgm/rhythmheaven4thmix.mid
Normal file
BIN
Music/bgm/rhythmheaven4thmix.mid
Normal file
Binary file not shown.
BIN
Music/bgm/utruins.mid
Normal file
BIN
Music/bgm/utruins.mid
Normal file
Binary file not shown.
@@ -15,10 +15,15 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<script src=compat.js></script>
|
||||
<!--gotta remember to ALSO load midijs-->
|
||||
<script type='text/javascript' src='//www.midijs.net/lib/midi.js'></script>
|
||||
<script src="/Music/bgm.js"></script>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Sono&display=swap" rel="stylesheet">
|
||||
<link href="/normalbordem.css" rel="stylesheet" type="text/css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="autoplay-warning" id="autoplay">
|
||||
</div>
|
||||
<!-- [FC2 Analyzer] //analyzer.fc2.com/ -->
|
||||
<script language="javascript" src="//analyzer54.fc2.com/ana/processor.php?uid=2906964" type="text/javascript"></script>
|
||||
<noscript><div align="right"><img src="//analyzer54.fc2.com/ana/icon.php?uid=2906964&ref=&href=&wid=0&hei=0&col=0" /></div></noscript>
|
||||
|
||||
Reference in New Issue
Block a user