Giter Site home page Giter Site logo

Comments (9)

ssj71 avatar ssj71 commented on August 23, 2024

Sorry I'm not quite understanding how you want to format the message. I think maybe the line:

/midi{0} m, msg : midimessage( msg )

might do what you want. If not, send me a few examples of the OSC messages you expect and their midi equivalents.

EDIT: I should mention, I don't have any devices that use the OSC m type for midi messages, so this part of OSC2MIDI isn't very well tested. If you find issues, I'd love to make it work so please let me know.

from osc2midi.

Keeze avatar Keeze commented on August 23, 2024

I have tried to use the m type. I have tried many combinations like:
/midi1 m, state, n, vel : note( channel, n, vel, state);

matches found:
  noteon ( 0, 48, 12 ) -> /midi1 ,m MIDI [0x00 0x00 0x00 0x00]

I was expecting something like

/midi1, m MIDI [0x90 0x30 0x0C 0x00]

Note that I am a complete noob...

from osc2midi.

ssj71 avatar ssj71 commented on August 23, 2024

I'm not sure we currently have a good way to generate exactly what you put. Did you try

/midi1 m, msg : midimessage( msg );

? That should show something like what you printed.

Your mapping:

/midi1 m, state, n, vel : note( channel, n, vel, state);

only lists 1 variable type in the OSC message which is type 'm'
The only way to make an 'm' type variable is with the midimessage() command on the midi side of the mapping. Since you only listed 1 variable type, all the other variable names you listed (state, n, and vel) were ignored. Since any midi message can be put into a single 'm' variable in OSC I didn't think it would be necessary to allow arbitrary mappings of select messages to an 'm' variable. If you really need to specify note-ons to fill the OSC message you could try a double mapping with the --strict option which might get the result. The mappings would be something like:

/midi1 miii, msg, state, n, vel : midimessage( msg );
/midi1 miii, msg, state, n, vel : note( channel, n, vel, state);

Since the 2 lines are the same it will require to match both midi commands (any midi message and a note on or off). But this will show something along the lines of:

noteon ( 0, 48, 12 ) -> /midi1 ,miii MIDI [0x90 0x30 0x0C 0x00] 1 48 12

Which I don't think is what you are looking for. So I still think that my first suggestion is the closest to what you want. If I'm still misunderstanding or you really need to be able to arbitrarily map the bytes in a midi type variable let me know.

from osc2midi.

Keeze avatar Keeze commented on August 23, 2024

The first almost did a great part of the job ( /midi1 m, msg : midimessage( msg ); ) It only looks like the ouput is shifted against the output I get when I route a midi keyboard connected to the SEQ4 to OSC.

Sent from SEQ4: /midi1 m, MIDI [0x90 0x3c 0x35 0x00]
Sent from osc2midi: /midi1 ,m MIDI [0x00 0x90 0x3c 0x39]

So, one of the machines has the output shifted. And how to find out which one...
I am also creating a topic on the Midibox forum and see what they have to say.

Thanks so far!

from osc2midi.

ssj71 avatar ssj71 commented on August 23, 2024

I'd bet its osc2midi, I think I can fix that though. Let me look at it.

from osc2midi.

ssj71 avatar ssj71 commented on August 23, 2024

Actually upon investigation, according to http://opensoundcontrol.org/spec-1_0
the m type must have data: "4 byte MIDI message. Bytes from MSB to LSB are: port id, status byte, data1, data2"

EDIT:
So I think this is a bug in Midibox. If you would like to make a hacked version of OSC2MIDI that works around this I think the key is to change pair.c line 1444-1446 to read:

                   msg[0] = argv[i]->m[0];
                   msg[1] = argv[i]->m[1];
                   msg[2] = argv[i]->m[2];

and also lines 1793-1796:

 1793                 m[0] = mymsg[0];
 1794                 m[1] = mymsg[1];
 1795                 m[2] = mymsg[2];
 1796                 m[3] = 0;//port ID

(the change is in the indices of the m array). This could at least get you going until its changed upstream. I'm not going to add this since it is not consistent with the OSC documentation. Keep me up to date with what the midibox folks say.

from osc2midi.

Keeze avatar Keeze commented on August 23, 2024

Your hack works (both ways), so confirmed that the mismatch in datatype encoding is the culprit!
Keep you updated

Tnx!
Kees

from osc2midi.

ssj71 avatar ssj71 commented on August 23, 2024

is there any update on this? I would like to close this issue.

from osc2midi.

Keeze avatar Keeze commented on August 23, 2024

Hi,

Sorry for the delay, problem is solved and issue can be closed.

The author of the midibox software has fixed the problem (something with parsing the incoming OSC messages).

Cheers,
Kees

from osc2midi.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.