bltzr / ofxOscQuery

ofx Addon for OSCQuery support
Other
14 stars 3 forks source link

questions, midi feature... & can't compile into debug mode (release only), on VS2017 #6

Open moebiussurfing opened 4 years ago

moebiussurfing commented 4 years ago

hey @bltzr, thanks for all this work!

I am just reporting this just in case it is the "expected behavior" or not... I cloned the current repo and added the /libs folder from the last release tag version. release build for x86 and x64 are working fine, not for debug.

(The recommended tagged release version as mentioned in README didn't work here. I get an error related to ossia-cpp98.hpp)

BTW I am new to oscQuery and it looks interesting. I have two questions:

  1. it's possible to control the oscQuary server with normal OSC basic controls? (i.e. like from touch OSC)

  2. are you planning or there's any lib/way of some OSC mirroring to MIDI too? For the moment I think it is only possible using TouchOsc Bridge... It could be useful because we can add all the OF App params to the addon class and all the controls are auto-created... both MIDI/OSC in one strike.

bltzr commented 4 years ago

Hey @moebiussurfing ! Thanks for the report!

Normally, you would have to download the release and use it as any other normal ofAddon. What was the exact error message ? And you're on Windows, right ? (I have never really tried on Windows, TBH - maybe @jcelerier has some clues here...)

Concerning your 2 questions, I'm not completely sure I get your questions, could you please elaborate a little and provide some concrete examples and use cases ?

  1. you can send "normal" OSC messages, this will work

  2. I'm not planning MIDI stuff, but there is some MIDI support in the underlying ossia so maybe we could do something here ? Could you do some kind of specifications of how you would think this should work ?

bltzr commented 4 years ago

BTW is the issue name still relevant ?

(concerning the problem with Debug, I guess that the lib version was not compiled in Debug mode but, again, @jcelerier is the knowledgeable one on this)

jcelerier commented 4 years ago

I'm not planning MIDI stuff, but there is some MIDI support in the underlying ossia so maybe we could do something here ? Could you do some kind of specifications of how you would think this should work ?

yes, technically would be possible to add a bridge, just need to find a good API for it I guess ? e.g. at some point you'll have to write "this parameter maps to MIDI CC 34 on channel 7", how do we make that the easiest given the current API.

jcelerier commented 4 years ago

I'd tend to think that this is more a job for libmapper but if it's more convenient to write everything in one place...

bltzr commented 4 years ago

e.g. at some point you'll have to write "this parameter maps to MIDI CC 34 on channel 7", how do we make that the easiest given the current API.

the best way would be when declaring this with parameters, but since this is based on ofParameter's syntax, I'm not sure we can extend this... so then maybe using some external tool like libmapper would be an easier way (did you document the ossia/libmapper bridging somewhere BTW ?)

moebiussurfing commented 4 years ago

thanks for your replies!

In OF I have seen 2 addons to subscribe ofParameters to midi messages. So you don't need to declare any callback manually: when a param changes, it send the assigned midi messages (midi note to bool, float/int to cc). (these addons only get midi input, not output I think btw) : https://github.com/NickHardeman/ofxMidiParams https://github.com/roymacdonald/ofxParameterMidiSync

The API is really handy, something like this: ofxMidiParams

    ofParameterGroup padParams;
    padParams.setName( "Pad Params" );
    padParams.add( pad1.set("Pad1", false ));
    padParams.add( pad2.set("Pad2", false ));
    padParams.add( pad3.set("Pad3", false ));
    padParams.add( pad4.set("Pad4", false ));

    kParams.add( k1.set("K1", 0.5, 0.0, 1.0 ));
    kParams.add( k2.set("K2", 0.5, 0.0, 1.0 ));
    kParams.add( k3.set("K3", 0.5, 0.0, 1.0 ));
    kParams.add( k4.set("K4", 0.5, 0.0, 1.0 ));

    mMidiParams.connect(0, true);
    mMidiParams.add(padParams);
    mMidiParams.add(kParams);

ofxParameterMidiSync

bool ofxParameterMidiSync::linkMidiToOfParameter(ofxMidiMessage& msg, ofAbstractParameter* param){
    if (param ==  nullptr) return false;

    if (synced.count(msg.control) == 0) {
        auto s = std::make_shared<ofParameterMidiInfo>(param, msg);
        synced[msg.control] = s;
        if (s->isMultiDim()) {
            for (int i = 1; i < s->dims ; i++) {
                synced[msg.control+i]  = std::make_shared<ofParameterMidiInfo>(param, msg,i);
            }
        }
        return true;
    }
    return false;
}

Both addons have a system to assign midi learn and XML store/recall the midi messages->parameter settings.

Maybe is not the intention on your addon, I was just thinking that could be a good feature, bc then you can add your ofParameterGroup, being able to send/receive control the parameters from mirrored OSC/MIDI.

I've seen a bridge but for macOS only: https://docs.vidvox.net/freebies_midi_oscquery_helper.html

Regards