Menu

#1 float doesn't get converted to integer

1.0
closed
nobody
None
2015-05-12
2015-04-05
Renato
No

Hi, just started looking into osc2midi, and I can't convert an incoming float (in the [0,1] range) to an integer in the 1-127 range. I have this line in my profile:

/1/fader{i} f, cc, float: controlchange( channel, cc, float*127);

but as you can see from the verbose output below, a CC event with 0 velocity is allways generated. Am I doing something wrong?

cheers,
renato

$ osc2midi -p 8000 -m2o -m touchosc-simple -v -c 3
Using map file /home/renato/.osc2midi/touchosc-simple.omm
pair created: /1/fader{i} f, a, x2 : controlchange( channel, a, y3 )
pair created: /multi/{i} i, a, b : controlchange( channel, a, b )
2 pairs created.
starting osc server on port 8000
opening client...
assigning process callback...
initializing JACK output:
creating ringbuffer...
Ready.
matches found:
/1/fader2 f, 0.883230 -> controlchange ( 3, 2, 0 )

matches found:
/1/fader1 f, 0.777950 -> controlchange ( 3, 1, 0 )

matches found:
/1/fader5 f, 0.480254 -> controlchange ( 3, 5, 0 )

Discussion

  • ssj71

    ssj71 - 2015-04-06

    Looks like you are doing everything correctly. If you look at the pair created it doesn't show the *127 in the first pair. It must be a bug in the map parser. I'll check it out today.

    Thanks for the report.

     
  • ssj71

    ssj71 - 2015-04-06

    Ok I found it. It doesn't work correctly when you don't have a space between the last variable name and the colon. So it trips on "float:" If you change if from:
    /1/fader{i} f, cc, float: controlchange( channel, cc, float127);
    to
    /1/fader{i} f, cc, float : controlchange( channel, cc, float
    127);

    it will work. This is obviously a stupid detail that you shouldn't have to care about so I'll fix it, but that change will get you going right away while I update the code.
    Thanks again.

     
  • Renato

    Renato - 2015-04-06

    thanks to you :) osc2midi is really nice and helpful. I might be sending you some touchosc profiles to ship with it (the included one is strange, AFAICT none of the default touchosc layouts sends those OSC messages). Oh BTW adding a space before the colon did indeed work.

    cheers

     

    Last edit: Renato 2015-04-06
  • ssj71

    ssj71 - 2015-04-06

    The fix was pretty easy in the end. You will now find version 0.1.01 in the files section which should resolve this bug. If you would like to build and verify that its been resolved I'll close this issue.

    Thanks!

     
  • ssj71

    ssj71 - 2015-04-06
    • status: open --> accepted
     
  • ssj71

    ssj71 - 2015-05-12
    • status: accepted --> closed
     

Log in to post a comment.