Skip to content

Commit

Permalink
Removed limiting preset values
Browse files Browse the repository at this point in the history
because polyphone does so for some reason...
  • Loading branch information
spessasus committed Aug 6, 2023
1 parent 73734f0 commit e655718
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ <h2 id="text_event"></h2>
*/
const file = e.target.files[0];

e.target.onchange = undefined;
document.getElementById("sf_upload").innerText = file.name;
titleMessage.innerText = "Parsing SoundFont...";

Expand All @@ -210,6 +209,8 @@ <h2 id="text_event"></h2>
// prepare midi interface
window.manager = new Manager(audioContextMain, soundFontParser);

sfInput.onchange = undefined;
document.getElementById("bundled_sf").onclick = undefined;
if(fileInput.files[0])
{
startMidi(fileInput.files[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class GeneratorTranslator {
return this.limitValue(val, minAllowed, maxAllowed)
}

return this.limitValue(defaultValue + preset, minAllowed, maxAllowed); // this.limitValue(val, minAllowed, maxAllowed);
return defaultValue + preset; // this.limitValue(val, minAllowed, maxAllowed);
}

/**
Expand Down Expand Up @@ -285,6 +285,10 @@ export class GeneratorTranslator {
*/
_getSustainLevel()
{
if(this.sustainLowerAmount < 0)
{
return this.decibelsToGain(this.attenuation * -1);
}
let sustain = this.decibelsToGain(this.attenuation * -1) * this.decibelsToGain(this.sustainLowerAmount * -1)
if(sustain <= 0)
{
Expand Down
3 changes: 2 additions & 1 deletion src/js/utils/byte_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export function readBytesAsString(dataArray, bytes, encoding=undefined){
let string = "";
for (let i = 0; i < bytes; i++) {
let byte = readByte(dataArray);
if (byte === 0) {
if(byte < 32 || byte > 127)
{
continue;
}
string += String.fromCharCode(byte);
Expand Down

0 comments on commit e655718

Please sign in to comment.