Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 11-10-2018, 06:28 PM   #1
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default scripts generating ReaLearn compatible json for midi mappings

Having a lua/pythong script which would analyze current project, then based on rules, generating a ReaLearn json file, or directly copying into clipboard, so ReaLearn can import from clipboard. Here an example with two mappings:


PHP Code:
{
  
"alwaysAutoDetectMode"true,
  
"letMatchedEventsThrough"false,
  
"letUnmatchedEventsThrough"true,
  
"mappings": [
    {
      
"controlIsEnabled"true,
      
"feedbackIsEnabled"true,
      
"mode": {
        
"eelControlTransformation""",
        
"eelFeedbackTransformation""",
        
"ignoreOutOfRangeSourceValuesIsEnabled"false,
        
"maxSourceValue"1,
        
"maxTargetJump"1,
        
"maxTargetValue"1,
        
"minSourceValue"0,
        
"minTargetJump"0,
        
"minTargetValue"0,
        
"reverseIsEnabled"false,
        
"roundTargetValue"false,
        
"scaleModeEnabled"false,
        
"type"0
      
},
      
"name""1",
      
"source": {
        
"channel"5,
        
"type"3
      
},
      
"target": {
        
"enableOnlyIfFxHasFocus"false,
        
"enableOnlyIfTrackIsSelected"false,
        
"fxIndex"15,
        
"isInputFx"false,
        
"paramIndex"2,
        
"type"1
      
}
    },
    {
      
"controlIsEnabled"true,
      
"feedbackIsEnabled"true,
      
"mode": {
        
"eelControlTransformation""",
        
"eelFeedbackTransformation""",
        
"ignoreOutOfRangeSourceValuesIsEnabled"false,
        
"maxSourceValue"1,
        
"maxTargetJump"1,
        
"maxTargetValue"1,
        
"minSourceValue"0,
        
"minTargetJump"0,
        
"minTargetValue"0,
        
"reverseIsEnabled"false,
        
"roundTargetValue"false,
        
"scaleModeEnabled"false,
        
"type"0
      
},
      
"name""2",
      
"source": {
        
"channel"5,
        
"type"3
      
},
      
"target": {
        
"enableOnlyIfFxHasFocus"false,
        
"enableOnlyIfTrackIsSelected"false,
        
"fxIndex"16,
        
"isInputFx"false,
        
"paramIndex"0,
        
"type"1
      
}
    }
  ],
  
"sendFeedbackOnlyIfArmed"true

The problem is ReaLearn does not care of any names, just using fxIndex (number in chain, starting at 0) and paramIndex (parameter number, also starting at 0). So this lua analysis tool, could present an overview of fxIndex and paramIndex for each track. There should be a 'excel like formula field' which would apply this formula to the targets.

Not sure how this could be designed bestly, but knowing how you want to map everything, and having json import for ReaLearn, there should be better mapping techniques.

Example: Track 1 using ch1. Now for the next 15 tracks I would want to do simply ch++. This should be easily possible with that tool. Or I am using x for some mapping, but want x+1 for the next 16 tracks. Incrementing some value over tracks, or just shifting the value over tracks.
TonE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.