• SONAR
  • Mod Wheel data (p.2)
2014/04/28 18:47:36
robert_e_bone
@wizard71 - "I've been scared of numbers ever since i opened a joint bank account with my wife :)"
 
Nothing to be scared of - it's all HERS, so literally there is NOTHING to be afraid of.  (except her).
 
I just responded to your PM, and sent you the script.  Maybe 15 lines of code, half of which were closing ')'.
 
Bob Bone
 
2014/04/28 18:48:43
Anderton
There can be no other possible explanation regarding scook other than that he has mind-melded with Sonar.
2014/04/28 18:55:05
scook
IDK, there is so much of SONAR I don't use and don't understand but it is hard not to pick up pieces here and there after a decade or so of using this stuff. CAL has not changed in years. I did not suggest it from the outset because it is not real-time.
2014/04/28 19:13:55
robert_e_bone
I have actually amassed a pretty sizable set of doc on using CAL.
 
The kind of thing you were trying to do is super simple, as it is basically a loop through the events, and then just a set of tests to see if the event it is looking at it: 1 - a controller event, 2 - a mod-wheel type of controller event, and 3 - set to a value above the input value, followed by setting it to the input value if appropriate.
 
Existing CAL scripts in the included ones with X3 already have event-looping logic, and at least one of the scripts checks for mod wheel events, so I just pretty much mixed and matched and TA DA.
 
Bob Bone
 
2014/04/29 07:06:32
wizard71
Thanks very much Bob, this works just as described, very useful indeed :)
2014/04/29 08:00:52
robert_e_bone
Glad I could help - that one was easy.  If anyone else has CAL needs, I would be happy to give them a shot - no guarantees on my being able to reanimate dead tissue, but you never know, so for your CAL needs - post em if ya got em.
 
Bob Bone
 
2014/04/30 04:49:17
wizard71
Hi Bob, I have another CAL question....
 
If i was to draw a crescendo with CC1 from 0-100 using 100 CC1 commands and then use your CAL script to limit data to 90, then the last 10 data points are all compressed to 90 creating a flat line. Is it possible to maintain the crescendo shape by beginning the data at -10 so only the last 90 count? 
Ive a feeling this isnt possible as its outside the range but hey, you never know :)
 
Bibs
2014/04/30 11:14:52
robert_e_bone
The script I wrote is pretty stupid - meaning there is not much logic involved.  It only directly applied to the original question you had posed.
 
It does not care anything whatsoever about 'range', and literally only blindly sets anything found above the entered input value to that value.  This is why those last 10 events would all be set to a flat line.
 
I understand that you get a flat line for whatever events are found in excess of the value you input, but do not understand from your comment "Is it possible to maintain the crescendo shape by beginning the data at -10 so only the last 90 count? ".
 
It is easy enough to alter the script, but I need to better understand how you want the values changed.
 
Here is the current logic of the script:
 
1.  Get an input value from the user, that will represent the maximum allowable mod wheel level.
2.  Loop through all events for the selected midi track, with the following applied to every event.
3.  IF event is a Controller event, of type '1' (standard mod wheel CC), AND the level exceeds the input level entered by the user, set the mod wheel event level to that of the input level.
 
That's it.  That's all it does.
 
So, I am happy to change this to try to fit whatever your needs are - I just need to better understand what exactly you need it to do.
 
As it stands now, any curve that is in place up to the max allowable level that you input is preserved, since the script does not operate on any event that has a mod wheel level value that is less than that input value.
 
Let's examine a scenario, for the last 15 events of mod wheel event data for a given midi track, so here are the levels for those 15 events, before processing the script:
 
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
 
OK, so the above is a nice smooth curve.  After processing the script, with you inputting a maximum allowable level of 98, you end up with:
 
90 91 92 93 94 95 96 97 98 98 98 98 98 98 98
 
This is per the original spec to which the script was written.
 
Please list for me how you would rather see the data look after processing, starting from the original list prior to processing.  I will cheerfully make whatever adjustments you need.
 
It almost seems like what you are looking for is a general alteration of the whole SCALE of the level, across its entire range.  If so, I am not sure how I would accomplish that, since the levels appear to only be whole number values, and a scale redefinition would seem to me to require fractional values for some of the calculated percentages.
 
Again, if you could list the level values you would like to see - using the events from the 1st set I posted above as the starting point(90-114), I can change the script to try to accommodate that.
 
Thanks, 
 
Bob Bone
 
 
 
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account