[PD] xeq & bending[part 2]

Michal Seta mis at creazone.com
Sun Oct 27 17:48:17 CET 2002

Sorry for replying in 2 installments but I needed to get it off my chest...

On Sun, 27 Oct 2002 10:30:35 -0500 (EST)
Mathieu Bouchard <matju at sympatico.ca> wrote:
> (x<<n)|y is the same as (x<<n)+y when y is smaller than 1<<n (and not
> negative). in a more general situation, however, ORing would not be
> inversible. (I don't know why | was used instead of + here; + is clearer)

I got the '|' instead of '+' from this code: (http://home.planet.nl/~roosp/mt_pitch.html)

unsigned short CombineBytes(unsigned char First, unsigned char Second)
unsigned short _14bit;

_14bit = (unsigned short)Second;
_14bit|=(unsigned short)First;

of course I should have looked into Krzysztof's source for xeq_parse first (which I did while I was downloading my messages which already included the solution) and there the '+' is used and, of course, it is clearer.  reversing the addition _is_ simple :)

Thanks a lot.


More information about the Pd-list mailing list