Home › Forums › General › Programming › multiple if syntax question
Tagged: add new lua method; lua; method;
- This topic has 39 replies, 5 voices, and was last updated 7 years, 2 months ago by human fly.
-
AuthorPosts
-
February 12, 2017 at 5:44 pm #71290
The checksum of the sysex message for the first value posted by human fly was 0x70 (112), so as you increase the xx value (sum variable), the checksum will decrease.
February 12, 2017 at 5:46 pm #71291exponent = to the power of, yeah?
but how can 2 to the power of 0 be 1?i’m gonna try both of these methods with the buttons
and see if i can it working.- This reply was modified 7 years, 2 months ago by human fly. Reason: offtopic
February 12, 2017 at 5:47 pm #71292The checksum of the sysex message for the first value posted by human fly was 0x70 (112), so as you increase the xx value (sum variable), the checksum will decrease.
oh of course, – there i was, lost in hexa-land 🙂
February 12, 2017 at 6:11 pm #71293before i do, what does elseif do (for my long version)?
with dasfaker’s, the checksum is worked out on not just
the value byte/s but also the address bytes. so that’s
0x04, 0x00, 0x0c, and the value (0x00 – 0x0F)attaching a nice little checksum calculator to this post,
i can’t find the site again right now. no install, just
unzip and run.panel:sendMidiMessageNow(CtrlrMidiMessage({0xf0, 0x41, 0x10, 0x16, 0x12, 0x04, 0x00, 0x0c, sum, 112 – sum, 0xf7}))
so ‘sum’ is the parameter value?
why is 112 in decimal? and why is it checksum minus sum?
that byte only needs to be the checksum. or is that how
‘checksum’ is expressed?and then it goes ‘end’, yeah?
Attachments:
You must be logged in to view attached files.February 12, 2017 at 6:12 pm #71295very nice, btw.
February 12, 2017 at 6:37 pm #71296got it: ‘elseif’ is between the possibles.
(in the long version)
and the whole thing ends with ‘end’.with dasfaker’s elegant method, i’m taking it that
‘112-sum’ means ‘checksum’, then? so that happens
with decimal rather than hexadecimal?time for a cup of tea.
- This reply was modified 7 years, 2 months ago by human fly.
February 12, 2017 at 6:52 pm #71298Just got my cup of tea as well…
You can put decimal or hexa in the CtrlMidiMessage table. If you write a number as 123 it will be taken as decimal while if you write 0xF5 it will be taken as hexa.
112-sum is indeed your checksum
So, with one calculation of sum you can fill in any message and send itFebruary 12, 2017 at 6:54 pm #71299I think you need to read the Roland manual.
Roland checksum:
Calculating the checksum follows a simple formula which is easily learned and applied. Following this formula will guarantee correct checksums:1. Convert the hex values to decimal.
2. Add the values together, but if the answer to any sum exceeds 127 then subtract 128.
3. Subtract the final answer from 128.
4. Convert the resulting value back to hex and use as the checksum.Example:
f0 41 10 16 12 04 00 0c 00 chk f7
Checksum is calculated only on bold values on your synth.1. Convert to decimal: 04 00 12 00
2. Add the values: 04 + 00 + 12 + 00 = 16
3. Subtract 16 from 128: 128 – 16 = 112
4. Convert to hex: 112 –> 70Another way:
1. Convert to decimal: 04 00 12 00
2. Add the values: 04 + 00 + 12 + 00 = 16
3. Divide by 128: 16 / 128 = 0 with remainder 16
4. Subtract remainder from 128: 128 – 16 = 112
5. Convert to hex: 112 –> 70February 12, 2017 at 6:56 pm #71300that is very cool, what you’ve just shown me.
i’ve been racking my head over this for a long time:
how to get 4 completely separate parameters out of one
parameter value range.
you can’t do anything like this on the Novation Remote.
and you can’t do 14bitCC either, with Coarse/Fine, like
with the SynthLiteII panel. in fact there are serious
limitations as to what is possible with that box. they
need to re-do the firmware and the editor to accept
different data formats – because it’s great to be able
to program it for hardware. mostly, people just map it
up to a plugin, and do it that way, so you’d map up to
a Ctrlr panel instead.and yet, the D-11O front panel has always been able to
do it, and the PG-10 controller can control everything
on all the parts at different addresses that do not
sum start+offsets in any immediate or user-friendly
way (see D-110 manual, p118/119).February 12, 2017 at 7:09 pm #71301yeah, i have read the manual, and years ago, i did
do it by hand, but i’m lazy and now i understand it
i’m allowed to cheat 🙂 – plus, if you’re rattling
through 400+ parameters, it’s nice to have a little
aid, same as midiox helps check through really
quickly, if, for example, you’ve just loaded it all
into a RemoteSL, and it runs to 17 pages, which the
D110 does, with Multi set-up, and a couple of octaves
of rhythm notes. you just twiddle the knobs, and make
a quick visual check that the checksum is decrementing
as the value increments – you can whizz through it,
and find mistakes and omissions with a quick visual
reference – is it moving or not. if you’ve done your
work and setting up thoroughly, it should be good.
and you only have to calculate the first checksum if
all your parameters are in consecutive numerical
order with no gaps – i make a notepad file, figure
out the first good message after listing all the
parameter names, and step through typing it all in
series. the RemoteSL actually calculates the checksum
for you – you just have to set the datatype to ‘roland’
for each control, press write twice, and it starts
doing it. it’s all hard manual labour. the editor
won’t do it, you have to set it on the hardware.
another shortcoming. Novation told me it was only
ever meant to be a beta software. funny they made
a markII of the device though, before they did a v1
of the editor 🙂 just proves nobody uses it much.February 12, 2017 at 7:10 pm #71303how about persuading them to update it?
- This reply was modified 7 years, 2 months ago by human fly.
February 12, 2017 at 7:27 pm #71304Thanks for the offer. I know what you are talking about, I own a Remote SL too, and made a template for the Snow years ago (I used the template editor), and another one with the BCR2000 , but now I’m not interested in controlling the synths this way.
February 12, 2017 at 7:38 pm #71305February 12, 2017 at 7:48 pm #71307For me it worked fine, but it was limited. Once I knew about Ctrlr I don’t need anymore.
Thanks Mr Kubiak!!!February 12, 2017 at 8:25 pm #71308For me it worked fine, but it was limited. Once I knew about Ctrlr I don’t need anymore.
Thanks Mr Kubiak!!!Yes indeed. Thanks Roman!
I have also a 25SL MkII but I would never want to control all the params of a synth like that. One button, one function and OK, max 2 pages so you can memorize…
Thus, when you have much more params, best is PC and Ctrlr 🙂February 12, 2017 at 8:47 pm #71310well i was foolish enough to have a go at it 🙂
i wanted something to use without a PC.
here’s the Remote D-110 as a bulk file, next time
you fire up your Remote:https://app.box.com/s/yo46rr2q3e67tnxhtkel3c3480uj7hot
the template series link up via the Pads, set as Template
links. no template series is more than 3 deep, most are
just 2, so they toggle A/B
(has 2 or 3 mistakes i just came across but otherwise working;
ok, so you don’t have a D-110..)here’s JV-1080(pattch edit, no multi setup):
https://app.box.com/s/up0kxs6srr7a1hhvntai9y4w12twspq7Kawai K1 (3 pages, preset edit)
https://app.box.com/s/0lsiqrds905a9y563ddusuq6d2jtfdnqi think the zeroSL mk2 is the only model without the side
navigation buttons. i have mk1 with the dual lcds. i’m
considering getting another one, as a 2 or 3 oct keyboard.February 13, 2017 at 4:38 pm #71342This code formatting in a message works for me now also. Thanks! Will make a note of this, tend to forget all this useful stuff ;-).
February 14, 2017 at 8:56 am #71348here’s a small panel with the long lua, not sending anything yet
>see attachedand here’s the lua, probably has errors:
>> see text attachedi’m off to have to go with dasfaker’s lua. just want to see if
i can get this working too. probably worth checking through the
panel+modulator properties, in case it’s inherited errors from
the original panel, etc.i’m confused about how the method is added. i add it in resources,
then call it up at ‘when value changes’ – but then i get an empty
lua if i look at it with ‘edit selected method’.
so i copied all of my text over all of what is in the dialog.
it still highlights red;
so then i run save and compile, and get back ‘OK’.
it still doesn’t send MIDI (Panel Mode enabled)back in a bit with the next file.
Attachments:
You must be logged in to view attached files.February 15, 2017 at 7:57 am #71370morning ! ok, so i’m messing around trying to get the
new Method running. taking this now over to this fresh topic here:February 20, 2017 at 9:05 pm #71409bump – follow-on/update on this.
reporting back: i’m feeling unreasonably chuffed at getting
a first method running (‘my little lua1’…)the ‘long’ method works perfectly. i couldn’t get it to compile
because the last end wasn’t put it correctly. i think it was as
simple as deleting the extra line.(?forgot!..)the second optimized method works but does a weird-thing on panel
load – it sends out 4 sysex messages – it seems the ‘end’ on each
condition is triggering the sum, or maybe it is the declaring of
modulators. i tried ‘ren’-ing the declares…but at that point
something was confusing me because another open panel, possibly
sharing same parameter ID/index# was also sending out its own
sysex for a different parameter. (Ctrlr bug, surely? should only
be the panel in view that should be active -?) – i think there
was a different problem then, i’ll have to try again. i also
made a hybrid version with getValue and then the sum process.
anyway: attached is a version that compiles and works, but sends
the 4 messages on load.Partials Lua2 H.zip
Attachments:
You must be logged in to view attached files. -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.