1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Array for specific knob values

Discussion in 'Scripting Workshop' started by Andrew Finch, Mar 10, 2021.

  1. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    I am currently working on a gui that controls the different parts of kontakts convolution Fx, I am linking the Pre Delay, HighPass, LowPass and wet slider to my own knobs and sliders with custom graphics. I know if I want my specific values to show up I need to make an array with all the values between 0-1000000 like this for the Pre Delay:

    declare %pre_delay_array[301] := (0, 80814, 138152, 182627, 218966,{0,1,2,3,4} {ms}...
    249690, 276304, 299779, 320779, 339775,{5,6,7,8,9}...
    357118, 373071, 387842, 401593, 414456,{10,11,12,13,14}...
    426539, 437931, 448708, 458931, 468655,{15,16,17,18,19}...
    477927, 486787, 495270, 503406, 511223,{20,21,22,23,24}...
    518745, 525994, 532988, 539745, 546280,{25,26,27,28,29}...
    552608, 558741, 564691, 570469, 576084,{30,31,32,33,34}...
    581544, 586860, 592037, 597083, 602004,{35,36,37,38,39}...
    606807, 611497, 616079, 620559, 624939,{40,41,42,43,44}...
    629226, 633422, 637531, 641558, 645505,{45,46,47,48,49}...
    649375, 653172, 656897, 660554, 664146,{50,51,52,53,54}...
    667673, 671140, 674547, 677897, 681191,{55,56,57,58,59}...
    684432, 687621, 690760, 693850, 696893,{60,61,62,63,64}...
    699890, 702843, 705753, 708621, 711448,{65,66,67,68,69}...
    714236, 716985, 719696, 722372, 725012,{70,71,72,73,74}...
    727617, 730189, 732728, 735235, 737711,{75,76,77,78,79}...
    740157, 742572, 744959, 747318, 749649,{80,81,82,83,84}...
    751954, 754231, 756484, 758710, 760913,{85,86,87,88,89}...
    763091, 765246, 767378, 769487, 771574,{90,91,92,93,94}...
    773639, 775683, 777707, 779710, 781693,{95,96,97,98,99}...
    783657, 785601, 787527, 789434, 791324,{100,101,102,103,104}...
    793195, 795049, 796886, 798706, 800510,{105,106,107,108,109}...
    802298, 804069, 805825, 807566, 809292,{110,111,112,113,114}...
    811003, 812699, 814381, 816049, 817703,{115,116,117,118,119}...
    819343, 820970, 822584, 824185, 825773,{120,121,122,123,124}...
    827349, 828912, 830463, 832002, 833529,{125,126,127,128,129}...
    835045, 836549, 838042, 839524, 840995,{130,131,132,133,134}...
    842455, 843905, 845344, 846773, 848191,{135,136,137,138,139}...
    849600, 850999, 852387, 853767, 855137,{140,141,142,143,144}...
    856497, 857848, 859191, 860524, 861848,{145,146,147,148,149}...
    863164, 864471, 865769, 867059, 868341,{150,151,152,153,154}...
    869614, 870880, 872137, 873387, 874629,{155,156,157,158,159}...
    875863, 877089, 878309, 879520, 880724,{160,161,162,163,164}...
    881922, 883111, 884294, 885470, 886639,{165,166,167,168,169}...
    887801, 888957, 890106, 891248, 892383,{170,171,172,173,174}...
    893513, 894636, 895752, 896862, 897967,{175,176,177,178,179}...
    899065, 900157, 901243, 902323, 903398,{180,181,182,183,184}...
    904467, 905530, 906587, 907639, 908685,{185,186,187,188,189}...
    909726, 910761, 911791, 912816, 913835,{190,191,192,193,194}...
    914850, 915859, 916863, 917862, 918856,{195,196,197,198,199}...
    919845, 920830, 921809, 922784, 923753,{200,201,202,203,204}...
    924719, 925679, 926635, 927586, 928533,{205,206,207,208,209}...
    929476, 930414, 931347, 932276, 933201,{210,211,212,213,214}...
    934122, 935038, 935950, 936858, 937762,{215,216,217,218,219}...
    938662, 939558, 940450, 941337, 942221,{220,221,222,223,224}...
    943101, 943977, 944850, 945718, 946583,{225,226,227,228,229}...
    947444, 948301, 949155, 950005, 950851,{230,231,232,233,234}...
    951694, 952533, 953369, 954201, 955030,{235,236,237,238,239}...
    955855, 956677, 957495, 958310, 959122,{240,241,242,243,244}...
    959931, 960736, 961538, 962337, 963133,{245,246,247,248,249}...
    963925, 964715, 965501, 966284, 967064,{250,251,252,253,254}...
    967841, 968615, 969386, 970154, 970919,{255,256,257,258,259}...
    971681, 972441, 973197, 974701, 975449,{260,261,262,263,264}...
    975449, 976194, 976937, 977676, 978413,{265,266,267,268,269}...
    979147, 979879, 980607, 981333, 982057,{270,271,272,273,274}...
    982778, 983496, 984212, 984925, 985635,{275,276,277,278,279}...
    986343, 987049, 987752, 988452, 989151,{280,281,282,283,284}...
    989846, 990539, 991230, 991919, 992605,{285,286,287,288,289}...
    993289, 993970, 994649, 995326, 996000,{290,291,292,293,294}...
    996673, 997343, 998010, 998676, 999339,{295,296,297,298,299}...
    1000000) {300}


    Essentially my custom graphic is a knob that displays 0-300ms (no dp) so it is essentially 301 frames, how do I now use the array to make the displayed value of my knob the same as the knob in the convolution engine?

    Also further to this, I used:

    on init

    message(get_engine_par($ENGINE_PAR_IRC_PREDELAY, -1, 0, 1))

    end on


    to help me get all the 0-1000000 values by typing the exact desired value in the output section of the Pre Delay, High Pass and Low Pass knobs but the wet slider doesn't give you this option. For the wet slider I have got 47 frames (-40dB-6dB) in my custom graphics how can I get the exact 0-1000000 value for those dB numbers?
     
    Last edited: Mar 10, 2021
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
  3. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    Thanks for so much for the help!

    With the reverb script, it is balancing between the wet and dry sliders, does this produce a better sound (as well as helping control volume) than keeping the dry one static and just moving the wet one?
     
    Last edited: Mar 10, 2021
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Up to you to test which you like better, you can just use the wet part of the equation, the array stays the same.
     
  5. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    Thanks, I will have a play! Isn't JKnobman's frame limit 1000? So what is the best workaround if I want to have custom graphics, just do 101 and don't have any dp?
     
  6. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    I don't really ever worry about matching the number of slider values with number of PNG frames. I use 128 for unipolar knobs and 129 for bipolar knobs personally.
     
  7. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    Ok, that's great! Thanks for your help
     
  8. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    I am now having the same problem for another feature in my UI, I am now working on using a custom graphic to control a the sample start constant modulator, this is what I have so far:

    on init
    message("")
    declare ui_slider $sample_offset (500000,1000000)
    end on

    on ui_control($sample_offset)
    set_engine_par($ENGINE_PAR_INTMOD_INTENSITY,$sample_offset,5,find_mod(5,"CV_PITCH"),-1)
    end on

    I have also set S. Mod: 48000 with Fmt: 96000 24

    My custom graphic basically displays 0-500ms as this is the offset range I want to achieve, how do I go about achieving the values again to use in the array and how do I link it all together so it works from the slider?
     
  9. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You should use my modamtuni array that linearizes the modulation amount slider (your knob would have range of 0 to 1000, for 0.0% to 100.0%). Then it will match up with the linear 0 to 500 ms values.

    https://www.native-instruments.com/...g-point-through-waveform.357873/#post-1802597

    Also, I definitely suggest properly naming your modulators, CV_PITCH for adjusting startpoint is just bad, bad, bad. :) All the modulation-related KSP dealings are explained in the sticky thread here.
     
  10. Andrew Finch

    Andrew Finch NI Product Owner

    Messages:
    44
    I have got the 0-500ms knob talking to the percentage slider but it is not showing the correct values! 500ms is showing 100% obut then 125ms is showing 0% then anything below this value the invert is activated:

    on init

    declare ui_slider $sample_offset(0, 1000)
    make_persistent($sample_offset)
    set_control_par_str(get_ui_id($sample_offset), $CONTROL_PAR_PICTURE,"sample_offset_knob")
    move_control_px($sample_offset,3, 167)
    set_control_par(get_ui_id($sample_offset), $CONTROL_PAR_MOUSE_BEHAVIOUR,-500)
    set_control_help($sample_offset,"")

    declare %sample_offset_array[1001] := (All modmtuni values)

    end on

    on ui_control($sample_offset)
    set_engine_par($ENGINE_PAR_INTMOD_INTENSITY,%sample_offset_array[$sample_offset],5,find_mod(5,"CV_PITCH"),-1)
    end on

    what am I doing wrong here? Also when you say about the naming of CV_PITCH do you mean rename by right clicking on the constant modulator and then just using a more appropriate name and then using that in the code?
     
  11. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Use $ENGINE_PAR_MOD_TARGET_INTENSITY.

    Yep!