Can Table Sliders be Knobs?
-
Hi! I have a scripted viewport that I want to use for creating MIDI maps. I like the workflow of using a knob to quickly choose a MIDI note, but I see that the default component type in a viewport is "slider." Is there any way to change those sliders to knobs? It can be using filmstrips, look and feel, or any other method you see fit.
Here's a snippet.
HiseSnippet 1408.3ocsWs2aaaCDmJIpnw6AVG1G.B+GCNqdox4UaSV1ZicxpQqaCpSSGPQPAsDkEWoIEjnahWQ+5t+deC1tSOrjbraSMvT.B7893c+3oSmFoc4ww5HhUsylDxIVesc+IJSP6.lPQ51gX8s18XwFdDMk0QSBYwwbOhk0p+NxvZ80HIO+yucDSxTt7BVDx4ZgK+YhQBSA2SezSER4ILO9YhQkzdmG00UqZqk5wP9rpsCIj49N1P9yYnZqXSdBKNfX8S1asku6Cbbdv1auqCissGisSK91Oj6umu6tNOzwavtNve6Qrt0wdBiNpugY3wDq0NR6Moef9RUZ.NWDKFH4HQKReHxorOQK8viHxkzNPH8NMuPES.ubZQYa0zx1OX2S3Ilxun78cIBnEVTt.ZsR0za0JoWqEkdyIkrJkRqklR2wtuajHzTHAymuxtqB5l9LnOUNUR0krh511s0fFJyliXuieRDPL0hF643zjB+aiCpUC5UwF56YQzQrvPgZ34B9kg5HC8PZtKFxMs0iB0JfnQ8PkzoNZ58tGsC2Wn3TVjQ3NVxLBvaTlxiZB3hHpG2mMVZn851oKUogpSo3U0nCouoFEdpelNrdyzelj10aRSoNBfQ4RNRaL5Q.0EPdLShuYL2bFCJ38zd7Fen150eo9xmvECCL02mtqSSfSOHqD84RtKFcfsIZLuYsOhGqRmKC5FpqVNdjJdgwocp7Fuo1GRyttc.OVu74KOueFa.WhBe7bDhMbT1Y7qL47dsvyD.LaskSsO1rZ.vB5aUiGMfGMsHMM.OGDRedlvaf+cVj+gasWK6ScdIIKkqikBuhrqhym0u8qn5TOeemLN8DpyYxwntSYwtJWuetUAub0Zs08yX12vC6K9qDlSYMQlD2mpzCfnNa5K4rnq2SeVYt4Y9QiAjZAWr9.bm8jrKThpcQ1kp1QbXPRF3yiYX0vqKIjc.J7pB.6QdwF.jkzLNjt8dGPAi6ir.TZwcNZJDoVMecDsg.T04.pf9KUu.tojqFZB.I28tajcZmFx2Ht.LKkYRdWAaueUOAJ2rPyxfz8Kkv2kJtlVHfZe5wpgvcObnCNyEUFQZMpX5FyZaFVZwQHsksO0mIi4k3WZvPByOd.zIvtPetAmhUtMrnA.v7ErJ0XZ8JqQ9XOOpKSJG.StnX0OMKotAL0PXVnPIwoL9iUIignZ0LQ.G.GokMzC9y7dhvmhjah3K5gGN8pwFIRKZQRMDYZj9xtJO9UP2CMJm7fYTSwuLCE0iYB.0Fq7Rhx6waKaTn9ze.mtWE5k.SCRqNIGPSfHFC5T8JfP4w9hMKAIfHlE6CtAl.v.vfEfOx7yF2.Gk0FlSrWv4KCCHhCkrIS04KANj.sPj0BeIRFNowh.AfSJATvz9EpFHpXcvszYE46OWYY9RxilqXbStnOkgMRaaMoo.ibEgsUptBzstYq.4ltfQIE0ptJg4Eg7L5O8NbjrMTvUmxxPPUSxhSee1hSbu7BIQ.N5V139Kjj7u7JtjW0EaU4dBbJDnPNLXCOOVc3uGVANckr0s6viemQGlna1dQfmuIw8phX9qOZRYhKwWEPrrs9wUHjfjoRH0emrq80VKDVHU6gSbqtkJtKel.nuUY0Pb8OUrvLo7t9eAqt57IWc8llh2w9TgwMX943JyIGgFx+G4X1B+ei8w99vRfEI3Z1m7GK618elv+R8X7MyvH1HAfCrgsy5CejjKGhtRwkwX+dEDUmR6fzXEnOW4kP7uvSlvVHsUlvV4BIiXtQ525ldW.+jhamvAxIUxmesN7cf.Ms00uALBll9VW2pt5ZFt0xZ31Kqg6rrFt6xZ3dKqg2eYM7AedCwW183wvW8jdsgP5c5wISrrrNVguAIAsR9O.lMlhT.
-
@ericchesek look and feel should do it
-
@d-healey Thanks David.
It seems I'm hitting some limitations. When sliders are added to a viewport, do the sliders follow the same JSON properties as a typical standalone slider object? For example, should I be able to set"Style" : "knob";
in the viewport SetTableColumns function?
Docs link for quick reference:
https://docs.hise.dev/ui-components/plugin-components/knob.html -
@ericchesek You don't need to add any additional knob.
You have to use a customLookAndFeel targeted to the slider that is already in the viewport -
@ustk Okay, I've made it far enough where I can change the look of the sliders to anything I want by using LAF.registerFunction("drawLinearSlider", function(g, obj){});
What I really want to achieve from that point is setting the drag style from horizontal to diagonal like a typical knob-style slider. Is that handled in the "feel" portion of look and feel?
-
@ericchesek you need to set the
dragDirection
property in the table content definition. But I don't know if this works.{ "ID": "note_slider", "Label": "Note", "Type": "Slider", "Width": 170, "MinValue": 0, "MaxWidth": -1, "MaxValue": 127, "StepSize": 1, "Style": "Knob", "dragDirection": "Diagonal" // don't know if this works... }
-
@ustk Yeahhh that's where my initial question came from about viewport sliders responding to the same JSON properties as standalone sliders. Adding these properties doesn't seem to change anything in the viewport, unfortunately.