Yamaha DM1000 odd variable ranges
Posted: 14 Apr 2012 12:49
So I've got a script that's working great to send sysex to my DM1000 to control various things. Items that fall within the range of 0-127 are relatively simple. Once the word becomes too large for one bit, I just can't wrap my head around it. They've used a bunch of odd ranges for parameters. Here's the one I'm struggling with. If I can grasp this, I'm pretty sure I can figure the other ranges out.
The component being controlled is the channel compressor threshold. Value range is -540 to 0, correlating to -54dB to 0dB.
This is what I've come up with based on posts here to others' questions and digging through templates that gets it really, really close:
The problem there, is that it never reaches 540 (in sysex land {0x7F, 0x7F}.) The other problem is that it starts at {0x7C, 0x00} when I actually need it to start at {0x7B, 0x63} since it's a range of 540 decimal digits down from {0x7F, 0x7F} as opposed to up.
Anybody feel like helping guide me through this oddity? I'm intentionally rolling all the values over to 0x00 when x=1, because that's what the mixer sends back when I scroll through the values and watch the sysex coming in. I'm guessing this is some kind of internal "off" signal it sends to itself.
Thanks in advance!
The component being controlled is the channel compressor threshold. Value range is -540 to 0, correlating to -54dB to 0dB.
This is what I've come up with based on posts here to others' questions and digging through templates that gets it really, really close:
Code: Select all
decl val,dd1,dd2;
if(Threshold.msg_rcvd==0) {
val=round(range(Threshold.x,0,540));
if(val<=539){
dd1={0x7F}; dd2={0x7F};
} else if(val==540) {
dd1={0x00}; dd2={0x00};
}
send_sysex({sys_comp_hdr,sys_comp_thresh,sysex_channel,dd1,dd2,(floor(Threshold.x*512)>>7)+124&0X7F, floor(Threshold.x*512) & 0x7F});
} else {
Threshold.msg_rcvd=0;
}
Anybody feel like helping guide me through this oddity? I'm intentionally rolling all the values over to 0x00 when x=1, because that's what the mixer sends back when I scroll through the values and watch the sysex coming in. I'm guessing this is some kind of internal "off" signal it sends to itself.
Thanks in advance!