Page 1 of 1

cc implementation help

Posted: 16 Oct 2017 11:35
by scrubber
Hello!
Been a while! So trying to finish off my patch for MIDIBOX TIA control
I have done all the basics and easy functions but now I have a few I'm not sure how to set using LSB and MSB

so example: I have functions I want to set (maybe best as a drop down menu? or knob?)

LFO MODE:

CC: 93
Hex: 5Dh
Bit 0 - enables LFO
Bit1: Sync with ASSIGNED note events
Bit2: Sync with ALL note events
bit 6-4: Waveform
0 - Sine
1 - Triangle
2 - Saw
3 - Pulse
4 Random
example 11h=17= enable & triangle wave
example 15h = 21 = enable & triangle & sync

I don't get how they got those hex and number examples at the bottom to set this?
how do I set these in Jazz editor, as a script?
anyone give me an example in the editor on how to set these values?

Re: cc implementation help

Posted: 16 Oct 2017 14:19
by janiliamilanes
You want to set the bits in an integer?
I believe Lemur the normal bitwise operators: https://en.wikipedia.org/wiki/Bitwise_operation
To set a bit use bitwise OR

something like

//create your backing store
decl myValue = 0
// set bit 3
myValue = myValue | (1 << 3)

Re: cc implementation help

Posted: 16 Oct 2017 14:44
by scrubber
not sure what I need to do at all?

so cc 93 is the control change number
then how do I set the bits required to enable the function? as in the list

in my other functions i've just been setting the cc number then scale (0-127) or whatever value is needed but this is something different that I don't understand at all

Re: cc implementation help

Posted: 16 Oct 2017 15:39
by janiliamilanes
????????

MSB and LSB are about binary numbers.
https://en.wikipedia.org/wiki/Most_significant_bit

"Setting a bit" will change the number.
00000001 is 1
00000010 is 2
00000011 is 3
etc.

Not sure what you want to do.

Re: cc implementation help

Posted: 17 Oct 2017 11:12
by scrubber
Basically I want to change CC parameters as in the list on here: http://www.midibox.org/dokuwiki/lib/exe ... _chart.pdf

most you just set the cc number and scale either 0-127 or 0-64 positive/0-64 negative
but some require bits to be set?
check out the list

Re: cc implementation help

Posted: 17 Oct 2017 16:07
by janiliamilanes
Yeah so as I said, use bitwise OR to se the bit in an integer

Re: cc implementation help

Posted: 20 Oct 2017 12:38
by Macciza
What you have missed is the binary representation of the numbers...
0001 0001 = 11h = 17 Decimal = Triangle Bits 4-6=1 and Enabled Bit 0=1
0001 0000 = 10h = 16 decimal = Triangle ... Dis-Enabled
0000 0001 = 01h =1 decimal =Sine ...enabled

0010 0001 21h 33dec Saw
0011 0001 31h 49dec Pulse
0100 0001 41h 65dec Random

Itiusing the bits inside so you need to work out the decimal numbers to send to match
Hope that helps