A few minor issues I've come across
-
Save to file doesn't work with external scripts - I can still copy to clipboard, open the file in another editor and paste it in, but it would be handy to be able to save directly from the HISE context menu as I can with other scripts.
Think I mentioned this elsewhere but when a slider has its text input disabled a white border appears around the slider.
When text input is enabled on a slider there is no way to reset it to its default value, double right-clicking doesn't work because the learn MIDI CC pop-up appears.
Wasn't there a property button for sliders to enable/disable MIDI learn? I can't seem to find one but I'm sure it used to be there.
Having more than 8 RR groups causes instant close when group XF is enabled and a note is played - I think there should be a more elegant way of handling this.
Sample maps are being saved as mode 1 instead of mode 2 causing them to reload in a purged state
-
Save to file doesn't work with external scripts - I can still copy to clipboard, open the file in another editor and paste it in, but it would be handy to be able to save directly from the HISE context menu as I can with other scripts.
Noted.
Think I mentioned this elsewhere but when a slider has its text input disabled a white border appears around the slider.
Yup. Don't know why it does that, but it's ugly. BTW, I recently discovered a neat hack that allows you to customise the slider appearance: load a empty filmstrip and put a scriptPanel behind it, then check in the script panel's timer callback if the value has changed and repaint it (use Slider.getValueNormalized() for grabbing the value). I applied this trick on HEXERACT where I needed to draw sliders which contain a ring showing the current modulation value, but it might also be the solution for your problem (then you don't need to wait until I get over my lazyness and fix this issue).
When text input is enabled on a slider there is no way to reset it to its default value, double right-clicking doesn't work because the learn MIDI CC pop-up appears.
If you roll your own solution as sketched above, you can use Shift+Click to get a text input field (I added this recently) and double click still works. 2 : 0 for the other approach :)
Wasn't there a property button for sliders to enable/disable MIDI learn? I can't seem to find one but I'm sure it used to be there.
Nope, this property only exist on Panels, Sliders, Buttons and ComboBoxes should always be MIDI-learnable.
Having more than 8 RR groups causes instant close when group XF is enabled and a note is played - I think there should be a more elegant way of handling this.
Yup, never tested this edge case, but I can imagine why it crashes. Definitely needs something more gracefully here.
Sample maps are being saved as mode 1 instead of mode 2 causing them to reload in a purged state
How do you save them in Mode 1?
-
I recently discovered a neat hack that allows you to customise the slider appearance
I'm lost after the part where I add the script panel. Could you show me an example please?
How do you save them in Mode 1?
I right click in the mapping editor and select save sample map. When I open the XML in the text editor I see it says save mode 1. I just did some tests though, the samples are only purged if I merge them into multi-mic samples, if I just have a single mic then there is no problem, even though it's still saved as mode 1.
-
const var panel = Content.addPanel("panel", 0, 0); panel.data.knob = Content.addKnob("hiddenKnob", 0, 0); // Set the same position panel.set("width", panel.data.knob.get("width"); // ... // use an empty (transparent) image panel.data.knob.set("filmstripImage", "{PROJECT_FOLDER}empty.png"); // needs to be set in order to make the dummy filmstrip work. panel.data.knob.set("numStrips", 2); panel.setTimerCallback(function() { var thisValue = this.data.knob.getValueNormalized(); if(thisValue != this.lastValue) { this.lastValue = thisValue; this.repaintImmediately(); } }); panel.setPaintRoutine(function(g) { // draw the actual appearance of the slider // using this.lastValue which is 0...1 // all the slider logic will be handled automatically // no need to mess around with the mouse callbacks, converting ranges, // etc. }); panel.startTimer(30);
-
Thank you, although this feels a little hacky it is very effective. Is there much impact on CPU due to using timers?
I noticed a typo and I had to change
this.lastValue
tothis.data.lastValue
to get it working. Here's my revised version with filled in paint routine for a vertical slider:Content.makeFrontInterface(600, 500); const var panel = Content.addPanel("panel", 0, 0); panel.data.knob = Content.addKnob("hiddenKnob", 0, 0); // Set the same position panel.set("width", panel.data.knob.get("width")); // ... // use an empty (transparent) image panel.data.knob.set("filmstripImage", "{PROJECT_FOLDER}empty.png"); // needs to be set in order to make the dummy filmstrip work. panel.data.knob.set("numStrips", 2); panel.setTimerCallback(function() { var thisValue = this.data.knob.getValueNormalized(); if(thisValue != this.data.lastValue) { this.data.lastValue = thisValue; this.repaintImmediately(); } }); panel.setPaintRoutine(function(g) { g.setColour(0xFF000000); g.fillRect([0, 0, this.get("width"), this.get("height")]); g.setColour(0xFFCCCCCC); g.fillRect([0, this.get("height")-this.get("height") * this.data.lastValue, this.get("width"), this.get("height")]); }); panel.startTimer(30);
-
I've noticed that when text input is disabled on a slider the new shift+click option still works. I think it should be possible to disable text input entirely. How about instead of a button to enable/disable text input you have a drop down to select - no text input, shift+click, double-click, etc. and what about ctrl+double click to restore to default?
-
Ah yes, I just hacked the code in the keyboard without testing it actually. It should not have an impact on the performance for a reasonable amount of sliders (in HEXERACT there are about 20 sliders that are drawn like this). As long as you don't repaint it constantly, the simple check if the value has changed is trivial and can be executed every 50ms without noticeable overhead.
BTW, if you use
g.setColour(this.get("bgColour"));
you can use the colour sliders on the panel's property editor for setting the colour (this mirrors the actual slider behaviour).Not sure about the other things, I don't think that Shift+click is prominent enough to be required to be able to turn off and Ctrl + Double click is a bit esoteric.
-
I've been playing around with this some more and I think I have a slightly more efficient way to do this, it pretty much works in the same way but instead of using a timer callback it uses the knob's control callback. It's important that the min and max values of the knob and panel are the same. Let me know what you think.
HiseSnippet 1076.3ocsV0saaaCElxIrqwcdXEn2saD7URCsdxsMcEHHXtwIYvaMIBwYAanXHfVh1lvRjBTTIwKHOB6cZO.6gYuAYGJJYol3kFugIXXfy+e7vyOzWJBnooBIx5ImLOghr9b7v4b0z9SILNZvtHqGi8kzTpBsy7DRZJMDYYs12qkZsw5n7u+561gDQ3AzJVHzoBV.88rXlphqeuejEEsOIjdBKtl1ut2f.AuuHRjAHYMrGJgDLiLgdHQqVCL5bF8hTjkG9UuribV2Q+1657P9PAYRIkqNELGYgstA9rv6ExTB4PEQQAet9Nhv4CmJtfaB8orT1nHplnKZHfIC68EQg5CulKp+TVTneYxKEAdwuJUtlIU9L7ArP1B9UozuLWfckE0SsVMtO308SCOukAOqZvacC7dJdXfjknpjnw1SvC3JpbLAtMqCKitnF2z.2W.ZvUchIyn6KAhEV37FOumauomm6VsZ1pIbmlprOmHsSHbZj811klNgp5KhSDbfvocBOps1hJ8mwEi9GUeFeTaS.xcaGn3zGRspiEYJFm5LNiGnXBtyD2qZ0zF9L+OQqooHyQMkkpcqS6QSLrZ65tkVqBUGCEpGSCTNe.NQvuJCtfEpl11sNqoT1jop1t+p6VMq4ikENlhFWEv5vSet4zKNknSTN2041eSsHFStDr29qWvBLKi5T5wkcHtqGegIbO7CmArW6tUYJ1VvOTnnGwcbadUyMZdcyaKY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