pierreguillot / Camomile

An audio plugin with Pure Data embedded that allows to load and to control patches
GNU General Public License v3.0
892 stars 62 forks source link

Unable to save array content (Win) #240

Closed Omar-Misa closed 3 years ago

Omar-Misa commented 3 years ago

ENVIRONMENT

Hi, i'm unable to have persistent array content across loads of DAW project. i've attempted to save using the methods described in the manual. One method following the instructions for arrays. Another method of using [text define]. i am able to do a work-around, using the latter to write array contents to a text file. Unfortunately, this allows maintenance of only one text file. Therefore, am unable to use array data unique to numerous DAW projects.

i've attempted saving the DAW project and saving the plugin state in the DAW's format (.fst). Exporting to VST preset format (.fxp) isn't available, i suspect because of the VST3 architecture, but can't say for sure.

Attached is the complete folder contents of my Camomile plugin. It is a MIDI filter. Supply a note and the output is a randomly selected note which deviates from the input note.

000B_randNotes.zip

Thanks, in advance, for your time.

pierreguillot commented 3 years ago

Hello,

The arrays of your patch are always filled with zero. I don't see in your patch where the content of the arrays is modified. If I add a [print] object after [receive load], all the zeros appear in the console (same thing if I add a [print] object before [send camomile]). Are you sure the patch works as expected in Pd?

Omar-Misa commented 3 years ago

Hello again,

~~Yea, the 2 arrays start of with zeroes, ready for the user to fill. With this state the input note is output without modification. Here's a typical usage sequence:~~ ~~1. Add randNotes (my Camomile plugin) to DAW project.

  1. Add a synth, such that it receives MIDI from randNotes MIDI output.
  2. Define choices and RANGE (number atoms, parameters 1 & 2).
    • choices sets array size for both arrays.
  3. Click the PROBABILITIES bang and edit array values.
  4. Click the NOTES bang and edit array values.
    • Both arrays will now be filled with user-defined values.
  5. Input some notes in series to randNotes.
    • The input note will be modified.
    • The note number offset will be randomly selected from the NOTES array.
    • The index referenced will be randomly selected according to the probability defined in the PROBABILITIES array.
    • Everything works as expected up to this point.
  6. Save DAW project or randNotes plugin preset.
  7. Reload DAW project or randNotes plugin preset.
    • The arrays are now all zeroed again. The save action(s) in step 6 has no effect.~~

~~i tried adding the -k flag to the 2 [array define]s -- yielding no fix to the issue. i also tried disconnecting choices, so that arrays weren't resized -- also yielding no fix to the issue. i've used $0 to localise the arrays. This may be problematic as the ID is unique with each load, after saving the DAW project or plugin preset.~~

~~What happens when [receive save] ---> [array get] ---> [list prepend save n] ---> [list trim] ---> [send camomile]; where n is array identifier? Is n a Camomile parameter? Or is it a separate mechanism which the DAW handles? Can a Camomile parameter contain a list?~~

Thanks again for your time. i shall try a simple experiment where a Camomile plugin only contains one array and a bang on the GUI. This should allow testing of saving array contents, without any other evaluations. i'll return here and attach that basic plugin and patch.

Omar-Misa commented 3 years ago

OOPS!!!

Not sure what i did wrong previously but my plugin is now fixed. i think my inclusion of program management was the issue. i deleted the equivalent of [program.get] and [program.manager]. Another edit i made was to change the symbolic save array identifier to a numeric value. The plugin now works as expected.

Sorry to have wasted your time :anguished:

pierreguillot commented 3 years ago

No problem ;)