Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
midi [2023/02/15 20:21] – created melonmidi [2023/04/06 15:52] (current) – [Playing a midi on a webpage!] melon
Line 11: Line 11:
 ===== Playing a midi on a webpage! ===== ===== Playing a midi on a webpage! =====
  
-Often you'll want to convert the midi to a compressed mp3 using your preferred reinstatement set: a great free program is GSXCC, this is a program that emulates a Famicom (NES) or SCC sound chip in order to play MIDIs. It can make any MIDI file into chiptunes! You can [[https://meme.institute/gxscc/|download it here]]!+==== Melon's Mini Music Player====
  
-However you can also embed midis directly into browser using these steps:+Melon created a little premade scrip that played midi's, if you just want simple copy-paste solution, [[https://forum.melonland.net/index.php?topic=1235.msg10638#msg10638|have a look here]]!
  
-  * **Add an HTML tag to your webpage**. You can use the **<embed>** tag to add your midi file to your webpage. The **<embed>** tag has several attributes that you can use to control how your midi file is played, such as **src**, **width**, **height**, **autostart**, **repeat**, and **loop**. For example, you can use this tag to play a midi file named musicfile.mid on your webpage:+==== Midi JS ====
  
 +Often you'll want to convert the midi to a compressed mp3 using your preferred instrument set: a great free program is GSXCC, this is a program that emulates a Famicom (NES) or SCC sound chip in order to play MIDIs. It can make any MIDI file into chiptunes! You can [[https://meme.institute/gxscc/|download it here]]!
  
-<code><embed src="musicfile.mid" width=144 height=60 autostart=true repeat=true loop=true></code>+You can also embed midis directly into a browser using [[https://www.midijs.net/|MIDIjs]]:
  
 +**Include the MIDIjs script on your web page (put this in the head)**. You can download the script to your site or use this hotlink:
 +<code>
 +<script src="https://www.midijs.net/lib/midi.js"></script>
 +</code>
  
-This tag will play the midi file with a width of 144 pixels and a height of 60 pixelsand it will start automatically, repeat continuously, and loop indefinitely.+==== Now you can play midis on your site using these JavaScript commands! ==== 
 + 
 +**Play or stop the MIDI file**. You can use the MIDIjs.play() and MIDIjs.stop() functions to play or stop the MIDI file. For exampleyou can use this code to play the MIDI file: 
 +<code> 
 +MIDIjs.play("song.mid"); 
 +</code> 
 +And this code to stop the MIDI file: 
 +<code> 
 +MIDIjs.stop(); 
 +</code>