Skip to content
Snippets Groups Projects

Add canvas-local bendin and zoom flags.

Merged Albert Gräf requested to merge aggraef/purr-data:canvas-options into master

This adds canvas member variables and corresponding options for the declare object, so that the global (user) zoom and legacy bendin flags can be enabled and disabled separately for each canvas.

This was proposed (and deferred) earlier in !561 (closed) (which see for the previous discussion and rationale), but the original branch seems to be gone, so I've rebased it on the current master and pushed it again.

Jonathan, I really hate to revive this old MR which we discussed at length already. But we're 6 months on, we don't have author-centric zoom yet, and I'm still facing the same issue that prompted me to create this MR in the first place. As long as we don't have author-centric zoom yet, can we at least implement this as a stop-gap solution, please?

Edited by Albert Gräf

Merge request reports

Pipeline #3456 canceled

Pipeline canceled for 6d5c50f2 on aggraef:canvas-options

Merged by Jonathan WilkesJonathan Wilkes 3 years ago (Apr 10, 2021 6:27pm UTC)

Loading

Pipeline #3501 failed

Pipeline failed for d9ac7f33 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added feature label

  • Author Developer

    I should add that I'm mostly interested in declare -zoom, but I included the declare -bendin option in the original MR and I still think that it may be useful, so I didn't remove it.

    Also, I readily admit that this is a kludge. I'd rather have author-centric zoom, but as long as that isn't implemented, I just need some way to fix up up the demonstration patches for my students so that they are displayed at the right zoom level, no matter what they have set in their GUI prefs.

  • Albert Gräf added 3 commits

    added 3 commits

    • 4b7dc11b - Rework bendin option.
    • 479d96c7 - Fix some bugs and add commentary describing the lazy zoom level calculation algorithm.
    • 37a0eb25 - Update the declare help patch.

    Compare with previous version

  • Author Developer

    Fixed some typos in the updated help patch and one of the commit messages.

  • Author Developer

    Also, please consider that this feature is not really advertised at all, I hid it away from the end user as well as I could. ;-) I don't know whether that helps my cause? Anyway, if all else fails, I can just hand this out as a special "teacher and student" edition to my own students, or to colleagues who are facing the same problem. It's not ideal since I'll have to keep maintaining this as a special branch on my own for the time being, but workable.

  • Let me try to divide and conquer:

    bendin: why can't you use [bendin 0 1]? That should work exactly the same in Pd Vanilla as it does in Purr Data.

  • Author Developer

    That should work exactly the same in Pd Vanilla as it does in Purr Data.

    Yes, I know that because I implemented that (rev. 4a4cf4f6). ;-) So let's not go down that rabbit hole again; as I said, I don't really care about declare -bendin (even though it's likely more convenient than having to edit all the bendin objects in a patch). So let's just assume that I removed that, leaving just declare -zoom. Would that make this MR any more acceptable to you?

  • Author Developer

    because I implemented that (rev. 4a4cf4f6)

    Sorry I gave the wrong revision, the one I wanted to mention is rev. 772072ec.

  • Author Developer

    This is getting off-topic, but as an aside and maybe an interesting bit of trivia which probably isn't documented anywhere... I was actually the guy who first noticed the botched bendin range and told Miller about it over a "Kölsch" at the famous "Mühle" brewery/pub when we both attended LAC 2008 at Cologne (Miller was the keynote speaker at the conference). But then I forgot to follow up on it with a bug report after the conference, and when I finally submitted that bug report some 8 years later, Miller told me that it was too late to fix it now. Which still makes me sad, because this could have all been solved back then if I filed that bug report back in 2008. Anyway, I had already been using pd-l2ork since ca. 2013, so I also reported the issue to Ico who promptly corrected this bug in pd-l2ork (from where you backported the fix in 2016, IIRC).

    The funny thing is, I still vividly remember that night at the "Mühle" in Cologne as if it was yesterday, while the entire past year of lockdowns and remote teaching is just a blur for me. I think that Miller introduced me to Claude Heiland-Allen (the genius Pd student who created pd-lua) there, or maybe it was one of the other brash young computer music students in the Pd community at the time. In any case, that was a great conference... And we probably wouldn't have all the bendin fixes, as well as Purr's pd-lua external, if it wasn't for that conference. ;-)

    Edited by Albert Gräf
  • Author Developer

    Ok, after that quick detour down memory lane: What about the MR, will you accept it if I remove declare -bendin? Otherwise, I might just as well close the MR now.

  • Which still makes me sad, because this could have all been solved back then if I filed that bug report back in 2008.

    The history of the Pd Vanilla bug tracker does not support that assertion.

    Ok, after that quick detour down memory lane: What about the MR, will you accept it if I remove declare -bendin?

    Ok, yeah. Since we still don't have the patch zooming yet I guess that's a reasonable compromise.

  • Author Developer

    Ok, then I'll go ahead with this, thanks!

  • Albert Gräf added 1 commit

    added 1 commit

    • ade851e7 - Add a canvas-local zoom flag.

    Compare with previous version

  • Author Developer

    Ok, there you go. Removed declare -bendin and rolled the rest into a single commit which can easily be reverted if there's a reason to do so.

    This is as unobtrusive as I can make it. Normal users don't need to know or mess with declare -zoom, and in that case the zoom logic will work exactly as before. If the option is used, it deals with all the corner cases (declare -zoom in a subpatch) in an efficient way (there's some clever bit of lazy zoom level evaluation going on under the hood to make those corner cases work correctly). I've tested this to death already, so I know that this works as advertised. :) Ready to be merged!

  • Author Developer

    I've tested this to death already, so I know that this works as advertised.

    Famous last words. I found a bug. :( Hopefully it's nothing serious, might be due to the refactoring I did when I eliminated the -bendin flag. So not so ready after all, I first need to look into this before it can be merged. Hopefully I'll find some time over the Easter holidays...

  • Albert Gräf marked this merge request as draft

    marked this merge request as draft

  • Albert Gräf added 1 commit

    added 1 commit

    • 6d5c50f2 - Add a canvas-local zoom flag.

    Compare with previous version

  • Author Developer

    Found and fixed it. The problem was that the initial zoom level was reset by declare -zoom 1 if zoom save/restore was enabled globally; it's only supposed to do that with declare -zoom 0. Seems like I never tested that specific case previously. Oh well. :) But now it works correctly with both declare -zoom 0 and declare -zoom 1, no matter whether zoom save/restore is enabled globally or not.

  • Albert Gräf marked this merge request as ready

    marked this merge request as ready

  • Albert Gräf mentioned in merge request !731 (merged)

    mentioned in merge request !731 (merged)

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading