change text colour on hover and script button help
-
Figured this out...
Didn't realise it was as simple as adding in
ScriptButtons.make(Button1);
and reading from the namespace script.Is there any documentation anywhere that lists things like .make etc.? Would save me having to bother people with all this stuff.
-
There is the script panel manual:
But actually the
make
method is nothing in the API, it's just a user defined function that skins the existing component and add all functions to it to morph it into the thing you want, so this is more a coding-style paradigm:// MyButton.js - one file per custom UI widget. // Add with include("MyButton.js") in the onInit callback. namespace MyButton // put it into a namespace { // takes a string for the ID and transforms the panel inline function make(name) { local p = Content.getComponent(name); p.doSomething(); return p; } reg someInternalData = 42; } // in onInit: include("MyButton.js"); const var myButton1 = MyButton.make("MyFunkyButton1");
-
@christoph-hart Ah ok, I get it. Thanks Christoph. Getting there slowly, finding once you’ve actually figured out how a certain line is written, it makes so much more sense than ksp, just got a lot of figuring out to do!
Do you mind if I ask you one more thing? Am I right in thinking the arpeggiator doesn’t have a slider pack index for the position? Is there a way of making the slider packs respond in the same way as the position highlights on the actual module? I’m trying to make it display the same way as yours does in Hexeract, did you completely write that from scratch, or is it the inbuilt arp?
I seem to have a bit of a problem with it too, it sometimes starts playing the whole note along with the arp pattern, just triggers the whole sample when a key is pressed. Deleting the module, then reloading seems to get rid of it. I’ve set up some buttons that return the sliders back to their default value, could it be them that’s causing the problem? If I script anything to do with the right hand edit panel, do I then have to include parameter id’s etc. within the code, or can the two work in tandem?
-
Thanks, I am constantly asking myself why I did bother inventing a Frankenstein thingy between Javascript and C++, so I appreciate when other people start to see the benefits of it too :)
Actually the arp code was built by @elanhickler in "Javascript" specifically for HEXERACT and I ported it to C++ and merged it into the codebase for general usage, so yes, it's basically the arpeggiator that is powering HEXERACT.
The arp position is actually a "read-only" slider that changes it's value depending on the index (starting with 1, zero means not playing). You can grab it with
Arpeggiator.getAttribute(Arpeggiator.CurrentStep);
. -
@christoph-hart Perfect, thank you! Yeah, you're building something pretty amazing here, completely hooked. Thanks again for your help.
-
@christoph-hart Definitely getting a bit of weirdness with the arp, the whole adsr on the gain is triggered once along with the arp pattern, if I select the combobox on the arp relating to the standard midi channels, theres two groups of 16 in there, is that right? If I select the '17th' All Channels, then change it back to the first all channels it works, but resets on loading the project.
-
Picture here. Seems to only do it on reloading the project. If I set up an arp in a new project it's fine, if I save then reload that new project, same problem is there.
-
Ah yes that definitely looks like a glitch, I'll take a look.
-
This post is deleted! -
This post is deleted!