User defined array of values returned by slider
-
@Lindon I see. So what I would do is in the function I would check the mode of the slider, if it's one of the special modes then I would show the special values, if it's a mode where you want the default behaviour, you can just return the input value without modification.
-
@d-healey said in User defined array of values returned by slider:
@Lindon I see. So what I would do is in the function I would check the mode of the slider, if it's one of the special modes then I would show the special values, if it's a mode where you want the default behaviour, you can just return the input value without modification.
Well sadly that doesnt work on at least a couple of levels:
- There are no "special modes" there's only the std modes ....
- And if I want the default behaviour, i.e. input = a value, output = that value as a string Then this doesnt work when its tempoSync: so input = 1.0 output = "1.0" - is wrong as output would need to be "1/1" (for one bar sync).
-
@Lindon said in User defined array of values returned by slider:
There are no "special modes" there's only the std modes ....
By special modes I meant the one's you want to create with your arrays of values. I don't see it being any extra work to create the array in the script rather than in the property editor.
For tempo sync there is a built in function to convert the index of the tempo,
Engine.getTempoName();
-
@d-healey said in User defined array of values returned by slider:
@Lindon said in User defined array of values returned by slider:
There are no "special modes" there's only the std modes ....
By special modes I meant the one's you want to create with your arrays of values. I don't see it being any extra work to create the array in the script rather than in the property editor.
For tempo sync there is a built in function to convert the index of the tempo,
Engine.getTempoName();
okaaaay, Im not sure Im getting the first part - are you saying we need this "new mode"? or are you somehow working out what to do based on some other value? For instance in our example Slider 3 is set to Linear mode - in a number of scenarios, but only in one of those scenarios(PultecEQ) do we want to have anything other than the default returned...how is the function to know we are in PultecEQ "mode" .....I guess it could look at the combobox text....
Actually this is getting very messy very fast. Some sliders need to look up what the FX is , some dont, different ones at differnt times hmm.... its gonna be ugly, none scalable and not DRY
if(FX = "Pulteq and Im Slider 3)
do this
if(FX=Pulteq and Im slider 7)
do something else
if(Mode= tempoSync)
do that..and all we have done is handle one of the "slightly different" FX options...
Edit:::: actually I have to do some work to get Frequency mode to display properly too... I dont want to see "10,000" as a value when now Im seeing "10Khz"..
Damn it...... and normalised Percentage, and Pan
Basically Im just reinventing the current default behaviours....
-
@Lindon said in User defined array of values returned by slider:
if(FX = "Pulteq and Im Slider 3)
do this
if(FX=Pulteq and Im slider 7)
do something else
if(Mode= tempoSync)
do thatWouldn't you have to do this even with the user defined mode? Because you still only have one slider.
-
@d-healey said in User defined array of values returned by slider:
@Lindon said in User defined array of values returned by slider:
if(FX = "Pulteq and Im Slider 3)
do this
if(FX=Pulteq and Im slider 7)
do something else
if(Mode= tempoSync)
do thatWouldn't you have to do this even with the user defined mode? Because you still only have one slider.
no... Im keeping an array of properties that every slider needs to use, like this:
{ EffectName:"SOMEFX", EffectHardCodedName:"myFX", NumControls: 4, ControlText: ["Rate","Depth","Feedback","Mix"], ControlTargetNumber: [0,1,2,4], ControlMinimums: [4000,0,0,0], ControlMaximums: [15000,1,.98,1], ControlMultipliers: [1,1,1,1], ControlModes: ["Linear", "NormalizedPercentage","NormalizedPercentage","NormalizedPercentage"], ControlStepSize:[1,0.01,0.01,0.01], ControlSuffix:[" ms"," %"," %"," %"], ControlMiddlePosition:[10000,.5,.5,.5], ControlDefaultValue:[8000,.7,.8,.8], ControlsRow1:4, ControlsRow2:0 },
all I need do is add one more attribute for the Array values I want to use...and its all done for me.. by the default code(lets set up Slider 3 to be "userDefined":
{ EffectName:"SOMEFX", EffectHardCodedName:"myFX", NumControls: 4, ControlText: ["Rate","Depth","CPS","Mix"], ControlTargetNumber: [0,1,2,4], ControlMinimums: [4000,0,0,0], ControlMaximums: [15000,1,3,1], ControlMultipliers: [1,1,1,1], ControlModes: ["Linear", "NormalizedPercentage","UserDefined","NormalizedPercentage"], ControlUserArray: [[],[],[20,30,60,100],[]], ControlStepSize:[1,0.01,0.01,0.01], ControlSuffix:[" ms"," %"," "," %"], ControlMiddlePosition:[10000,.5,2,.5], ControlDefaultValue:[8000,.7,0,.8], ControlsRow1:4, ControlsRow2:0 },
-
@Lindon You could use that same data in the popup function.
Use Linear instead of UserDefined.
In the popup function you check if the ControlUserArray is populated, if it is you use its value, if it isn't you use the default values.
-
@d-healey said in User defined array of values returned by slider:
@Lindon You could use that same data in the popup function.
Use Linear instead of UserDefined.
In the popup function you check if the ControlUserArray is populated, if it is you use its value, if it isn't you use the default values.
Yes so one question and one objection....
Q: so in the function for setValuePopupFunction(f) can I even reference "this"? So I can find out if its ControlUSerArray is set?
Objection: see above: I cant use the "default" - well I can if I want it to look naff - its value in - string out, so Pan Mode will need some processing, as will normailzedPrecentage and Frequency, so in the end this function is just duplicating the existing functionality in the default processing.... so its getting silly I think.
-
@Lindon said in User defined array of values returned by slider:
so in the function for setValuePopupFunction(f) can I even reference "this"? So I can find out if its ControlUSerArray is set?
I don't see why not.
@Lindon said in User defined array of values returned by slider:
Objection: see above: I cant use the "default" - well I can if I want it to look naff - its value in - string out, so Pan Mode will need some processing, as will normailzedPrecentage and Frequency, so in the end this function is just duplicating the existing functionality in the default processing.... so its getting silly I think.
Yeah it's a bit annoying, but you just write a function once to format the result, so not too painful.
HiseSnippet 1132.3ocsV0kbaaCDFT1zMRoMSSmb.vvmja83Jp33+RcihksZzDaGMVNdZdJCDInEFQBvR.5DkNdl7XuA85z6PuH8Fzt.jRj1V0+noUOngX28a2Or.6tnWhviJkhDjUsSFGSQVeoc+wb0v1CILNp6dHqGYeHQpnI3LQ6NNlHkTejk0B+jVfU0EQle+0K1kDR3dzBQHzoBlG8.VDSUHsWqWyBC6P7omvhJY8Zs55I3sEghTfOKX2.ES7FQNidDQaVEazqHxgHqu0twy1ZqFC1bisZDrtqKYys1b8AjFt9q4Q2zkzbq.2MZNXfmGxZo88YJQReEQQkfS2U3Ot+PwG3YA3TljMHjpW3h5CQNSLp8PVneuIIGIBYsXuhT0BYopmXeHymMUdQJ6qMJvEHJmzrpbSTx8dPIqRTZwLJ8X69dIrXUgFMedncWNbBFPfylxTIyVTkCVvts.rfqVMhLh1IAVLEQ80azXEL72xOuVsZvAjTgOmjfeMWLvEuCdBxynp1hnXAGVT2wn0QCw70pRp5TRXJsmHNMtSJ2SwD75AS93bstkq8q0plPUoIbbfHIhjAIS4JYATGl5NQBepyxf2uPGgKyol2HmZNkSM+uhSMmEmX7PFmhm3rYgUCv3d4GXJug35YBpBRp5QjTrSmD5ujR4dic1FjUkEfyvh+AraC3.QKbB4hIIRJbnkSa72gcvu5SNOWaSsBy1meFvqU8EovcrSD8UIL9Y4d86MdcEraF5QF3SISOB2PiKyjc1AeYd3z1DyRg7PhZ3pjAx5Wgh5nLc+z.+BryAN3swNGaNhpV0mFPRCUaWxUFqA2eQsKllYE7iDJ5a30M4xZWTCeUUAAyTm9RRhHLjlLS05dSI2Dv57znAzjUvEWTzFB0hWt.eo6VAtW1c1RFJ3c4L0aho4q6HB80Et5uud6.T9kdnwPkbFBlpLsEdTdag9gLeZBhAN4KrM0SHC4K2wFcmA27Jf+7YsPus6dDEQ2bJmN.EioIJlNSXsG8bXbPVqpp16QkiThXCeyKRgncqL9iErcuViKV7isjpw575RFCQQLe+Pn3Vxzmak2hv3r39rOQKO6Jp7nr28GQjRg4csjoAArOpS8GiBXgQRntItaDLaBY8M1uEpOxushki.GA09in9mHLCszk0HKaan.BIgS2hdN58zKGHNmpS524LPyRYfOO59kArzlE+6st0LvZsJmA9s+bZFv1FZqLm4fGZOsi1+dl35C0fwoB+zPh5xyX0u9HWgd2Udvld3EG10iKu+tGCdabiCduqT7w18zM1mMGqLCNpKc+efi4OW4qr2OHf5oJH3h1c9448sI2R3OVjpfIKPu+DysliRi5COqyiBQmyogfysspn61jstgdsNCzmx8MK9a3WtRW8ZqbktSThhHdIh26k0tR+fnGXj.bhadvXU3kqvZ7LZxAUFr2qeeXYWcMfMmWfOcdAt17B7YyKv0mWfaLu.271Ape97KSUhnrxFD5vd6alqXYsOm.2.M2VQ+CQjqfv.
-
@d-healey said in User defined array of values returned by slider:
Yeah it's a bit annoying, but you just write a function once to format the result, so not too painful.
Yeah its not very DRY