Creating Custom Mapping - adamjberg/RIME GitHub Wiki

#Mapping Instructions

While the plan to implement a mapping GUI is in place, in the mean time, mappings can easily be made by modifying a JSON file within the mappings folder. This tutorial will walk you through the process of creating your own custom mapping.

To create your own custom RIME/ViPer mapping you will first want to be familiar with all of the possible functions of ViPer. The detailed list of ViPer functionality can be found here :

https://github.com/isha/Viper/wiki

ViPer commands are triggered by events sent from RIME. There are two ways to trigger an event: Monitoring changes in a Sensor, or a user defined Gesture. Lets go through the mapping1.json file included in your installation of ViPer found here: INSERT LOCATION

##Sensor Event Mapping:

###eventTriggerType: These are the two different ways to trigger an event: sensor or gesture

###sensor: Any of the following sensors can be used in this field for both iOS and Android: LinearAccelerometer, Accelerometer, AmbientTemperature, Gravity, Humidity, Light, Magnetic, Orientation, Pressure, Proximity, Rotation.

###valueIndex: This specifies the index of data from the selected sensor to use. For example, the Accelerometer returns 3 values: X, Y, and Z. You can use a valueIndex of 0, 1, or 2 to access these respectively.

The next 3 fields are specific to the way the target ViPer manipulation you are attempting to map the sensor to. These will change depending on which event you want to trigger.

###targetFields: this is the name of the ViPer manipulation technique you would like to apply to your image, in this case we are going to effect the transperency of the image.

###minOutputs and maxOutputs: These will decide how sensitive your sensor is to the event. A large difference between max and min outputs will result in a more precise control of the effect and vise versa. Try playing around with these values, or even inverting them! You can get some pretty fun results.

###intervalInMS: The interval, in milliseconds, at which events will be sent to ViPER. In this case, every 40 milliseconds the sensor data from the phone's orientation sensor will be sent to ViPer.

##Gesture Event Mapping:

###eventTriggerType: Same as above

###gestureId: This number should be increased by 1 for every new gesture made. As you record gestures within RIME, (see record gestures section), they will automatically increase their IDs by 1 starting from 0. So the first gesture that you record in RIME after loading your new custom mapping to the device, will map to the gestureID:0. This is a temporary solution for this functionality.

###commands: This is where you decide what ViPer command this gesture will be mapped to. Which targetFields and targetOutputs will depend on the ViPer command that you would like to trigger.

⚠️ **GitHub.com Fallback** ⚠️