Skip to content

Commit

Permalink
Super shameless self-promotion
Browse files Browse the repository at this point in the history
- because why not? >:) (added project's page to the demo)
- added recommended soundfont to the demo
- demo now requires soundfont before midi file upload
- css improvements
  • Loading branch information
spessasus committed Aug 5, 2023
1 parent 417cd91 commit 154693a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
22 changes: 15 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@
<div id="progress_bar"></div>
<h1 id="title">SpessaSynth: SoundFont2 Javascript Synthetizer Online Demo</h1>
<div class="midi_and_sf_controller">
<label id="file_upload"> Upload a MIDI file
<label id="file_upload"> Upload the MIDI file
<input type="file" accept=".mid" id="midi_file_input"><br/>
</label>
<label id="sf_upload"> Upload your soundfont

<label id="sf_upload"> Upload the soundfont
<input type="file" accept=".sf2" id="sf_file_input"><br/>
</label>

<label>
<a href='https://github.com/spessasus/SpessaSynth' target='_blank'>Project's page</a>
</label>

<label>
<a href='https://musical-artifacts.com/artifacts/1176' target='_blank'>Recommended SoundFont</a>
</label>
</div>
</div>

Expand Down Expand Up @@ -65,11 +74,9 @@ <h2 id="text_event"></h2>
* @type {HTMLInputElement}
*/
let fileInput = document.getElementById("midi_file_input");
fileInput.onchange = e => {
if (e.target.files[0]) {
document.getElementById("file_upload").innerText = e.target.files[0].name;
}
fileInput.onchange = undefined;
fileInput.onclick = e => {
e.preventDefault();
titleMessage.innerText = "You need to upload a SoundFont first";
}


Expand Down Expand Up @@ -140,6 +147,7 @@ <h2 id="text_event"></h2>
}
else
{
fileInput.onclick = undefined;
fileInput.onchange = e => {
if(e.target.files[0])
{
Expand Down
7 changes: 7 additions & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ html, body {
overflow-x: clip;
}

a{
text-decoration: none;
color: #546fff;
}

::-webkit-scrollbar{
background-color: transparent;
width: 0.3em;
Expand Down Expand Up @@ -82,6 +87,8 @@ input[type="file"] {
display: flex;
width: fit-content;
margin: auto auto 5px;
flex-wrap: wrap;
justify-content: space-around;
}

.midi_and_sf_controller label
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ <h1 id="title">SpessaSynth: SoundFont2 Javascript Synthetizer</h1>
<label id="file_upload"> Upload a MIDI file
<input type="file" accept=".mid" id="midi_file_input"><br/>
</label>
<select id="sf_selector">
</select>

<select id="sf_selector"></select>
</div>
</div>

Expand Down

0 comments on commit 154693a

Please sign in to comment.