Jump to content

mscelektronik

Member
  • Posts

    5
  • Joined

  • Last visited

mscelektronik's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm working on 10.3.2. Not sure what this bespoken fader() function is used for too..
  2. different approach: is there a way to get the value of the Channel Volume Fader (on which the script is inserted) into scripter?
  3. the main problem with a log slider range of 1-81 will be, that the user won't have any clue how much dB he will boost or attenuate. the only workaround I found so far is to bring logic's smart controls into the game. it's possible to draw a custom curve to get a log type curve for a linear fader. but I definitely would prefer a solution in my script.. btw: here's the code with the lin fader: var PluginParameters = [ {name:"VCA Level [dB]", type:"lin", minValue: -70, maxValue: 10, unit:"dB", numberOfSteps:800, defaultValue:0}, {name:"Trim [dB]", type:"lin", minValue: -6, maxValue: 6, unit:"dB", numberOfSteps:1200, defaultValue:0}, {name:'CH 1', type:'menu', valueStrings:['off','on']}, {name:'CH 2', type:'menu', valueStrings:['off','on']}, {name:'CH 3', type:'menu', valueStrings:['off','on']}, {name:'CH 4', type:'menu', valueStrings:['off','on']}, {name:'CH 5', type:'menu', valueStrings:['off','on']}, {name:'CH 6', type:'menu', valueStrings:['off','on']}, {name:'CH 7', type:'menu', valueStrings:['off','on']}, {name:'CH 8', type:'menu', valueStrings:['off','on']}, {name:'CH 9', type:'menu', valueStrings:['off','on']}, {name:'CH 10', type:'menu', valueStrings:['off','on']}, {name:'CH 11', type:'menu', valueStrings:['off','on']}, {name:'CH 12', type:'menu', valueStrings:['off','on']}, {name:'CH 13', type:'menu', valueStrings:['off','on']}, {name:'CH 14', type:'menu', valueStrings:['off','on']}, {name:'CH 15', type:'menu', valueStrings:['off','on']}, {name:'CH 16', type:'menu', valueStrings:['off','on']} ]; // This is a function function Normalizer(min, max) { return function(val) { return (val - min) / (max - min); } } // This is another function Interpolater(min, max, clamp) { return function(val) { val = min + (max - min) * val; return clamp ? Math.min(Math.max(val, min), max) : val; } } // This is a third function Scale() { var domain = new Normalizer(0, 1); var range = new Interpolater(0, 1); var s = function(val) { return range(domain(val)); }; s.domain = function(min, max) { if (!arguments.length) return domain; domain = new Normalizer(min, max) return s }; s.range = function(min, max, clamp) { if (!arguments.length) return range; range = new Interpolater(min, max, clamp) return s }; return s; } // When the Parameter "VCA Level [dB]" changes, send the new Value to the selected Midi Channel function ParameterChanged() { var faderMSB = new ControlChange; var faderLSB = new ControlChange; var dBto14bit = new Scale().domain(-70.0, 10.0).range(0, 16383); var faderlevel = GetParameter("VCA Level [dB]") + GetParameter("Trim [dB]"); if(faderlevel > 10.00) faderlevel = 10.00; if(faderlevel < -70.00) faderlevel = -70.00; var input = dBto14bit(faderlevel); var MSB = ((input >> 7) & 0x7F); var LSB = input & 0x7F; for(var i=1; i<=16; i++){ if(GetParameter("CH " + i)){ faderMSB.value = MSB; faderMSB.number = "7"; faderMSB.channel = i; faderMSB.send(); faderMSB.value = LSB; faderMSB.number = "39"; faderMSB.channel = i; faderMSB.send(); } } }
  4. hi Nseruame, thanks for your inputs. Your right, the log slider doesn't accept 0 as min value, it changes to 1... Your workaround doesn't work for me, as I've to map a range of -70 to 10 (dB) to values between 0 and 16383. I've a working code for this, but I'd like to have a logarithmic slider for the UI, as it controls a log parameter (dB). Anyone knows where the behavior of the sliders is defined? cheers, m
  5. hello logic scripter pro's It seems that the logarithmic slider type ist not capable to map a range of -70 to +10 as the linear slider does! (log 0 to 70 for example is working...) Any tips on how I can turn my linear slider into a logarithmic that is working? working: var PluginParameters = [ {name:"VCA Level [dB]", type:"lin", minValue: -70, maxValue: 10, numberOfSteps:800, defaultValue:0} ] not working: var PluginParameters = [ {name:"VCA Level [dB]", type:"log", minValue: -70, maxValue: 10, numberOfSteps:800, defaultValue:0} ] best regards, Marcel
×
×
  • Create New...