In my motherboard_def.lua I have:
Code: Select all
custom_properties = jbox.property_set{
rt_owner = {
properties = {
noteVelocity = jbox.number{
default = 0,
ui_name = jbox.ui_text( "text_noteVelocity" ),
ui_type = jbox.ui_linear( { min = 0, max = 127, units= {{decimals=0}} } ),
}
}
}
...
Code: Select all
void CTriggerHappy::HandleNotePressed( const TJBox_PropertyDiff iPropertyDiffs[], TJBox_UInt32 iDiffCount ){
for( TJBox_UInt32 i = 0; i < iDiffCount; ++i ){
if( iPropertyDiffs[ i ].fPropertyRef.fObject == fNoteStates ){
TJBox_Float64 velocity = JBox_GetNumber( iPropertyDiffs[ i ].fCurrentValue );
JBox_StoreMOMPropertyAsNumber( fNoteVelocityPropertyRef, JBox_MakeNumber( velocity ) );
}
}
}
Code: Select all
0000000000000000 20210615-175031.612 Device instance failed: An error has occurred in device 'thappy 1' (Trigger Happy)
ModFunc: RenderRealtime
HostFunc: JBox_StoreMOMProperty
Message: Could not store property: Value out of range (Object: 0, Property Name: 'noteVelocity')