Symphony of Math.PI
How do I make an symphony of math.pi?
Made using riffwave.js inspired by http://codepen.io/rjd2/pen/xDaCA. What is a symphony of math.pi? How do you make a symphony of math.pi? This script and codes were developed by Marius Balaj on 07 July 2022, Thursday.
Symphony of Math.PI - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Symphony of Math.PI</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div onclick="playPI()"> <span>+---------------------------------------+</span> <span>| Click to play the symphony of Math.PI |</span> <span>+---------------------------------------+</span>
<span id="pi"></span>
</div> <script src='http://js.do/sound/js/riffwave.js'></script> <script src="js/index.js"></script>
</body>
</html>
Symphony of Math.PI - Script Codes CSS Codes
body { background: #000000; color: #00FF00; font-family: monospace;}
div { width:100%; font-family:Courier New; font-size:14px; text-align:center; position:absolute; top:50%; -webkit-transform:translateY(-50%); transform:translateY(-50%); cursor:pointer; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
}
div span { display:block;
}
div span#pi { margin:15px 0 0;
}
Symphony of Math.PI - Script Codes JS Codes
document.getElementById('pi').innerHTML = Math.PI;
var makeNote = function(frequency) { var audio = new Audio(); var wave = new RIFFWAVE(); var data = []; wave.header.sampleRate = 44100; var time = 0.5; for (var i = 0; i < wave.header.sampleRate * time; i++) { data[i] = Math.round(128 + 127 * Math.sin(i * 2 * Math.PI * frequency / wave.header.sampleRate)); } wave.Make(data); audio.src = wave.dataURI; return audio;
};
var sing = function(note) { var note = makeNote(note); note.play();
};
var $0 = 261.63, // DO $1 = 293.66, // RE $2 = 329.63, // MI $3 = 349.23, // FA $4 = 392, // SOL $5 = 220 * 2, // LA $6 = 246.94 * 2, // SI $7 = $0 * 2, // DO $8 = $1 * 2, // RE $9 = $2 * 2; // MI
// MATH.PI
var song = [$3, $1, $4, $1, $5, $9, $2, $6, $5, $3, $5, $8, $9, $7, $9, $3];
var playPI = function() { var i = 0; setInterval(function() { if(i <= song.length ){ sing(song[i]); i++ } }, 500);
}
Developer | Marius Balaj |
Username | mariusbalaj |
Uploaded | July 07, 2022 |
Rating | 3.5 |
Size | 2,355 Kb |
Views | 50,600 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Pythagorean theorem animation | 2,602 Kb |
Adi.js | 3,555 Kb |
Metro UI animations | 3,146 Kb |
Imperial March | 3,190 Kb |
Apple TV poster | 2,957 Kb |
Folding Effect on Hover | 3,317 Kb |
Simple Parallax with jQuery | 2,277 Kb |
One element Vinyl | 2,296 Kb |
Flat iPhone with Next Post Animation | 3,283 Kb |
Codepen CSS Illustration | 2,818 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Animated Slide Hamburger Mobile Menu | BJack | 2,247 Kb |
Transitioning application screens with semantically named classes | Djgrant | 3,697 Kb |
CSS3 Snow Animation | NickyCDK | 1,695 Kb |
Cool audio | Bigliam | 1,868 Kb |
Loading... | Adamjacob | 2,384 Kb |
Mega menu | DimaZubkov | 5,066 Kb |
Flower expansion | Sreucherand | 3,425 Kb |
Ball Physics | Getsetbro | 3,149 Kb |
Static Image to Video Block | Grayghostvisuals | 4,864 Kb |
AngularJS Datalist Directive | M-e-conroy | 2,366 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!