Class: Nerpin::Nrpn::Micron

Inherits:
Base
  • Object
show all
Defined in:
lib/nerpin/nrpn/micron.rb

Instance Attribute Summary

Attributes inherited from Base

#id, #key, #max, #min

Instance Method Summary collapse

Methods inherited from Base

find_by_key, #initialize, nrpns, #sample, #value_at

Constructor Details

This class inherits a constructor from Nerpin::Nrpn::Base

Instance Method Details

#value(value) ⇒ Object



4
5
6
7
8
9
# File 'lib/nerpin/nrpn/micron.rb', line 4

def value(value)
  {
    :v0x06 => (value >= 0) ? value / 128 : 127 - (value.abs / 128),
    :v0x26 => (value >= 0) ? value % 128 : 128 - (value.abs % 128)
  }
end