Support

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

Help needed with bytes (4 Bytes)

For general discussion related FlowStone

Help needed with bytes (4 Bytes)

Postby Etgo23 » Thu Jan 10, 2019 9:12 pm

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.
Image
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)

Postby tiffy » Thu Jan 10, 2019 11:52 pm

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 802 times
Decimal to Binary or Hex Conversion.fsm
(42.87 KiB) Downloaded 784 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Help needed with bytes (4 Bytes)

Postby tiffy » Fri Jan 11, 2019 1:15 am

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 805 times
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Help needed with bytes (4 Bytes)

Postby Etgo23 » Fri Jan 11, 2019 8:53 am

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 ? :)
Etgo23
 
Posts: 8
Joined: Fri Apr 19, 2013 5:57 am

Re: Help needed with bytes (4 Bytes)

Postby tiffy » Fri Jan 11, 2019 10:16 am

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.
User avatar
tiffy
 
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Help needed with bytes (4 Bytes)

Postby Etgo23 » Fri Jan 11, 2019 11:08 am

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)

Postby tulamide » Fri Jan 11, 2019 6:35 pm

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).

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: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Help needed with bytes (4 Bytes)

Postby DaveyBoy » Fri Jan 11, 2019 11:15 pm

Here's how I would do it

Very similar to what Tula is suggesting

Image

Divmod.fsm
(254.35 KiB) Downloaded 811 times


Hope this helps :D
User avatar
DaveyBoy
 
Posts: 131
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Re: Help needed with bytes (4 Bytes)

Postby ChrisHooker » Sat Jan 12, 2019 3:04 am

...Or in only green prims:
Integer to Split-Hex.fsm
(54.49 KiB) Downloaded 811 times
ChrisHooker
 
Posts: 55
Joined: Tue Jul 13, 2010 10:02 pm

Re: Help needed with bytes (4 Bytes)

Postby Etgo23 » Sat Jan 12, 2019 9:19 am

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!
Etgo23
 
Posts: 8
Joined: Fri Apr 19, 2013 5:57 am


Return to General

Who is online

Users browsing this forum: Google [Bot] and 42 guests

cron