Toggle - Initial State

Issue #39 resolved
Christopher Dotson created an issue

This may be a feature not a bug, but I think the initial state of the Toggle button is reversed from expectations. Upon patch initialization, the Toggle block outputs Value 2 rather than Value 1.

In the example below, when you turn on the Patchblock the LED's default state is ON, although I would expect that everything starts in the OFF position to avoid sudden audio events from scaring the neighbors.

AAIAAACIeJxjYGBfz36OAQL+/wchGJOBLSQ/PT0nlYHF3DLVkIGBiX0/hyADv4G1gbWhNYQ0tDZiBKpjYOBwzs8rKcrPKWZgSTOwMGVgYAQby2lgDYGGjEwMTAwMLD6uLkAlqcaGqUBt7Lc4QhlYwQoYAA4bG7g=

This issue is fixed by an edit to line 11 (add a negative sign):

        <variable dtype="int32_t" name="state" value="-1" />

Since this change could break people's existing patch logic, the alternative is to specify in the Help file that the block starts with Input 2.

Comments (3)

  1. James Surgenor

    This is definitely a bug, and regardless of whether or not it will break existing patches I think it needs to be fixed. The software is still in Beta so these kind of changes should be expected (hence the warnings that appear when blocks are different).

    I recently made a patch where this caused a bit of an issue, so it'd be good to get it fixed :)

  2. Log in to comment