Skip to content

Pattern/ route function for multiple addresses #161

@ceceba223

Description

@ceceba223

Hey,
I'm looking for a way to send multiple key presses via osc. The addresses are supposed to look something like this:

/Key20

/Key21

I can achieve this by writing one address at a time like this:

OSCMessage msg("/Key20");

But I need a function which works for all keys, so I modified it to look like this:

  char address_base = "/Key";
  address_base += key_id;
  OSCMessage msg(address_base);

However that returns an error:

C:\Users\Me\Documents\Arduino\libraries\OSCMessage/OSCMessage.h:112:2: note: candidate: OSCMessage::OSCMessage(const char*) <near match>
  OSCMessage (const char * _address);
  ^~~~~~~~~~
C:\Users\Me\Documents\Arduino\libraries\OSCMessage/OSCMessage.h:112:2: note:   conversion of argument 1 would be ill-formed:

exit status 1

Compilation error: no matching function for call to 'OSCMessage(char&)'

From the documentation I guess the "route" function or the pattern matching could be helpful to me. But I don't quite understand it.
Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions