Knob-Range



  • When I set a knob to "Frequency" the values are
    in Hz (0-999) and from then on in kHz (1-20 kHz).
    This is enormously practical and space-saving, but also clearer.

    Question is is this also possible for

    • Miliseconds and seconds
    • Sampler range
    • or for all values above 1000

    Or can it be scripted?

    Bildschirmfoto 2021-09-06 um 09.37.18.png



  • @MikeB it's only for the native slider in frequency mode
    So you'll have to script it yourself. It's rather trivial, just use if/else if statements, divide the value to display by 1000, and change the suffix.



  • @MikeB well at least you can do it with the popup value, and I guess you can do it if using laf

    HiseSnippet 954.3ocsV0saaaCFkxwLaRqqcEXO.D9JazrD6ljtATzU03XOXzkTuorfcWKiDkEQjHEDobq2Pte20Wo9NrWj8DrsOJIaIu5VjZf4qL+98vOd3gZZlzmoTxLjk8EKRYHq6f8VHzQCinbAZxoHq6hOipzrLRooSVjRUJV.xxZmevXvxtMp32e8zSnwTgOq1DBcoj6y9QdBWWacp6y4wwioArK3IMh9H2I9RwPYrLGvyN39nTp+0zYryolvZgQV6NJfqkYdZplofXNQFrvKR9ZQY7WxU7qhYlECPdPgJMiFFwiCltbupPHq1Sq246Tty+Z7Y7.9J60SfupvAoNily.qVqCo1qAoAeHHMVFGXJvG.dVMfW6R3cermeFOUW6wfsu.OQ.GNgTXr2DVkwhZQZgGJgHD58SnWyFmAKVkQ2iO738HO7nC68XGXxqzj4zLRYpdw7.V1.xSHKyeFSOTljJEvhtcVKpNPAbVyx9Jl9RZbNapLMOcbtvWykhtgK+SOme2w1zs4PGVOyYUY1EJZQHp7vP9af35PRTc.iN17PR24ju+IjA862umiMTLaSkFIlwEr8Cj4vL+BomNiKlAQdPYj6QfsJ4fCH5HFQjmbEPq6bXGBWQfSLRBUrfDv74IzXETwFMVw7Mc9FGaVrhU2vTZlhACzty6U51wNioyyDvF6AUH+wN2za4FmHEmK0rWTMAbtwg7ecEFtQeligLYbLKaitMWkx9XI1sb+tGbFCC2UAB7q0Iv6d6Hv9krhFAJESDb8KRYUqqo3C1.EGUQqLj8JDBgpKn52E2jQf3PQt2ZlFfJ1DMEZP+xjSoZ5xxAUF5VJKSyMaJqSYyAgnxaR13SYpq0xzhXqXzfx2st4uYUie2qbWTu3mbeMOPGsxf6qbiX7YQMz9l3lHCftrKtP6KgVWq+3OcAc1TO9uwZJpVxgPVXLv9QI7ffX3RkhaNcMw82+C76ou0UAmD023PVeF9YWImy.412SJADzjA4wT85pbF47JGlZ2TNwHYHfdtnIx9Dj95uQouMxKtkv893obsezlwaqMfWfY7+MdqdH4KwiBCY95Zv1FO9W21WM9DfxOKy0fd2YTP1yvXNOOwCdK0mAHQH.gKvlUKycux08MqMSFOlHnXggKU4bfYsUkyAKcBLV+L4K8KuwZdp5yKr.XRT7JsM74BvZxpqnXb+86a3s7W56aFEeCf8MmyC2hbNbKx4nsHmi2hbdzVjy2tE47cezbLe7xyx0xjxqIfgoiJjJsrFIn.KqfQh9WPrHoaq
    


  • @ulrik sorry, I didn't noticed @ustk had already answered 🙂



  • @ustk or - I use the snippet from @ulrik 🙂
    Thank you very much



  • @ulrik Nevertheless I took your snippet - I need to see it to understand it - thank you very much as always Ulrik



  • @MikeB this is why I generally prefer to give some explanations before going snippet. The more you try by yourself the quicker you understand 🙂



  • @ustk did you read my signature? 🙂

    I am only trying. From dawn till dusk
    But as I said before, I'm a visual and not an auditory person, so I learn fastest and best when I see the lines of code and recognise the context.



  • @ulrik I would like to incorporate this into my LAF. For the "group4" sliders

    Here, however, I run into a problem of understanding
    or where to put your conditions?

    var text = obj.text.substring(obj.text.indexOf("-") + 1, obj.text.length);
    //Knobs group4-obj.value----------------------------------------------------------------        
        if (obj.text.indexOf("group4") != -1){
    	    g.setFont("GUI-Barlow-Medium", 47.0);
    	    g.setColour(grau); 
    	    
    	    var v = obj.value;
    	    	var suffix = " ms";
    	    	
    	    	if (v >= 1000)
    	    	{
    	    		v = Engine.doubleToString(v /= 1000, 3); // the number "3" is how many decimals
    	    		suffix = " sec";
    	    	}
    	    	else
    	    	{
    	    		v = parseInt(v);
    	    	}
    	    
    	    	return v + suffix;
        
               g.drawAlignedText(obj.valueSuffixString, [0,-4,100,36], "centred");	
        
        };
    


  • @MikeB You're displaying the

    obj.valueSuffixString
    

    so the script will do no good, you have to display the scripted value "v"



  • @ulrik

    That was the first thing I tried.
    But apparently it doesn't work with LAF knobs.
    Also the number of decimal places has no effect.
    See snippet.

    HiseSnippet 1252.3ocsWszaabCDlqi2hJ0zGAH25EVcRBQRQx1IonttU9kBLhenV4DTfhhT5cGIwZtjBb4Ja0.eu25eodnm6k9Go+CZGtbs1Ux1AFtvz.1679aFNjCcOsJ.hiUZhWoimNFHdOzu+ToYz1iXbIYucHdO1uShPyOkFE+U8o8E7PPS1Z5XVbLDR77dvKsZ5UZYR55e91sXBlL.xYQHuQwCf84QbSN2dcdEWH5xBgi4QEzdsN6EnjaqDpDDUOvuEYLK3T1P3PlUsk7IdevtgbiR22vLPLwa4sTgS6ORclzo+a3w7SDfknMoO5HG6tJQnEwVtjsGwEg8tL6iInW5kWKdfqV7X+C3g7Y7yqIeVp.ZtEEqGdK89fW6hvq0sGddEf2xN38H+9AZ9XStDK19H+8jFPOfgaAEgkSWxR+ku+1JTCooYD6TnqFIlYQ0ms5ypSWYsUqsd4xkn3pzh+A2bhMzILMUvFP2ftqbHWBMCz.ltuTnNgIbgZek5zMkgcAPTEcWI6OnIM0vPdLFutIx.CWIqVITyNaezILsq8pRc5fKENrNUcxuTqbo24PfMvLLrHylLLlqmy1.maxjX+rYbxIwFMWNr5LVbYHb9QCpVoQkZzmPaWOWaAHGZFUqf+lj4rILQB33WxxONYv.94nvJ3YhJYFLWUx9K2mO8ouRpNIlNTqRFuFsQtCa7+bQyVt3XW7AzqIScQFS2uXCZi10d2M.WqwSneyFz1sZ0pVAAoe7tEYTZR9VenJA6mOV02UrmPepyK0osqsNVAnlQ.UlDcBnoUVsBkGSwSCzHlbJMDB3QLQ7U7eghbLDLWUN8iKVjAHhgaGrGyzw.1xWcRsEc67j1fXWZvjnkX+vSx16W2weXyXvzEO+TsxKe8dM1hoEpyZb.DxShvd30dQyVXDlE6LCbWsUcnFlhkmKEmoxvl1CCaJ3CkP3w3FY0YML8SCsqHWm9isp2Xs5XYt9pO+mpSqDfGn0PXkZqWZwbxA1R3o9Xk.ZNFcvh4d9m4sS10B.FjWZ0bJbykf1OOsDrfIKlh1F1zLZ0URynUZMeFka+EE9190E0rGwZbeunytOhpjGpLvQxp0JicWkun7UDMXv0JydoqVIDf9ZEaGBpeeFV0cBpNMsYXlh3zf4G23eyiaJNMLvMCnfhJ4dRt4nwf7lFBQxFbXGGkgJTUS5vnOIaXT1CD33LmOcNVsIo.e1f9O+O6Pd8d6vLrKcG5YLZiAsgaSDucfI3yFby5J4uCDepQMNU2nwJoEGdO7VG7ymE3+3m6LMm365bFOzLBqadRjdDvGNxXo9ZjJhka1u82cvoVi6y+Un3qch3ggBnmJla2tlIoyuiZO0V1K6+FaFEvDDaetErtqjarCDvlRb2nfQzGmlfOK5Ji4wGanBSDLy7u.w9rqLA1.WbTucbtDAzzh.8d4YI2V39H+dbSvnqGuKcM3E6Ituwa1i79X+cGL.BL4fcY+t+v8+K5HeuJwfWke.CuQ2t+eXRTe7d1..QhThiyrcgKYO04naYosUl9fLLk3ewUlv1VZuLgsuTH1.GnUuMvcV09LxOLkChIY5qoK4efklN6voueqlsHXSM+sAA1RQi1Dx0ayJ2AaV8NXyZ2Aad1cvlmeGr4E2Aa9x2qM1+whMSLpH2wDjQucSujzyaWIC6xR6HI+GQgGeMC
    


  • @MikeB Ok, the example I gave you used the "showValuePopup", so it was enabled and the "showTextBox" was disabled
    and I also used the function

    ScriptSlider1.setValuePopupFunction()
    

    on a declared slider, inside laf I don't know how to do it but I guess it would work the same way, if you have a reference to the slider
    Skärmavbild 2021-09-06 kl. 12.43.51.png



  • @ulrik Thank you - if you think I can do it, I'll give it a try.
    After 5 hours without success I'll get back to you. 🙂



  • @MikeB you forgot to set the Colours....

    HiseSnippet 1217.3ocsV0saiTCE1SaGDy.KvJsO.lbUh1jzjl1BhpBo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aNq.nlrNseRdm17oeLng5mdGQMQYDe1Tre6uZid8Q6SLjotC7LrainJCydP71mNFlI5ZjG3uOUekQNJCaxHovxCum8f27alsw+4O1dx7Eea6qYwlgyD7quo8PJavvBigOscB4lh7FZZOpG6moEGomvhi4ztRMydsMSS6eGPOwF9C8uvdxhHbjMA2RZWOrZ6SiHSPthO39yG5thzv8hsXXW4M1ISn2czFLfUFmxIl6N009TibEVdTb7lcDl.32jh79IYT7CktO2uKyDMbw7coEvWHU4olu4Or4Y9GzuOMxLmrq3246e5eEC56joFX1zIDXDkMc3zzjdPC1HJvDg.lr.x7VxVL5V2vt1FY5QEwYK9G3KWYS6ZubkMmpDkPhTx2F4JgsOc5Cyj.bRj8Bx.+SrqwypY88gYLHHGm81nHannFv8EayZOBaZ8HrY8GgMa7HrYyGgMewivlu7dsw9X5cRMxDWYBHn6AY8N87NPPfrrrLRz+B38DhUJ
    


  • @MikeB said in Knob-Range:

    After 5 hours without success I'll get back to you.

    Ohh, I didn't read that....🤭



  • @ulrik said in Knob-Range:

    I have also just managed it.
    But I put the suffix in front of the text.
    Since it takes up a lot of space after the value. In my case

    Thanks for your help.

    HiseSnippet 1223.3ocsV0saiTCE1S2NHlAVfUZe.L4pD0jzj9yBhpBo+kppca2.oa0JsBs3NiShodrGY6IsATk3JD2wiBuB7NvKBuAvwimjLkMaUUQctIwm+7mO9b9NtmRFQ0ZoB4Eb5jTJx6i86OQXFs2HBSfNZej2S86jwUrKvI5upOtOmESUncmjRzZZLxy6QGZszKXYT92e+M6R3DQDctHD5LIKh9BVByLWZuNOmw4cIwzSYIkrdiNGEIE6I4xL.UOxuEJkDcAYH8Dh0rk7QdevAwLiT02PLTMxa4ckwS5ORdovY+YLM6bN0tnMpODHm3tRdrEwVon8Fw3w8ld50HHJ8lmKdjKW7T+iYwrYxmmS9rbE34dTNe3szsAu1kgWq6N77JAukcv6I98iTrTybMVr8Q9GILT0.BbETFVNaQK8GK6umDrPXZlPtf1UAKl4Q0MWey5301X8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tFOqm02GlyffZb1aihrohF.1WrOqcO7Y86gOabO7Yy6gOO6d3yWbO74KuUerOndmLiLw0l.B5cPN2om2ABBTkkWQh9Wbc6hMM
    


  • @ulrik It was good that way. I wouldn't have lasted 5 hours. 🙂


Log in to reply
 

11
Online

1.6k
Users

4.6k
Topics

42.5k
Posts