|
Post by mo13 on Jun 1, 2022 19:05:58 GMT
back here on another increment subject:  I'm trying to map these (conserining a longer list of specific MSB/LSB) parameters without having much experience with 14 bit yet, I was wondering if there is workaround for this so that for instance 7 bit modulation sources would act as 14 bit. I found an older code by Nic converting CC to pitchbend so I thought maybe something similair would be possible for the larger increment of MSB/LSB. I only came as far as selecting the right user bank + presets:  in a way which I think is not totally correct but it works: IF M0 == C0 Snd B0 00 00 Snd B0 20 10 End
I only discovered that those 2 B0 CC's + values correspond to 'user bank 16' by finding a sweet spot on a controller that sends out MSB/LSB. so I still don't understand how to devide the numbers up correctly for the desired bank or the rest of the controls. I thought to give it a shot here given the earlier help of uncledave on the matter!
|
|
|
Post by uncledave on Jun 2, 2022 0:31:00 GMT
What you did is correct for Bank Select (CC 0 and 20 ($32)), sending MSB 0 and LSB 10 ($16). That's how it works: MSB on the low CC #, LSB on the CC# +$32.
I've done this for ID700 with my controller. I found that 14-bit was only useful for the indexes and the filter frequency. The other parameters are fine with just the MSB. I didn't consider bank and program select, which are going to be special.
There's no problem using a 7-bit source and sending it to the MSB only. No need to mess with the LSB in that case.
Does your controller send MSB/LSB as two separate CCs, or is it some other format? Whatever it is, it would be simple to convert it into thw two CCs expected by ID700. You can use a table to map from what the controller sends to the CCs you want to control; basically, when a message comes in, use its identifier to select the correct CC in ID700.
|
|
|
Post by uncledave on Jun 2, 2022 0:52:22 GMT
Here are a couple of subs that you could use to send MSB/LSB CC pairs. You'd include them in your If Load section. This is basically all you need to send these things. The rest will depend on the details of your controller. Note that SendHiRes lets you send any number, as long as it's < 16384.
If load
# sends MSB and LSB on 2 CCs spaced 32 apart # pNumb is the CC# for the MSB Sub SendHiPair pNumb pMSB pLSB Send B0 pNumb pMSB Mat I28 = pNumb + 20 Send B0 I28 pLSB End
# sends a 14-bit value on two CCs # pNumb is the CC# for the MSB Sub SendHiRes pNumb pValue Mat I20 = pValue / 80 # shift MSB down Mat I20 = I20 & 7F # mask to ensure only 7 bits Mat I21 = pValue & 7F # mask off 7-bit LSB SendHiPair pNumb I20 I21 End
End
|
|
|
Post by mo13 on Jun 2, 2022 12:41:11 GMT
Good to hear, I was just thinking if it's not unnecessary to include those 2 CC's with each PC send, as I assumed that the bank gets set by the first send, but I guess it can't hurt? You're right! It's the EC4 controller which we worked on earlier to convert to SysEx, so yes two separate CC's come out of it. But I was just using it for the purpose of finding the right spot for MSB/LSB, the intention is to use 7bit CC's (out of Drambo + miRack) to convert them to 2 pairs if possible, actually I also asked this because in case this would work then I'd have another use for it with my MIDI-CV converter:  I didn't get your subs code working yet, with for instance sending a 7 bit CC through it, but maybe I misunderstood something there.
|
|
|
Post by uncledave on Jun 2, 2022 15:38:41 GMT
Good to hear, I was just thinking if it's not unnecessary to include those 2 CC's with each PC send, as I assumed that the bank gets set by the first send, but I guess it can't hurt? Once the bank is set, either manually on the screen or by BankSelect, there's no need to send it repeatedly. Maybe you could send it once, just to be sure it's correctly selected. You don't need anything special to send a 7-bit CC. Just send it to the MSB (lower) CC#. If you don't actually have high-resolution data, there's no reason to use these MSB/LSB CC pairs. I suggested those two functions to either take 2 7-bit values, like from the EC4, or one 14-bit value, and send the correct CC pair. There's no reason to use them for plain 7-bit data, though I guess you could SendHiPair CC# MSB 0. That would just send 0 on the LSB CC#. Or you could multiply the 7-bit value by 80 and send it with SendHiRes. That would have the same effect. I can help you if you describe exactly what you are receiving and what you need to send. I wouldn't recommend trying to use two 7-bit controllers to create a 14-bit value because there's no natural connection between them. If the MSB is at maximum, you need to raise the MSB a little bit and zero the LSB. This will be jerky and tricky. It would only be useful if you're trying to hit very precise values. But I suppose if you're generating them from an algorithm that computes a hi-res value, then splits it into 2 CCs, it would work. Of course, if you configure the 2 CCs correctly in Drambo or miRack, you could send them straight into ID700. Splitting a Drambo CV value into MSB and LSB would require some tricky arithmetic. That's harder than anything we've discussed here.
|
|
|
Post by mo13 on Jun 2, 2022 16:13:38 GMT
That's cleared up now, I do have a hardware high res. CC looper with 1024 individual data points per clip but it's limited to 6 CC's per clip, got a little overwhelmed after acquiring ID7000 this week and seeing the amount of modulation sources + the general idea of sending out 14bit CC's to my MIDI-CV converter, but hey can't have it all is the above MSB/LSB code of any help for the CC looper? I still don't fully understand what it was ment for. yeah that's easy done then.
|
|
|
Post by uncledave on Jun 2, 2022 16:45:39 GMT
That's cleared up now, I do have a hardware high res. CC looper with 1024 individual data points per clip but it's limited to 6 CC's per clip, got a little overwhelmed after acquiring ID7000 this week and seeing the amount of modulation sources + the general idea of sending out 14bit CC's to my MIDI-CV converter, but hey can't have it all is the above MSB/LSB code of any help for the CC looper? I still don't fully understand what it was ment for. It was meant to simplify sending the hi-res CC pairs, given that you have either the two 7-bit values, or one 14-bit value. I generate 14-bit values from my incremental controller, and use that code to send those values to ID700. Maybe you were asking about receiving those values from ID700; it's a little hard to tell. Receiving is a bit tricky, since you need to recognize the paired CC values. I don't know anything about the CC looper. I wouldn't focus on the 14-bit issue. When you need it, you'll know.
|
|
|
Post by mo13 on Jun 4, 2022 12:21:50 GMT
uncledave , is it correct that the individual harmonics parameters of ID700 are not reachable by CC's ? They are exposed in AUM and Drambo, hosting it in Drambo which is limited to 16 mapable parameters, that limits the modulation by 8 harmonics per wave instead of 32. Unless I missed something in the CC chart @manual?
|
|
|
Post by uncledave on Jun 4, 2022 13:46:29 GMT
I believe you are right. But remember, the waves are not the only sources of harmonics. The FM synthesis generates harmonics, determined by the frequency ratios and index values. The wave is just icing on the cake.
|
|
|
Post by mo13 on Jun 27, 2022 20:24:31 GMT
Hi uncledave , I'm looking into revisiting your initial MSB/LSB to SysEx script while building a controller in Drambo for my Quad Env. (an algorithm on the Disting device on which succesfully worked on earlier on the same matter. I just found out that parameters beyond CC64 are only accessible by SysEx. After a quik search I ran in to this thread where I assume you have suggested that such thing might in practice be possible, before I try to dissect that chain of modules I was wondering if this is still the best way to go about this? the concerning SysEx parameters are 8 faders which should have full range 0 to Max values. And a few boxes (switches) that need to hit specific values which I've specified by open gates (CC example:  This is already possible in Touch Osc. which sends out a string of SysEx upon say engaging the gate box:   Now that I've finished most of the controller in Drambo and after succeeding earlier with reaching similar parameters with 14bit, I thought it would not hurt to also be able to P-lock them! Ps. If I hook the Disting up to the original editor I think I can get more specific SysEx data on the switches values, as from Touch Osc it seems to be sending extra stuff at times when moving between the values.
|
|
|
Post by uncledave on Jun 27, 2022 22:06:57 GMT
Hi. I have no idea what you're trying to do. But a couple of things you say make me nervous. First, you talk as if MSB/LSB is a specific thing. It it not. A pair of CCs can be used to send a 14-bit value over MIDI. The MIDI spec suggests pairing CCs 0..31 with CCs 32..63 for sending MSB/LSB pairs. NRPN uses one pair of CCs to send a value, and another pair to send a parameter number. This allows controlling a huge number of values, but the interface is clunky and tricky to implement. The CC pair scheme works if the receiving hardware or software is built to expect it. But when communicating with a script, we can use any of the messages that already have two data bytes, like Note On or Off, Pitch Bend, or even Polyphonic Pressure. It's just a matter of what the sender is capable of.
A tricky thing for a script like StreamByter or Mozaic, is that they're made to process one message at a time. So if you're using two CCs to send a 14-bit value, the script has to receive one CC, then wait for the other one before acting on the pair. That means it's important to always send them in the same order, etc. Synchronization can become an issue.
Second, a SysEx message allows an app or hardware to send or receive any data inside a SysEx wrapper. But every SysEx message format is different, and you need software specifically built to communicate with your hardware, like the scripts we've written. So, have you configured TouchOSC to send the correct message for the Disting?
So, finally, what are you trying to do? Do you have data in Drambo that you want to send in 14-bit form to Disting? The Drambo logic I posted in that other thread will convert a value into two values, representing the MSB and LSB components. Not sure about sending it out over 2 CCs, but that should not be too difficult. Then you'll need a script to convert that to the correct SysEx format.
Cheers, Dave
|
|
|
Post by mo13 on Jun 27, 2022 22:30:39 GMT
I see now, thanks for the insights. I didn't mean anything to do with NRPN, just made an example of that thread of someone trying to send out a pair of CC's but which of course can be done in a lot of ways. I just found out that Drambo has a Pitch Bend module which I'll try tomorrow with the latest PB to SysEx script. If that's worth it at all? I also wouldn't need super accurate increment on the remaining faders in case this might work that way, fore mostly just looking for a way to hit specific values from the switches so for that it should be more accurate, I'll try to explain it a little better after sleep. Touch Osc was configured by someone else btw otherwise I think I'd be making more sense here 
|
|
|
Post by mo13 on Jun 28, 2022 9:05:54 GMT
uncledave , I think this is looking promising, sending out Pitch Bend out of Drambo to an MF Port (as Drambo didn't like to send out SysEx) and then running it through your script into the Disting. All is receiving with fine increment, only thing I I noticed that we have Alias maxValue which was set to $165 for the previous use of selecting drum hits. With this Envelope algorithm I for instance have a Scale parameter that runs up to 10.0V, so I've set the maxValue to $100 which it reaches fine now, but it also needs a negative value as it gos down to -10.0V. Is that something implementable here? #DistingSelectPB # Receives a Pitch Bend value and sends it to # Disting EX as a set parameter SysEx message. # Route script output to a MIDI connection to disting. # Remember, all numbers are hex, unless $xx. # We assume the Pitch Bend channels follow in sequence. # Disting parameter numbers are given by a table. You can adjust # them as desired. # Note the separation of variable names: Ki for constants, # Ji for saved values, Ii for temp values. Aliases make the # program more readable, since we don't have to remember # the array indices.
If load # Note: the channel number is the actual message value (range 0..F), # not the MIDI channel number (range 0..$16). Alias 0 baseChan # Channel number for the first parameter Alias 14 numParams # number of parameters Alias $100 maxValue # value corresponding to max PB value # Disting parameter numbers corresponding to each channel. # Edit as desired, don't forget the $. Ass K10 = $64 $65 $66 $67 $68 $69 $70 $71 $72 $73 $74 $75 $76 $77 # No adjustable values below this line ——————————————————— Set Name DistPB Alias 10 paramBase Alias I00 reg0 Alias I01 reg1 Alias I10 temp0 # this value cannot happen # these registers store the last value sent for each parameter Ass J00 = 4000 4000 4000 4000 4000 4000 4000 4000 4000 # combines two 7-bit bytes into a 14-bit value. Result must be 16-bit. Sub CombineBytes result LSB MSB Mat result = 80 * MSB Mat result = result + LSB End # splits the give 14-bit value into low and high bytes Sub SplitBytes LSB MSB value Mat LSB = value & 7F Mat MSB = value / 80 End # display the parameter and value and add to monitor stream Sub ShowData theParam theValue Set LB0 theParam +D Set LB1 theValue +D Log Param theParam +D Log Value theValue +D End # scales the given 14-bit value to the given maximum, returning # the updated value. This method creates Max+1 value bands, # numbered 0..Max, with the first and last being half size. # This is suitable for a discrete (integer) parameter. Sub ReScale theValue theMax Mat P0 = theMax * theValue Mat P0 = P0 + 2000 # ensure rounding (like adding 0.5) Mat theValue = P0 / 4000 # scale down End End # Initialization ———————————————————————————
# this blocks any PB messages. Anything else passes through. If MT == E0 # handle PB message If MC >= baseChan # require channel in expected range Mat reg0 = MC - baseChan If reg0 < numParams # Order of values in PB is LSB, MSB. CombineBytes reg1 M1 M2 # combined 14-bit value ReScale reg1 maxValue # scale to given maximum # only process if scaled value changed If reg1 != JI00 # save the new value Ass JI00 = reg1 # get the parameter number from the table Mat I0F = reg0 + paramBase Ass reg0 = KI0F # diagnostic display ShowData reg0 reg1 # send SysEx msg to set parameter. SplitBytes M1 M2 reg1 Snd F0 00 21 27 5D 00 46 reg0 00 M2 M1 F7 End End End End
Block
I've already adjusted the Aliases and K10 to the right data. Edit: I just got the switches working to select those 'boxes' as was seen in Touch Osc. So It's only a matter of that negative value for the sliders. I'll wait with setting all of those up yet in case we need a second Pitch Bend or some other logic.
|
|
|
Post by uncledave on Jun 28, 2022 11:12:34 GMT
Hi. We were treating Pitch Bend as unsigned, ranging from 0 to 4000. Now, Pitch Bend normally treats the middle value, 2000, as zero, so 0..2000 are negative and 2000..4000 are positive pitch changes. The value is still unsigned, but is processed relative to the mid value. We could easily handle that, but how are negative values encoded in the SysEx message? Are they processed relative to the middle, possibly via a hardware configuration setting? Or are they actually transmitted as 2's complement (negative) values? Which hardware module are these SysEx being sent to?
Edit: I have the manual for Disting firmware 4.7, and I cannot find "Quad Env". Exactly which module/version are we sending these SysEx to?
|
|
|
Post by mo13 on Jun 28, 2022 12:01:19 GMT
Sorry you are looking at the wrong manual, we need the EX version and you are looking at MK4, I got used to just typing Disting as we worked on it before and you've seen that manual a few times. Here is the correct one with Quad Envelope @page 108 Yes, the ones that are map-able until $64 are possible to configure via the hardware for min-max values. The ones above that are non configurable that way which are of concern here. The ones that need to approached for that middle value are $65-68 and $74-77. The rest I can easily set up with from how the script handles PB now, would those then need to be put in a sub?
|
|