Highlight when a Parameter is controlled by a Send#176
Highlight when a Parameter is controlled by a Send#176vsariola merged 6 commits intovsariola:masterfrom
Conversation
017d0d6 to
c8196a3
Compare
vsariola
left a comment
There was a problem hiding this comment.
I could merge as it is, unless you immediately want to do the easy changes (returning value types instead of pointer type).
I can later refactor this for efficiency, so that some sort of cache is generated only when patch changes, and in that cache, we have stored which sends target what units and fast way (maps) to look this information up.
Gain value of 80 is converted to float with x/128.0 so the gain is 0,625, and then if you send signal x to it with send amount 128, the resulting gain will be x+0.625 i.e. can very well go over 1. This has the implication that some units can create NaNs if a parameter is modulated and goes beyond the normal range. |
c8196a3 to
6f1cb5e
Compare
|
The force-pushed version from last night seems to include a stab at the cache, great! But it does not seem to work yet? At least I don't see the send targets highlighting anymore. If this was a draft version and just saving evening's work, you might consider keeping these WIPs in another branch, because I get notifications when there is a new version in the branch associated with pull-requests and I am a bit unsure if that's an invitation to rereview or merge, or just that you were finished for the night. That being said: I think it's a good idea to put all the cache / derived data (whatever we call it) in one place (e.g., derived.go)! I can eventually throw updatePatternUseCount there too, because it is conceptually similar cache. |
|
The only challenge with this approach is that we need to make sure that the caches are always regenerated correctly, but I don't see major bugs appearing even if these caches somehow manage to be out-of-date, as long as we use the caches just to display some helpful information in the GUI. |
Oh, that is interesting to know. Is that something were we would benefit if the UI is actually warning about such cases? (new issue?) |
It's very hard to give accurate error messages because there is no guarantee that the signal sent is actually within -1..1 (for example: a simple LFO oscillator has the gain parameter to adjust it so it could be -0.5..0.5). Also, many units are just fine having their params go beyond 0..1, it's just some that aint. Bottomline: we already warn when there's NaN; that's when we know things have gone really bad; everything before that is "fine" and might be actually what the musician intended to do |
cdc1cfe to
75cd05b
Compare
75cd05b to
7370839
Compare
7370839 to
fb2aa5f
Compare
|
Something is still off in the latest version: Also, I managed to make the tracker crash: The offending line: There is no check for unitParam being a nil pointer. In general, returning a struct and ok bool is better, because the user then realizes that (s)he needs to consider what happens when ok is false. So, would have avoided this crash (there's again a heap escape in the |
fb2aa5f to
9bdcedd
Compare
|
In FindParamForModulationPort, the param.CanModulate is handled incorrectly, because it returns the stereo parameter (which has CanModulate false) if the index is 0. Should be: |
9bdcedd to
7a76680
Compare
|
LGTM, thanks! Merged, thank you for your contribution ❤️ |



Hey,
for debugging larger patches, or just generally knowing what's going on, I found it useful to display parameters that are also targets of some "send" somewhere in a different color. tooltip over the value tells you even more information
PS: because I had this on a branch where I was generally improving (IMO) user experience (i.e. my own), this also has a minor fix that when you press the "Add Unit", the searchEditor is instantly active (i.e. you can start writing the unit name without clicking, I hate unnecessary clicks); and a quick styling fix that puts the operator comment into "quotes" for clarity.
on that occasion, (but these are basics that I could also find out by reading the source code) -- what actually happens when e.g. I have a gain that is 80 and I send a value to it with amount 128? will it then go to 128, or somehow, larger? and when zending a 0, will it stay at 80 or go to 0?