Skip to content

Commit

Permalink
OSC mostly working.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwilso committed Jun 15, 2012
1 parent a73d8be commit 57f1e6c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h6>Oscillator</h6>
</section>
</div> <!-- /#main -->

<div id="output">
<div id="output" class="destination">
<div class="node node-input"><span class="node-button">&nbsp;</span></div>
</div> <!-- /#output -->

Expand Down
20 changes: 19 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,29 @@ function addModuleSlider( element, label, value, min, max, units ) {

function createOscillator() {
var osc = createNewModule( "oscillator", false, true );
osc.className += " has-footer";
$( addModuleSlider( osc, "frequency", 440, 0, 8000, "Hz" ) ).slider();
$( addModuleSlider( osc, "detune", 0, -1200, 1200, "cents" ) ).slider();
// TODO: add play button

osc = osc.parentNode;
osc.className += " has-footer";

// Add footer element
// Add select element and type options

var oscNode = audioContext.createOscillator();
oscNode.frequency = 440;
oscNode.detune = 0;
oscNode.type = oscNode.SINE;
osc.audioNode = oscNode;
// oscNode.noteOn(0);
}






function hitplay(e) {
e = e.target.parentNode; // the node element, not the play button.

Expand Down

0 comments on commit 57f1e6c

Please sign in to comment.