Skip to content

Commit

Permalink
OSC now replicated.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwilso committed Jun 15, 2012
1 parent 57f1e6c commit df6258e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ body {
margin: 0;
}

.control-group:last-of-type {
margin: 0;
}

/* Slider */
.slider-info {
font-size: .625em; /* 10 / 16 */
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ <h6>Gain</h6>
</div>

<!-- Oscillator -->
<div style="left:750px; top: 450px;" class="module oscillator has-footer">
<!-- <div style="left:750px; top: 450px;" class="module oscillator has-footer">
<div class="content">
<h6>Oscillator</h6>
<div class="control-group">
Expand Down Expand Up @@ -242,6 +242,7 @@ <h6>Oscillator</h6>
<div class="node node-output"><span>&nbsp;</span></div>
<a href="#" class="close">x</a>
</div>
-->
</section>
</div> <!-- /#main -->

Expand Down
26 changes: 26 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ function createNewModule( nodeType, input, output ) {
e.outputs = i;
}

var close = document.createElement("a");
close.href = "#";
close.className = "close";
e.appendChild( close );

// add the node into the soundfield
document.getElementById("modules").appendChild(e);
return(content);
Expand Down Expand Up @@ -86,6 +91,27 @@ function createOscillator() {
osc.className += " has-footer";

// Add footer element
var footer = document.createElement("footer");
var sel = document.createElement("select");
sel.className = "osc-type";
var opt = document.createElement("option");
opt.appendChild( document.createTextNode("sine"));
sel.appendChild( opt );
opt = document.createElement("option");
opt.appendChild( document.createTextNode("square"));
sel.appendChild( opt );
opt = document.createElement("option");
opt.appendChild( document.createTextNode("sawtooth"));
sel.appendChild( opt );
opt = document.createElement("option");
opt.appendChild( document.createTextNode("triangle"));
sel.appendChild( opt );
opt = document.createElement("option");
opt.appendChild( document.createTextNode("wavetable"));
sel.appendChild( opt );
footer.appendChild( sel );
osc.appendChild( footer );

// Add select element and type options

var oscNode = audioContext.createOscillator();
Expand Down

0 comments on commit df6258e

Please sign in to comment.