|
Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search!
Hi there,
> From: Hendrik Jan Veenstra <h@...>
>
> My guess (from experience with other synths) would be that every time
> you have to send an entire byte with all bits set correctly for all 3
> functions. So when setting function 1 to have the value "3"
(both
> bits on), you cannot simply send a byte 0000 0011, as that would set
> functions 2 and 3 to have value 0. Instead you have to merge the
> values for all 3 functions and send that as a byte. So when all
> functions are set to value 1, you should send 0100 0101 (bits 6, 2
> and 0 set to 1).
Unless it's possible to subtract (or add a negative number) certain
values in order to change the whole 8bits.
so,
69 + (-1) = 68, 69 + (-5) = 64, 69 + (-64) = 5...
i.e.,
0100 0101 +
11111111
--------------
0100 0100
0100 0101 +
11111011
--------------
0100 0001
Can the environment do this kind of stuff?
with regards,
--
Lachlan Deck
ldeck@...
Thoughts from the mind of Lachlan Deck, 02-04-2002:
> > From: Hendrik Jan Veenstra <h@...>
> > My guess (from experience with other synths) would be that every
time
>> you have to send an entire byte with all bits set correctly for all
3
>> functions. So when setting function 1 to have the value
"3" (both
>> bits on), you cannot simply send a byte 0000 0011, as that would
set
>> functions 2 and 3 to have value 0. Instead you have to merge the
>> values for all 3 functions and send that as a byte. So when all
>> functions are set to value 1, you should send 0100 0101 (bits 6, 2
>> and 0 set to 1).
>
>Unless it's possible to subtract (or add a negative number) certain
>values in order to change the whole 8bits.
"Unless" what? I don't get what you mean. Something is not
possible
unless you can subtract? Is that what you intended? But what is
'something' then?
>so,
>69 + (-1) = 68, 69 + (-5) = 64, 69 + (-64) = 5...
>
>i.e.,
>0100 0101 +
>11111111
>--------------
>0100 0100
>
>0100 0101 +
>1111 1011
>--------------
>0100 0001
>
>Can the environment do this kind of stuff?
Not directly, but you can work around it. First of all, there is no
such thing as a negative number in the environment, so adding
negatives is not going to happen anyway. That means that somehow you
have to store your negative values as positives -- i.e. -5 as +5.
And that in turn makes the above simple: use a transformer set to
subtract, and use the positive value (from e.g. a fader) as a meta
event to set the "subtract value". I.e. dragging the
"subtraction
fader" to e.g. 5 sends a meta event to a transformer that's then
being set to "Sub 5". Easy as pie.
The only complication is that often you immediately want to use this
subtraction value -- i.e. you have some parameter/fader value set to
e.g. 100, you change the subtraction fader to 5, and now you'd like
to get an output signal of 95.
The way to achieve this is to have the subtraction slider first set
the transformer's "Sub" value, and then generate a
"bang" that bangs
the "100" into the transformer, resulting in a 100-5• output.
Not very complicated, really, once you get the idea -- I've done this
dozens of times.
It would be very convenient however if transformers somehow
remembered the last value they received at their input, and if there
then was some sort of meta event that not only sets the
operations/conditions but also recalculates the result with the last
input. A kind of meta-set combined with a bang, all in 1 message and
operating within one transformer. Would really save a lot of trouble
in such a (quite often needed) scenario.
But... uhm... how does all this apply to the original problem of
combining multiple bit-level messages into one byte? As far as I can
tell, my 1st remark, quoted above, is usually correct: when sending a
multi-msgs, consisting of a bit-OR of messages, you have to combine
them each time you send the message, since otherwise you'll reset
some of them to zero.
I haven't gone into the details of how to do this (yet) since I
wasn't sure if that was indeed the question... The basic approach
would be the same however: generate some "Add xxx" value (meta
event
"set transformer operations lower value") and bang the other
messages' old values to recalculate the result.
--
Hendrik Jan Veenstra <h@...>
Omega Art: http://www.ision.nl/users/h/index.html
Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search! Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search! © 1994-2008, All Rights Reserved. |