Skip to content

Commit

Permalink
Merge branch 'midicomponent'
Browse files Browse the repository at this point in the history
  • Loading branch information
eelco committed Jun 30, 2016
2 parents d6e849a + 5eb5d46 commit adf5b33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion framer/Framer.coffee
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions framer/MIDIControl.coffee → framer/MIDIComponent.coffee
Expand Up @@ -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)
Expand Down Expand Up @@ -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.