From: Joe E. <jo...@em...> - 2005-03-24 21:08:20
|
Steven Schmidt wrote: >>Two things to watch out for: >> >> > > * In Java, bytes are signed. So if the range is 0..255 before, > > casting it to a (Byte) will change that to -128..127. Thus, reading > > patch.sysex[index] may yield negative numbers. I had to compensate in > > my CZModel.getByte. > > This is what I want. How can I get this behavior in a model class? > > Hmmm.... strange. You might have a problem. Since your sysex spec uses C4 (-60) through 0C (12), the numbers match up (as opposed to, say, 0x00 to represent -60 and 0x49 to represent 12) so that the widget/param-model doesn't have to add/subtract anything to the number before it stores it. The only tricky part is if the widgets will try to store negative values... and if the param-models handle it correctly. I might take a look later. - Joe |