puredata

Is it possible to use graph-on-parent with [clone]d abstractions in some way?


I know you can open an abstraction with the vis message, but I haven't found a way to present my abstractions in the patch containing the clone object. Perhaps dynamic patching is the only way to achieve this? I have searched the pd forum, mailing list and Facebook group without success.


Solution

  • Currently (as pd 0.48-1) there is no way of making the [clone] read the GOP of it's contents.

    As a workaround you can encapsulate the [clone] object into an abstraction that provides a GUI that displays information about the selected clonede instance.

    For example, let's say you have a Object called [HarmonicSeries] that, given an fundamental, it uses a [clone] object to create 8 instances of [Harmonic], each one containing a osc~ of the desired frequency. And you want to display the frequency of each Harmonic. Instead of using GOP on [Harmonic] you would use GOP on [HarmonicSeries] and provide an Interface to selected the desired harmonic to collect information.

    The [harmonic] abstraction: it expects two parameters:

    1. The fundamental frequency
    2. The index of the harmonic

    Then it multiplies both to get the harmonic's frequency and store it on an [float]. When it receives a bang it then outputs that frequency to it's left outlet.

    [[Harmonic] abstraction[1]

    Let's [clone] it and wrap it into the [HarmonicSeries] abstraction.

    [HarmonicSeries] object

    When the user clicks on the [hradio] to select the desired harmonic it sends a bang message to the correct harmonic, which in turn sends the stored frequency to it's outlet. It then displays the harmonic's index and the harmonic's frequency in number boxes.

    Here's an example of it working (in the [HarmonicSeries-help] object)

    [HarmonicSeries-help] object

    This is a simple example but the principle is the same with complex cases. You encapsulate the [clone] into an abstraction that provides an interface for reading data from the cloned instances.