Difference between revisions of "Firmware-72 Function-004"

From I-CubeX Wiki
Jump to: navigation, search
Line 11: Line 11:
 
FP2
 
FP2
 
{|
 
{|
|00000yyy:  
+
|0m00yyyy:
|yyy = [0..7]; Offset low bits
+
|yyyy: [0..15]; Smoothing
 +
|-
 +
|
 +
|m = 0; monitor off
 +
|-
 +
|
 +
|m = 1; monitor on
 
|}
 
|}
 
+
The offset is calculated as a 10-bit value represented by xxxxxxxyyy.
+
When the monitor is enabled, the sensor value is output as a separate MIDI message after the smoothing function (if enabled) but before being processed as configured by the EDIT CONFIG command. The MIDI message is the same as set by the EDIT CONFIG command but, if note or controller messages are used, the note or controller number is incremented by one. If another MIDI message is used the MIDI channel is incremented by one.
 
 
 
Example:
 
Example:
  

Revision as of 19:26, 9 November 2015

ABSOLUTE (4, 04h)

The absolute function provides a way to convert signals that vary around a center value (such as from accelerometers and physiological sensors) to a value from zero. The following methods can be selected using the FUNCTION command’s parameter values FP1 and FP2:

FP1

0xxxxxxx: xxxxxxx = [0..127]; Offset high bits

FP2

0m00yyyy: yyyy: [0..15]; Smoothing
m = 0; monitor off
m = 1; monitor on

When the monitor is enabled, the sensor value is output as a separate MIDI message after the smoothing function (if enabled) but before being processed as configured by the EDIT CONFIG command. The MIDI message is the same as set by the EDIT CONFIG command but, if note or controller messages are used, the note or controller number is incremented by one. If another MIDI message is used the MIDI channel is incremented by one. Example:

In order to output the value generated by a sudden motion of a GForce3D-6 sensor as a MIDI controller 64 message, the following messages are sent (see also the EDIT CONFIG command):

240, 125, 0 {DEV}, 8 {FUNCTION}, 0 {input}, 0 {offset least significant bits}, 4 {absolute function}, 64 {offset MSB}, 247 (F0h, 7Dh, 00h, 08h, 00h, 00h, 04h, 40h, F7h)
240, 125, 0 {DEV}, 106 {EDIT CONFIG}, 1 {configuration number}, 0 {input}, 48 {control-change message}, 64 {controller number}, 34 {peak detection with end notification}, 1 {threshold}, 64 {top}, 0 {noisegate}, 0 {time window}, 247 (F0h, 7Dh, 00h, 6Ah, 01h, 00h, 30h, 40h, 22h, 40h, 7Fh, 00h, 00h, F7h)

The threshold value may need adjustment to properly capture the signal peaks that occur when shaking the GForce3D-6 sensor.