Skip to content

TOG11/DotPianoMidiPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

This script is NOT maintained!

As of Feb 2024 it still works, however, bugs will NOT be fixed.

Dot Piano Midi Player

A script that allows you to play custom .mid files through https://dotpiano.com

Download script.js in releases

Getting The Midi File To Play & How The Midi Tracks Work

find a midi file with ONE TRACK ONLY If the midi file has more than 1 track in it, the script will auto-set to play track 1.
Currently, you cannot play multiple midi tracks.

if you would like to switch the midi tracks the script plays on, then at the top of script.js, look for,

const midiTrack = 1 //<-CHANGE THIS NUMBER TO THE TRACK NUMBER YOU WANT TO PLAY 

most of the time you want track 1, however for advanced users I added this setting to the script.

In V3 we added the ability to change midi tempos, to do this go into your config at the top of Script.js and look for,

const tempo = 60


Here you can change the tempo. Higher is faster, lower is slower. 60 is the base, about 120 BPM.

Upload Midi Files To Server

After you have found your midi file, we need to upload it to a File Server/API with CORS enabled. Copy the download link, and put it into the fileurl var in the main script.
go to the config for script.js (at the top of script.js) and paste it here,

 const fileurl = 'DownloadLinkGoesHere'

Your config should look something like this afterwards,

//CONFIG

//the URL of the midi file, the site that hosts this file MUST have cors enabled!
const fileurl = 'FILE URL HERE'

//control midi file tempo (for most songs you want 60, however, the usual change is sometimes required) 
//!!THIS IS NOT BPM, LOWER IS SLOWER, HIGHER IS FASTER!!
const tempo = 60

//the track of the midi file to play. only one track can be played currently.

const midiTrack = 1

//END OF CONFIG

Running Our Script (Chrome)

After script.js is configured,
go to

and go to the "Listen" tab.

IMPORTANT: Pause the current playing piano song

Press F12 on your keyboard, this should open the Developer Menu.
Then go to the "Console" Tab at the top of the Menu.
copy the configured script code, and then paste it into the Console. (Depending on the speed of your PC this could take a moment)
After it's been pasted into the Console, press Enter.
This should load your midi into Dotpiano

IF YOU GET A "forEach" ERROR PLEASE RELOAD THE PAGE AND TRY AGAIN!
(I'm not sure what the culprit of this error is, but I think it has something to do with the midi being over 2 minutes.




I am in no way affiliated with https://dotpiano.com, all rights to https://github.com/tambien for the amazing website!

Running Our Script (Safari Desktop)

In safari, Open safari settings (⌘ + ,)
Go to the advanced tab
Click "Show Features for Web Developers"
go to

and go to the "Listen" tab.

IMPORTANT: Pause the current playing piano song

Press ⌥ + ⌘ + I on your keyboard, this should open the Developer Menu.
Then go to the "Console" Tab at the top of the Menu.
copy the configured script code, and then paste it into the Console. (Depending on the speed of your Mac this could take a moment)
After it's been pasted into the Console, press Enter.
This should load your midi into Dotpiano

IF YOU GET A "forEach" ERROR PLEASE RELOAD THE PAGE AND TRY AGAIN!
(I'm not sure what the culprit of this error is, but I think it has something to do with the midi being over 2 minutes.