Skip to content

Commit

Permalink
removed herobrine
Browse files Browse the repository at this point in the history
  • Loading branch information
EdricCantu committed Mar 24, 2024
1 parent b137d98 commit 78c8f89
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 31 deletions.
19 changes: 14 additions & 5 deletions i.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ input[type="range"]{
border: solid 2px #fff;
outline:none;
color: #FFF;
font-size: 50pt;
width:5in;
font-size: 80pt;
width:6in;
height:auto;
border-radius: 9999px;
text-align: center;
display: inline;

font-family: 'Courier New', Courier, monospace;
font-family: Oxanium, Roboto;
}
.smallButton{
height: 60pt;
Expand All @@ -64,7 +64,7 @@ input[type="range"]{
background: #000;
color: #fff;
border-radius: 999px;
font-size: 35pt;
font-size: 45pt;
}
body > div > div > button.smallbutton{
margin: 0 5pt;
Expand Down Expand Up @@ -158,7 +158,7 @@ input[type=range] {
height: 37px;
-webkit-appearance: none;
margin: 10px 0;
width: calc( 120pt + 5in );
width: calc( 120pt + 6in );
outline: none !important;
}
input[type=range]::-webkit-slider-runnable-track {
Expand Down Expand Up @@ -235,3 +235,12 @@ input[type=range]:focus::-ms-fill-lower {
input[type=range]:focus::-ms-fill-upper {
background: #FFFFFF;
}








@media
64 changes: 43 additions & 21 deletions i.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ for(var wave of waves.querySelectorAll("input")){



normalizeNote = function(note){
var noteMap = {
normalizeNote = function(letter){
return {
"Cb":"BB", ////
"C":"CC", ////
"C#":"CD", ////---------@@@@@@@@@@ C# -- C Sharp
Expand All @@ -323,26 +323,48 @@ normalizeNote = function(note){
"Bb":"AB", ////---------@@@@@@@@@@ Bb -- B Flat
"B":"BB", ////
"B#":"CC" ////
}
/*
var smap = {
"C":, //-----------
"CD":, //------@@@@@
"D":, //-----------
"DE":, //------@@@@@
"E":, //-----------
"F":, //-----------
"FG":, //------@@@@@
"G":, //-----------
"GA":, //------@@@@@
"A":, //-----------
"AB":, //------@@@@@
"B":, //-----------
}*/
}[letter];
}
function parseNote(note, normalize=true){
console.log(note);
var x = note.search(/\d/);
if(x<0) x = note.length//
letter = note.slice(0,x);
octave = note.slice(x) || "4";//
if(normalize) letter = normalizeNote(letter);
return {letter,octave};
}
var smap = [
"CC", //-----------
"CD", //------@@@@@
"DD", //-----------
"DE", //------@@@@@
"EE", //-----------
"FF", //-----------
"FG", //------@@@@@
"GG", //-----------
"GA", //------@@@@@
"AA", //-----------
"AB", //------@@@@@
"BB", //-----------
];
function sdiff(note1, note2) {
// Parse notes into letter and octave components
const { letter: letter1, octave: octave1 } = parseNote(note1);
const { letter: letter2, octave: octave2 } = parseNote(note2);

// Calculate the semitone difference based on letter positions in the smap array
const semitone1 = smap.indexOf(letter1);
const semitone2 = smap.indexOf(letter2);

// Account for octave difference (12 semitones per octave)
const octaveDiff = (octave2 - octave1) * 12;

// Calculate semitone difference considering both letter position and octave
return semitone2 - semitone1 + octaveDiff;
}

function noteFreq(note, tune = "A4=440"){
tune = tine.split("=");
tuningnote = tune[0];
tuningfreq = tune[1];
var [tuningnote,tuningfreq] = tune.split("=");
return modc(tuningfreq, 100*sdiff(tuningnote, note))
}
10 changes: 5 additions & 5 deletions icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<html>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxanium:wght@200&display=swap" rel="stylesheet">


<link rel="prefetch" href="pause.svg">
<link rel="stylesheet" href="i.css">
<link rel="manifest" href="manifest.json">
Expand Down

0 comments on commit 78c8f89

Please sign in to comment.