Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into unit-testing-improv…
Browse files Browse the repository at this point in the history
…ements

* origin/master:
  Updates codemirror-infusion dependency
  Fixes gh-116: Renames midi-input-selector to midi-port-selector.
  Fixes gh-202: Fixes bug in playBuffer where the buffer didn't reset when re-triggered.
  gh-190: Updates built files.
  Fixes gh-200: Adds support for very short attack/decay times.
  gh-198: Updates midi examples to support npm 3.
  Fixes gh-193: Corrects the order of MSB and LSB when reading 14-bit MIDI values.
  GH-190: Updated `flock.band` to use `flock.noteTarget` as the target grade.
  GH-190: Updated `flock.band` to use an invoker.
  Adds support for receiving MIDI sysex messages.
  gh-169: Improves logging output of MIDI messages.
  Fixes gh-169: Factors midi logging into a reusable view component.
  gh-115: Adds support for selecting output ports to flock.ui.midiConnector. Basic, working raw MIDI send demo.
  gh-168: Adds support for all MIDI system messages except sysex and MTC.
  Splits flock.midi.controller out into its own file.
  Adds todo comments to midi.controller.
  Adds a way to send static values in a midi map. Additional comments for EnvGen.
  Adds support for multiple mappings for a MIDI single note or control.
  Adds an afterConnectionReady event to midiConnector. Ensures all midi-related IoC references correctly resolve.
  gh-169: Basic sketch of MIDI logging component, currently hardcoded into the midi demo.
  • Loading branch information
colinbdclark committed Dec 22, 2016
2 parents 5b0d67c + 18e94e6 commit 317bf04
Show file tree
Hide file tree
Showing 26 changed files with 5,164 additions and 3,191 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = function(grunt) {
"src/web/buffer-writer.js",
"src/web/input-device-manager.js",
"src/web/midi.js",
"src/midi/controller.js",
"src/web/native-node-manager.js",
"src/web/output-manager.js",
"src/ugens/core.js"
Expand Down
71 changes: 0 additions & 71 deletions demos/midi/index.html

This file was deleted.

87 changes: 87 additions & 0 deletions demos/midi/receive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<style>
#midiMessageRegion {
font-family: monospace;
}
</style>

<title>Flocking MIDI Input Demo</title>

<link rel="stylesheet" type="text/css" href="../../shared/css/demos.css" />
<link rel="stylesheet" type="text/css" href="../../../src/ui/shared/css/flocking-icon-font.css" />
<link rel="stylesheet" href="../../../node_modules/codemirror/lib/codemirror.css" />
<link rel="stylesheet" type="text/css" href="../../../src/ui/editor/css/editor.css" />

<script src="../../../node_modules/jquery/dist/jquery.js"></script>

<script src="../../../node_modules/infusion/src/framework/core/js/Fluid.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDebugging.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidIoC.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/DataBinding.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/ModelTransformation.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/ModelTransformationTransforms.js"></script>
<script src="../../../node_modules/infusion/src/framework/enhancement/js/ContextAwareness.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDocument.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDOMUtilities.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidView.js"></script>

<script src="../../../third-party/webarraymath/js/webarraymath.js"></script>
<script src="../../../third-party/simjs/js/random-0.26.js"></script>

<script src="../../../src/core.js"></script>
<script src="../../../src/node-list.js"></script>
<script src="../../../src/evaluators.js"></script>
<script src="../../../src/synths/model.js"></script>
<script src="../../../src/synths/group.js"></script>
<script src="../../../src/synths/polyphonic.js"></script>
<script src="../../../src/buffers.js"></script>
<script src="../../../src/audiofile.js"></script>
<script src="../../../src/audiofile-encoder.js"></script>
<script src="../../../src/scheduler.js"></script>
<script src="../../../src/web/webaudio-core.js"></script>
<script src="../../../src/web/audio-system.js"></script>
<script src="../../../src/web/buffer-writer.js"></script>
<script src="../../../src/web/input-device-manager.js"></script>
<script src="../../../src/web/midi.js"></script>
<script src="../../../src/midi/controller.js"></script>
<script src="../../../src/web/native-node-manager.js"></script>
<script src="../../../src/web/output-manager.js"></script>
<script src="../../../src/parser.js"></script>

<script src="../../../src/ugens/core.js"></script>
<script src="../../../src/ugens/bandlimited.js"></script>
<script src="../../../src/ugens/envelopes.js"></script>
<script src="../../../src/ugens/midi.js"></script>

<script src="../../../src/ui/selectbox/js/selectbox.js"></script>
<script src="../../../src/ui/midi/midi-port-selector/js/midi-port-selector.js"></script>
<script src="../../../src/ui/midi/midi-connector/js/midi-connector.js"></script>
<script src="../../../src/ui/midi/message-view/js/message-view.js"></script>

<script src="../../../node_modules//codemirror/lib/codemirror.js"></script>
<script src="../../../node_modules/codemirror-infusion/src/codemirror-infusion.js"></script>

<script src="midi-receive-demo.js"></script>
</head>

<body>
<main>
<h1>Flocking MIDI Input Demo</h1>
<p class="instructions">This demo allows you to select a MIDI controller from the dropdown menu.
Note events from the selected controller will trigger the envelope of a Flocking synth.</p>

<div id="midi-port-selector"></div>

<div id="midiMessageRegion"></ul>
</main>

<script>
window.midiDemo = flock.midiDemo("main");
</script>
</body>
</html>
47 changes: 20 additions & 27 deletions demos/midi/midi-demo.js → demos/midi/receive/midi-receive-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@
(function () {
"use strict";

var environment = flock.init();
flock.init();

fluid.defaults("flock.midiDemo", {
gradeNames: "fluid.viewComponent",

components: {
enviro: "{flock.enviro}",

midiMessageView: {
type: "flock.ui.midiMessageView",
container: "{that}.dom.messageRegion"
},

midiConnector: {
type: "flock.ui.midiConnector",
container: "{that}.container",
container: "{that}.dom.midiPortSelector",
options: {
components: {
connection: {
options: {
sysex: true
}
}
},

listeners: {
noteOn: {
func: "{synth}.noteOn",
Expand All @@ -41,35 +54,15 @@
onCreate: [
"{that}.enviro.start()"
]
},

selectors: {
midiPortSelector: "#midi-port-selector",
messageRegion: "#midiMessageRegion"
}
});


// Imperative equivalent to the above.
flock.programmaticMIDIDemo = function (container) {
var that = {
midiConnector: flock.ui.midiConnector(container),
synth: flock.midiDemo.synth()
};

that.midiConnector.events.noteOn.addListener(function (noteEvent) {
that.synth.noteOn(noteEvent.note, {
"freq.note": noteEvent.note,
"amp.velocity": noteEvent.velocity,
"env.gate": 1.0
});
});

that.midiConnector.events.noteOff.addListener(function (noteEvent) {
that.synth.noteOff(noteEvent.note);
});

environment.start();

return that;
};


fluid.defaults("flock.midiDemo.synth", {
gradeNames: ["flock.synth.polyphonic"],

Expand Down
85 changes: 85 additions & 0 deletions demos/midi/send/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<style>
.cm-s-flockingcm.CodeMirror {
width: 55em;
}
</style>

<title>Flocking Raw MIDI Send Demo</title>

<link rel="stylesheet" type="text/css" href="../../shared/css/demos.css" />
<link rel="stylesheet" type="text/css" href="../../../src/ui/shared/css/flocking-icon-font.css" />
<link rel="stylesheet" href="../../../node_modules/codemirror/lib/codemirror.css" />
<link rel="stylesheet" type="text/css" href="../../../src/ui/editor/css/editor.css" />

<script src="../../../node_modules/jquery/dist/jquery.js"></script>

<script src="../../../node_modules/infusion/src/framework/core/js/Fluid.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDebugging.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidIoC.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/DataBinding.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/ModelTransformation.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/ModelTransformationTransforms.js"></script>
<script src="../../../node_modules/infusion/src/framework/enhancement/js/ContextAwareness.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDocument.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidDOMUtilities.js"></script>
<script src="../../../node_modules/infusion/src/framework/core/js/FluidView.js"></script>

<script src="../../../third-party/webarraymath/js/webarraymath.js"></script>
<script src="../../../third-party/simjs/js/random-0.26.js"></script>

<script src="../../../node_modules/codemirror/lib/codemirror.js"></script>
<script src="../../../node_modules/codemirror-infusion/src/codemirror-infusion.js"></script>


<script src="../../../src/core.js"></script>
<script src="../../../src/node-list.js"></script>
<script src="../../../src/evaluators.js"></script>
<script src="../../../src/synths/model.js"></script>
<script src="../../../src/synths/group.js"></script>
<script src="../../../src/synths/polyphonic.js"></script>
<script src="../../../src/buffers.js"></script>
<script src="../../../src/audiofile.js"></script>
<script src="../../../src/audiofile-encoder.js"></script>
<script src="../../../src/scheduler.js"></script>
<script src="../../../src/web/webaudio-core.js"></script>
<script src="../../../src/web/audio-system.js"></script>
<script src="../../../src/web/buffer-writer.js"></script>
<script src="../../../src/web/input-device-manager.js"></script>
<script src="../../../src/web/midi.js"></script>
<script src="../../../src/midi/controller.js"></script>
<script src="../../../src/web/native-node-manager.js"></script>
<script src="../../../src/web/output-manager.js"></script>
<script src="../../../src/parser.js"></script>

<script src="../../../src/ugens/core.js"></script>
<script src="../../../src/ugens/bandlimited.js"></script>
<script src="../../../src/ugens/envelopes.js"></script>
<script src="../../../src/ugens/midi.js"></script>

<script src="../../../src/ui/selectbox/js/selectbox.js"></script>
<script src="../../../src/ui/midi/midi-port-selector/js/midi-port-selector.js"></script>
<script src="../../../src/ui/midi/midi-connector/js/midi-connector.js"></script>

<script src="send-midi-demo.js"></script>
</head>

<body>
<main>
<h1>Flocking Raw MIDI Send Demo</h1>
<p class="instructions">This demo allows you to send raw MIDI messages to a device.</p>
<div id="midi-port-selector"></div>
<div id="code"></div>
<p><button class="send">Send</button></p>
</main>

<script>
window.rawMIDISender = flock.demo.rawMIDISender("main");
</script>
</body>
</html>
Loading

0 comments on commit 317bf04

Please sign in to comment.