roymacdonald / ofxParameterMidiSync

openFrameworks addon for easily syncronizing ofParameters with MIDI messages.
Other
5 stars 1 forks source link

fix? #4

Open ofZach opened 2 years ago

ofZach commented 2 years ago

I don't know if this is an issue or not, but in getting re-coded working on the latest OF, I found I needed to add the following to ofxParameterMidiSync::setSyncGroup

    if (true) {
        synced.clear();
        for (int i = 0; i < parameters.size(); i++) {
            auto s = std::make_shared<ofParameterMidiInfo>(&parameters.get(i));
            synced[i] = s;
        }
    }

otherwise I didn't see any messages come through to the app via void ofxParameterMidiSync::newMidiMessage (synced.count() always returned zero)

roymacdonald commented 2 years ago

Hi Zach. I have not used this addon for quite a while. I might even suspect that the re-coded repo had its own version of it. BTW, where is the re-coded repo?

Does it work properly for you with this fix?

roymacdonald commented 2 years ago

@ofZach I was reading the code and it seems like you need to load an xml file which contains which midi message info must be linked to a certain parameter. Are you calling the load() method of ofxParameterMidiSync?

ofZach commented 2 years ago

thanks!

recoded is here https://github.com/SFPC/recoded

to be honest, I haven't really followed much, I just wanted to try to get the basic shell of things compiling and working in the latest OF and I was but I noticed this add-on had been updated and when I changed some of the function calls to match it and get things comopiling it works but I didn't see messages pass through -- it seemed like "synced" is empty so this is what I needed to do to fix it...

it's working ok now, so I think this is a fix that helps -- I can't really follow elsewhere how synced gets set to anything....

roymacdonald commented 2 years ago

I found I have the working version used for the SFPC 2020 anniversary exhibition and it has a lot of changes. I dont know why I didn't push it to github. I am testing if it builds and will push it.

roymacdonald commented 2 years ago

@ofZach https://github.com/roymacdonald/Recoded

That is the code I used for SFPC's 2020 show. I spent a few hours trying to make another project to work without success, until I realized I had this other repo. I have not tested it, I am sleepy now in order to do so. all the addons it uses are in its local_addons folder. Let me know if this works for you, otherwise I can take a look and fix if necesary