If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Help needed with bytes (4 Bytes)
10 posts
• Page 1 of 1
Help needed with bytes (4 Bytes)
Hey!
I have an problem that i have not figured out yet!
I'm creating editor for Roland Jd-xi and some parameters uses 4 bytes.
When i move knob to value 15 then parameter value is 0F.
As seen in the picture.
What i'm trying to do is when i move knob over 15. Lets say for 16. I want parameter value look like "0101" and so on
What is the best way to this?
hopefully I explained clearly.
I have an problem that i have not figured out yet!
I'm creating editor for Roland Jd-xi and some parameters uses 4 bytes.
When i move knob to value 15 then parameter value is 0F.
As seen in the picture.
What i'm trying to do is when i move knob over 15. Lets say for 16. I want parameter value look like "0101" and so on
What is the best way to this?
hopefully I explained clearly.
- Etgo23
- Posts: 8
- Joined: Fri Apr 19, 2013 5:57 am
Re: Help needed with bytes (4 Bytes)
Don't know if this is the 'best' way but sure this is an easy way from what you supplied:
- Attachments
-
- Decimal to Binary or Hex Conversion (Ruby) v2.fsm
- (43.6 KiB) Downloaded 895 times
-
- Decimal to Binary or Hex Conversion.fsm
- (42.87 KiB) Downloaded 895 times
-
tiffy - Posts: 400
- Joined: Wed May 08, 2013 12:14 pm
Re: Help needed with bytes (4 Bytes)
You can also do it like this then the output gives only the required/necessary number of digits:
- Attachments
-
- Decimal to Binary or Hex Conversion (Ruby) v3.fsm
- (43.64 KiB) Downloaded 896 times
-
tiffy - Posts: 400
- Joined: Wed May 08, 2013 12:14 pm
Re: Help needed with bytes (4 Bytes)
Hey thanks!
That gave some ideas what i can use.
Im sorryu that i didnt explain it clearly enough. Hopefully this time i explain.
This is the sysex string for delay level "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 00 39 F7"
If i move knob to value 15. String looks "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 0F 39 F7".
But if i move knob to value 16. String is "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 10 39 F7" which is wrong value.
What im trying to achieve is when the knob value is 16 the sysex string should look like this"F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 01 00 39 F7" and so on.
So after every 15 steps knob have to add hex to "00 -> 01" and reset the knob to value 00.
Is this clear enough ?
That gave some ideas what i can use.
Im sorryu that i didnt explain it clearly enough. Hopefully this time i explain.
This is the sysex string for delay level "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 00 39 F7"
If i move knob to value 15. String looks "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 0F 39 F7".
But if i move knob to value 16. String is "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 10 39 F7" which is wrong value.
What im trying to achieve is when the knob value is 16 the sysex string should look like this"F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 01 00 39 F7" and so on.
So after every 15 steps knob have to add hex to "00 -> 01" and reset the knob to value 00.
Is this clear enough ?
- Etgo23
- Posts: 8
- Joined: Fri Apr 19, 2013 5:57 am
Re: Help needed with bytes (4 Bytes)
Etgo23 wrote:Hey thanks!
That gave some ideas what i can use.
Im sorryu that i didnt explain it clearly enough. Hopefully this time i explain.
This is the sysex string for delay level "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 00 39 F7"
If i move knob to value 15. String looks "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 0F 39 F7".
But if i move knob to value 16. String is "F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 00 10 39 F7" which is wrong value.
What im trying to achieve is when the knob value is 16 the sysex string should look like this"F0 41 10 00 00 00 0E 12 18 00 06 20 08 00 01 00 39 F7" and so on.
So after every 15 steps knob have to add hex to "00 -> 01" and reset the knob to value 00.
Is this clear enough ?
It appears to me you are working on a Midi schematic? Sorry, but I do not have any experience with Midi, maybe someone else can help out there.
-
tiffy - Posts: 400
- Joined: Wed May 08, 2013 12:14 pm
Re: Help needed with bytes (4 Bytes)
Yeah i'm working with midi. Thanks you anyway. your schematics helped me with few other things.
- Etgo23
- Posts: 8
- Joined: Fri Apr 19, 2013 5:57 am
Re: Help needed with bytes (4 Bytes)
There are a few things that confuse me from your description. For example, you talk about 4 bytes, but the example is about 2 bytes. You talk about 15 steps, when it actually is 16 steps (Hex 00 to 0F). But I can give you a general tip.
Use modulus! The result of a modulo division will be the integer remainder. The higher number can then be generated with normal integer division ("floor" rounded).
Use modulus! The result of a modulo division will be the integer remainder. The higher number can then be generated with normal integer division ("floor" rounded).
- Code: Select all
Example:
knob value is 14
14 % 16 = 14 (hex 0E)
14 / 16 = 0 (hex 00)
knob value is 17
17 % 16 = 1 (hex 01)
17 / 16 = 1 (hex 01)
knob value is 29
29 % 16 = 13 (hex 0D)
29 / 16 = 1 (hex 01)
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Help needed with bytes (4 Bytes)
Here's how I would do it
Very similar to what Tula is suggesting
Hope this helps
Very similar to what Tula is suggesting
Hope this helps
-
DaveyBoy - Posts: 131
- Joined: Wed May 11, 2016 9:18 pm
- Location: Leeds UK
Re: Help needed with bytes (4 Bytes)
...Or in only green prims:
- ChrisHooker
- Posts: 55
- Joined: Tue Jul 13, 2010 10:02 pm
Re: Help needed with bytes (4 Bytes)
Hey!
Hahah! Sorry to confuse you tulamide. Maybe i should drink more coffee before starting topics like this.
Hmm. interesting ideas. I'll will try these methods. Thanks guys!
Hahah! Sorry to confuse you tulamide. Maybe i should drink more coffee before starting topics like this.
Hmm. interesting ideas. I'll will try these methods. Thanks guys!
- Etgo23
- Posts: 8
- Joined: Fri Apr 19, 2013 5:57 am
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 60 guests