Value of Knob to a Graphic size



  • Here's what I'm trying to do:

    Is there any way I can have a knob change the size of an object according to its value(knob)?

    Let's say for example : a knob value to an image size.
    the less value = the image is small,
    the more value = the image gets large.

    I don't know if you understand I'm trying to do.



  • @jay I've not tried it but it should work. Just change the width and height property of the control



  • @d-healey but how do I do that?



  • @d-healey I have filmstrip image I did, can I use that instead?

    Can you do an example for me please?



  • I don't know if it will scale a filmstrip image.

    HiseSnippet 896.3ocsV0saSCCE1tqFnAJBP6AHZW0IAnV9WZBQYcanBrQEYfPhKPtINqV0wNJwYrxD2waA2vS.uBvqBuA7F.G6j1jBcvJRj6N+7c7mO9yGmAIJeVZpJAgar+jXFBeAh2DodTuQTtD0eKD9hjcooZVhatqMmDSSSYAHLdkGYbfaTGY+99C1jJnReVoKD5kJtO6o7Httzab2mvEhcnAr84QUx9Vc66qj8TBUFvmUHsQwT+wzCX6QMoUifvmY6.tVk3ooZVJjylpfIdiTuUlm+K4o7gBlwnCxCJTtaTuQbQvfo60TDBWeP4Nek7c9pjc4A7Y9K6.WxFvsDQ0d.t17Tp9bTpyIQocTh.SANA5gqPu54z6xDO+DdrtLhgammzWBGNgTnsWkV44hp8QLomBxPpudDcLamDvXFhV2oc6q5d61sWeilNMcflep1cXlVqjt22cJtCX5dpnXkDLZs1l1vcVy.IGvXoZ3Il9Sff4I2zgKEbIyMLS5q4vRX.N0nETKchRbU2CohL15McNtoiK7kSmqmxfh8VdfdzZSSYCm2appoJlv8xKPOpPLDjMspV802X1hpj6ozrmIastywNMbduyuFILbQgJptfkrnnFcbxe.VKYVzPVxTlWjGbzNu14LmNsiedmtRhJYeIW+rXVgco5pyBTWnhiJPmUqffPpZqJ6hEpr7iYDGJRCRwYNxx9p2tQmDbOAOfkXgeVhUC7qf4cQun+VTM0n1KHDPxXVhla5E3sXGBiNx09MHawRGqUwVFWHtPXxofyGUtjOt6jYFe80cspo4HTkR67W2OkE9SAUJbWY2HdPffMPkxMpfJCH+BLGM1i+Naa33U+7i9169vChnGUkDoYgg7irS6B4hnTMr78ifgfH7UHuHk4FvBoYBsa5XX7DbgZLKXekMezuOz.FcoBxDT87yyLCtKBXXX0AGlgCRf4SpNXeIFx0dgC4VnL7TR2KSFv09iVLeqs.9Zz0+m4awSFMIaGFx70kjsNYmW8u99vRPkmqxzb4A6RA4AHVH6kE4AuZ5y.lHkLArPDbMyEzb61FaSmwiICrF+.9JB1wXiKB1YZPTD0OQ8lh4xlGkNm0CvIo883FvOF.1tytZa3Mn84uw22zHtFv7Ei3FKMhatzHt0Ri31KMh6rzHt6Ri3d+ADleK4gYZUT90BvwfssiTw3skTPUYUfnehdTrJL
    


  • @d-healey said in Value of Knob to a Graphic size:

    HiseSnippet 896.3ocsV0saSCCE1tqFnAJBP6AHZW0IAnV9WZBQYcanBrQEYfPhKPtINqV0wNJwYrxD2waA2vS.uBvqBuA7F.G6j1jBcvJRj6N+7c7mO9yGmAIJeVZpJAgar+jXFBeAh2DodTuQTtD0eKD9hjcooZVhatqMmDSSSYAHLdkGYbfaTGY+99C1jJnReVoKD5kJtO6o7Httzab2mvEhcnAr84QUx9Vc66qj8TBUFvmUHsQwT+wzCX6QMoUifvmY6.tVk3ooZVJjylpfIdiTuUlm+K4o7gBlwnCxCJTtaTuQbQvfo60TDBWeP4Nek7c9pjc4A7Y9K6.WxFvsDQ0d.t17Tp9bTpyIQocTh.SANA5gqPu54z6xDO+DdrtLhgammzWBGNgTnsWkV44hp8QLomBxPpudDcLamDvXFhV2oc6q5d61sWeilNMcflep1cXlVqjt22cJtCX5dpnXkDLZs1l1vcVy.IGvXoZ3Il9Sff4I2zgKEbIyMLS5q4vRX.N0nETKchRbU2CohL15McNtoiK7kSmqmxfh8VdfdzZSSYCm2appoJlv8xKPOpPLDjMspV802X1hpj6ozrmIastywNMbduyuFILbQgJptfkrnnFcbxe.VKYVzPVxTlWjGbzNu14LmNsiedmtRhJYeIW+rXVgco5pyBTWnhiJPmUqffPpZqJ6hEpr7iYDGJRCRwYNxx9p2tQmDbOAOfkXgeVhUC7qf4cQun+VTM0n1KHDPxXVhla5E3sXGBiNx09MHawRGqUwVFWHtPXxofyGUtjOt6jYFe80cspo4HTkR67W2OkE9SAUJbWY2HdPffMPkxMpfJCH+BLGM1i+Naa33U+7i9169vChnGUkDoYgg7irS6B4hnTMr78ifgfH7UHuHk4FvBoYBsa5XX7DbgZLKXekMezuOz.FcoBxDT87yyLCtKBXXX0AGlgCRf4SpNXeIFx0dgC4VnL7TR2KSFv09iVLeqs.9Zz0+m4awSFMIaGFx70kjsNYmW8u99vRPkmqxzb4A6RA4AHVH6kE4AuZ5y.lHkLArPDbMyEzb61FaSmwiICrF+.9JB1wXiKB1YZPTD0OQ8lh4xlGkNm0CvIo883FvOF.1tytZa3Mn84uw22zHtFv7Ei3FKMhatzHt0Ri31KMh6rzHt6Ri3d+ADleK4gYZUT90BvwfssiTw3skTPUYUfnehdTrJL

    Thanks



  • @d-healey you are a genius, thanks a lot, exactly what I was looking for



  • @d-healey How do I attach it to a parameters in an fx?



  • @jay I don't think you can have a scripted callback and assign a parameter ID in the interface designer, you'd have to add the functionality you want in the knob's scripted callback function.



  • @d-healey Can you do an Example for me?

    Like get the RoomSize of a reverb and when turning the knob for that parameter the image go big or small



  • @d-healey any ideas? please



  • That's not going to work out, resizing images that way looks terrible.

    Either use a ScriptPanel and draw it in the paint routine, which scales nicely because it's rendered dynamically or use a filmstrip with the different sizes prerendered.



  • @christoph-hart I did that way but is doing it in a weird way, I can send you an snippet of what I'm trying to do, so you can check it out if you can.

    Thanks in advance



  • @Christoph-Hart said in Value of Knob to a Graphic size:

    use a filmstrip with the different sizes prerendered

    What method would you use to change the filmstrip image according to GUI size? I can't find anything in the API that can query the GUI zoom setting.



  • @dustbro I don't think this would work because HISE doesn't embed all images in the binary, only the ones that are used. But to set the image of a knob you can use knob.set("filmstripImage, image); (or something like that).

    As far as scaling to GUI goes, just make the knob image 2x its normal size, then it will scale down just fine for people on lower resolution screens, and those on higher resolution will get the unscaled image.



  • @d-healey said in Value of Knob to a Graphic size:

    just make the knob image 2x its normal size

    This worked perfectly. Took me a sec to figure out how to set the scale to .5



  • @d-healey @dustbro But I don't see how this solution can follow a GUI zoom change...?



  • @ustk When you change the GUI zoom level HISE scales all of the images. If you have an image that is 2x and the user scales it to 50% the image will now be 1x.



  • @d-healey Yep I know that but I thought the solution asked/proposed was in a way changing the image regarding the zoom factor (like with a film strip)
    I'm not sure it always happens, but with subdivisions of zoom factor, you still have aliasing with a 2x image size. For instance, if you use 25/75/125% zoom or even 33/66% for the most crazy guys ou there like me 🙂

    For the moment I'm trying to go 100% vectors, but surely in a close future, I'll make image-based GUIs...
    Having a get/set zoom factor API would surely simplify the life

    But this has a drawback => the size of the cumulated images/filmstrips...

    This API would be very helpful anyway as I foresee other use of it...



  • Yeah that was the original question, but it's not possible 🙂

    I haven't noticed any scaling issues, I'm sure there is some aliasing but if no-one sees it then I don't think it matters. If I scale to 25% then my interface looks horrible and small, but that's because I'm using a 2K monitor.


Log in to reply
 

15
Online

955
Users

3.4k
Topics

28.9k
Posts