[L2Ork-dev] wrap~ bug

Jonathan Wilkes jon.w.wilkes at gmail.com
Tue Mar 31 10:42:00 EDT 2020


On Tue, Mar 31, 2020 at 9:45 AM Julian Simmons <info at juliansimmons.com> wrote:
>
> Hi All,
>
> Hope this is ok sending this query to this email.
>
> Reporting a bug with wrap~ (this is also present in PD not only in Purr Data - which I’m now using).

Hi Julian,

For long-standing bugs like this we add a bugfix codepath while still
allowing the old behavior using a
"compatibility" flag/method.

The idea is that if fixing a bug breaks an old patch, the user can set
the "compatibility" method with
a version they remember worked with the patch. (E.g., 0.41 or
something like that.) I have no idea if
users are actually doing that, but it's there.

The problem in this case is that Purr Data is starting with the wrong
value for the compatibility
method, so the old broken behavior is erroneously chosen. Once that is
fixed wrap~ will work as it should.

Cause of problem:

We're hard-coding a pd_compatibilitylevel value in m_glob.c. Why
aren't we defaulting to PD_MINOR_VERSION
instead? If no one has a good answer then I'll change it to that for a
future-proof fix.

-Jonathan

>
> wrap
> |
>
> 0.0 = 0
> 0.1 = 0.1
> 0.5 = 0.5
> 1.0 = 0
> 1.5 = 0.5
>
>
> wrap~
> |
>
> 0.0 = 1
> 0.1=  0.1
> 0.5 = 0.5
> 1.0 = 0
> 1.5 = 0.5
>
> as you can see there’s an issue with 0 = 1.
>
>
> The solution to this bug, is to apply wrap~ twice, so reversing the 0 bug issue,
>
> wrap~
> |
> wrap~
> |
>
> this gives...
>
> 0.0 = 0
> 0.1=  0.1
> 0.5 = 0.5
> 1.0 = 1
> 1.5 = 0.5
>
> 0 correctly now = 0, but also 1 = 1, which actually for applying to an offset 0 to 1 phasor~ is helpful, as the full 0 to 1 range of the phasor~ is maintained.
>
> The
>
> wrap~
> |
> wrap~
> |
>
> solution works, once you realise there IS a wrap~ issue and the trick to resolve it.  But many people may be expecting the 0 ‘zero’ value of wrap~ to act like wrap, it doesn’t.
>
> Either wrap~ should be made to deliver in the same way as wrap, or we should all be aware of the wrap~ bug and the double wrap~ solution.
>
> Thoughts?
>
> Many thanks,
>
> Julian Simmons
> _______________________________________________
> L2Ork-dev mailing list
> L2Ork-dev at disis.music.vt.edu
> https://disis.music.vt.edu/listinfo/l2ork-dev


More information about the L2Ork-dev mailing list