I have a lot of midi files that I want to use as background music websites that I am creating. I want them to play these automatically but browsers that I preview them on either download them or don’t play at all. Is there anyway to get these to play in browsers?
Anyone?
Hello?
>>108746725>>108747051
>>108746426Yes
>>108746426Good question OP I recommend asking an AI, Google's free one will work for this (the one built into search)But post the answer here so we can discuss it. I bet it's possible with JavaScript
>>108747133screaming
>>108747144I’m not asking AIThere is a HTML player and Java script one but they don’t auto play.
>>108746426Just load Tone.js and instantiate a GM orchestra, probably less than 30 lines of da codez.
>>108746426Was this not was I was doing with HTML or something on Neopets and MySpace when I was 8?
>>108747900Yes, but browsers have changed the way they handle midi files and it’s a lot harder to put midi files in websites now. It seems you need an in site player for them if you try to have them embedded they just download instead.
>>108748051Just hide the player by moving it off screen with CSS bro
>>108748051Taking things that work and just fukkin it all up.
>>108748093Yes, HTML5 dropped support for a lot of legacy media including midi files. I don’t know why everything has to keep removing features and making everything worse.
>>108748844Why don't you love me, daddy?
>>108746426CLAUDEMAKE ME A WEBSITE THAT WILL PLAY MIDI FILES IN THE BROWSER
>>108748908WHY DID GNO ONE THINK OF THIS BEFORE
>>108748925no idea but it worked for me, with this one prompt claude one shot a 352 line javascript file to make an autoplaying midi playlist that can be embedded on any html page with one line.
>>108748949In an sincerity: very baller, glad it worked
>>108746426>>108748051I searched "browser midi player" and the first result was a GitHub page for an embeddable midi player. Did you look at all? Is there a reason why you don't want to just render an audio file and play that instead?
>>108748961I did but I get it to auto play or hide the player and looping doesn’t seem to work either. Plus it needs me to link to an uploaded file, local files don’t work, so the only way I could test is if I started uploading my downloaded midi files. Direct links to midi files online don’t work either for some inexplicable reason.> Is there a reason why you don't want to just render an audio file and play that instead?Because I have a lot of midi files that I want to use plus they’re cool and don’t take up much space.
>>108748844Why does HTML5 suck so hard?
>>108747900Shiet. We wuz doing that with our Geocities and Angelfire sites before you were even born. Fuck HTML5 for taking that away.
>>108746426ultimate-guitar.com still uses midi playback for their guitar tab player and I had to whitelist midi perms for it in my browser so it actually worksI have no idea how you'd go about making your own, just letting you know it's still a thing
>>108750483Quite a few of the sites around that host midi files allow playback but it’s always click to play and then it’s only once. I haven’t seen any that auto play on loop.
To instruct a client to play a MIDI file in the browser rather than downloading it, you must set the Content-Type header to audio/midi. However, it is critical to note that most modern browsers do not support native playback of MIDI files via standard HTML5 audio tags or headers alone. Because browsers lack built-in synthesizers for the audio/midi MIME type, setting this header will often result in the file being downloaded or ignored, even if Content-Disposition is not set to attachment. To achieve actual playback, you typically need to:Use a JavaScript library (such as html-midi-player or Web MIDI API) to synthesize the sound within the browser. Ensure the server serves the file with Content-Type: audio/midi so the JavaScript library can correctly interpret the data stream.
>trying to make the front end do itthis board is peak retard
>>108747133kek, i can hear it
>>108750798>html-midi-player or Web MIDI APIThe problem with these is there doesn’t seem to be a way to have the midi autoplay on loop and have the player hidden.
It used to be possible with Embed tags but plugin support was removed.
>>108750993yet claude had no problem making exactly that for me. Post examples of your attempts at implementing it and I'll try to help, but I'm not going to spoon feed you code that claude made for me when you haven't even tried yourself.
Yes you will ask Claude. The stubbornness against ai guides means nothing. It's a waste of time and energy.
>>108750993The browser requires at least one user interaction to run audiocontext so you need to trick the user into clicking any button or link or something. make a simple landing page with an enter button.
>>108751066doesn't claude require full doxx to use?
>>108751266no? I signed up with a burner gmail and that was all it needed.
Former web developer here:- Autoplay audio is disabled by default in modern browsers. You can get around it by using javascript that plays it after page load or another event.- There are javascript libraries to load and play midi files. Check them and use them.- For a quick workaround, I would convert the midi to m4a or mp3, use the default audio controls and make sure I show the user how to use it (autoplay sucks, that's why they disabled it).
>>108751877>autoplay sucks, that's why they disabled itthe only site in the history of the internet to ever pull it off was MySpace.
>>108751066I prefer to learn things through myself, with some help from others, than getting AI gimmicks to do all the thinking for me. I get can old HTML guides for most of the things I’m going to do it’ is only this one problem caused by HTML5 that I really need to ask about.
>>108751088It’s hecking abelist to have autoplaying midis on your site chud
>>108751877>Autoplay audio is disabled by default in modern browsers. You can get around it by using javascript that plays it after page load or another event.>There are javascript libraries to load and play midi files. Check them and use them.Seems that the Javascript players are the best bet then are they better than the HTML player?I did try a Javascript midi player and followed the instructions but it never played any of the midis that I gave it.>For a quick workaround, I would convert the midi to m4a or mp3I prefer midis they’re smaller in size, sound unique and are better way to use copyrighted music> use the default audio controls and make sure I show the user how to use it (autoplay sucks, that's why they disabled it).I want my pages to be an experience and I want autoplay to be a part of it.
>>108754240use https://github.com/Tonejs/Midi to convert the midi files to a json format which is playable via https://github.com/Tonejs/Tone.jsthat's what's going on here: https://incandescent-blini-669fbf.netlify.app/although there's an unpleasant delay between the looping, it's ai generated so I wouldn't even know why it does that but it's probably an easy fix.you could replace the "Enter" button with whatever you want to get the user to click somewhere, an invisible button overlay or whatever.
>>108754396forgot to include the files it generated if you want to learn from them https://litter.catbox.moe/wjnn47nkovl33vtu.zip
>>108753394Why can’t they say they just find it annoying instead of whining about “accessibility issues” and “ableism”?
Ask grok to make you a webplayer
>>108755513No!
>>108746426no, it is impossible
>>108752278It’s a shame all of MySpace music was ‘accidentally’ wiped during a ‘server transfer’.
>>108746426Yes that’s doable in many ways
>>108746426I was searching for a solution to the MIDI problem a few years ago too and couldn't find anything except requesting site visitors use Internet Explorer for the "full experience". If you are programming your own backend server you could probably detect visitors who don't use IE and then block them with an error message telling them to use it. Also, IE seems to be required for autoplay/loop with the unfortunately deprecated <BGSOUND> element. I typically write it like:><BGSOUND SRC="midi/field4.mid" AUTOPLAY LOOP="INFINITE">Also, let us lament the loss of <BLINK> and <MARQUEE> as well. They may have been rivals but at heart were old friends...
>>108757544>Kills Flash>Kills Midi players>Kills several functionsWhy does HTML5 have to be so shit?
>>108755531>>108757424The Duality of /G/