Code 7

Size
2,837 Kb
Views
22,264

How do I make an code 7?

Drop a line and press play. You can use all Math functions directly.. What is a code 7? How do you make a code 7? This script and codes were developed by André Michelle on 18 October 2022, Tuesday.

Code 7 Previews

Code 7 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Code 7</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Code 7</h1>
<h5>drop your music</h5>
<input type="button" onclick="togglePlayback();" value="START" id="toggle-button"></input><canvas id="waveform" width="384" height="32"></canvas>
<textarea type="text" oninput="compile();" onLoad="focus(this);" onBlur="focus(this);" name="dsp" id="dsp"></textarea>
<label id="message"></label> <script src="js/index.js"></script>
</body>
</html>

Code 7 - Script Codes CSS Codes

html, body { background: #1A1A1A; margin: 0; padding: 16px; width: 90%; height: 80%; color: #16d6ff; font-size: 16px; font-family: "Open Sans"; overflow: hidden;
}
h1 { line-height: 0px;
}
textarea#dsp { width: 99%; height: 5em; color: #16d6ff; font-size: 12px; line-height: 14px; background: black; border-width: 0; margin: 0; padding: 4px; border: none; overflow: auto; outline: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; resize: none;
}
textarea::selection { background: #999999;
}
canvas { float: right; background-color: black;
}
input#toggle-button { width: 64px; height: 32px; border: 0; color: #16d6ff; margin-bottom: 8px; background: black; border-color: transparent; cursor: pointer; outline: 0;
}
label { color: #ff6616; font-size: 10px;
}

Code 7 - Script Codes JS Codes

// Minimal Audio Driver
//
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
var sampleRate = audioContext.sampleRate;
var seconds = 0.0;
var scriptProcessor = audioContext.createScriptProcessor( 2048, 1, 1 );
var bufferSize = scriptProcessor.bufferSize;
scriptProcessor.onaudioprocess = function ( event )
{ var data = event.outputBuffer.getChannelData( 0 ); for( var i = 0 ; i < bufferSize ; ++i ) data[i] = f( seconds += 1.0 / sampleRate ); render(data);
};
var e = document.getElementById( "dsp" );
var m = document.getElementById( "message" );
var b = document.getElementById( "toggle-button" );
var w = document.getElementById( "waveform" );
var f = function (t) { return 0.0 };
var isPlaying = false;
function togglePlayback()
{ if( isPlaying ) { scriptProcessor.disconnect( audioContext.destination ); isPlaying = false; b.value = "PLAY"; } else { seconds = 0.0; scriptProcessor.connect( audioContext.destination ); isPlaying = true; b.value = "STOP"; }
}
function render(values)
{ var width=w.width; var height=w.height; var heightHalf=height/2; var ratio=bufferSize/width; var ctx=w.getContext("2d"); ctx.clearRect(0,0,width,height); ctx.lineWidth=0.0; ctx.strokeStyle='#16d6ff'; ctx.beginPath(); ctx.moveTo(0,heightHalf+values[0]*heightHalf); for(var x=0;x<width;++x) ctx.lineTo(x,heightHalf+Math.min(1,Math.max(-1,values[Math.floor(x*ratio)]))*heightHalf); ctx.stroke();
}
function compile()
{ try{f=new Function('t',"with(Math){"+e.value+"}");m.innerHTML="";} catch(e){m.innerHTML=e.message;}
}
e.value="var q=1-(t*2.15)%1,s=sin,p=pow;\nreturn s(24*p(q,24))*.9+3*s(p((q*4)%1,5)*3)*min(.1,max(-.1,(6+s(t*.5)*3)*s(40*(1+q)*s(690+q*3))));";
e.focus();
compile();
Code 7 - Script Codes
Code 7 - Script Codes
Home Page Home
Developer André Michelle
Username andremichelle
Uploaded October 18, 2022
Rating 4
Size 2,837 Kb
Views 22,264
Do you need developer help for Code 7?

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!

André Michelle (andremichelle) Script Codes
Create amazing blog posts with AI!

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!