Permalink
Browse files

Merge branch 'midicomponent'

  • Loading branch information...
eelco committed Jun 30, 2016
2 parents d6e849a + 5eb5d46 commit adf5b33b65d7a4d612e8be8b0b8f70f9082545e3
Showing with 6 additions and 6 deletions.
  1. +1 −1 framer/Framer.coffee
  2. +5 −5 framer/{MIDIControl.coffee → MIDIComponent.coffee}
View
@@ -16,7 +16,7 @@ Framer.Animation = (require "./Animation").Animation
Framer.AnimationGroup = (require "./AnimationGroup").AnimationGroup
Framer.Screen = (require "./Screen").Screen
Framer.Align = (require "./Align").Align
Framer.MIDIControl = (require "./MIDIControl").MIDIControl
Framer.MIDIComponent = (require "./MIDIComponent").MIDIComponent
Framer.print = (require "./Print").print
# Components
@@ -3,9 +3,9 @@
{Events} = require "./Events"
{MIDIInput} = require "./MIDIInput"
Events.MIDIControlValueChange = "MIDIControlValueChange"
Events.MIDIComponentValueChange = "MIDIComponentValueChange"
class MIDIControl extends BaseClass
class MIDIComponent extends BaseClass
@define "min", @simpleProperty("min", 0)
@define "max", @simpleProperty("max", 127)
@@ -45,11 +45,11 @@ class MIDIControl extends BaseClass
info = _.defaults info,
type: "note"
@emit(Events.MIDIControlValueChange, @_modulate(data2), info)
@emit(Events.MIDIComponentValueChange, @_modulate(data2), info)
_modulate: (value) ->
Utils.modulate(value, [0, 127], [@min, @max])
onValueChange: (cb) -> @on(Events.MIDIControlValueChange, cb)
onValueChange: (cb) -> @on(Events.MIDIComponentValueChange, cb)
exports.MIDIControl = MIDIControl
exports.MIDIComponent = MIDIComponent

0 comments on commit adf5b33

Please sign in to comment.