Spread the love

I think these modules are worth a separate page all on their own, as they are quite an “in depth” subject, and can be a source of confusion for beginners.

The rules of using Patch Memory.

Rule 1: The first rule of Patch Memory is; Don’t use “redirectors”.

From the SynthEdit help file:

Avoid splitters (redirectors)
Due to a design mistake, SynthEdit 1.0 had the Container’s ‘Control on Parent’ pin on the wrong side. This made it impossible to connect it to a Patch Mem module (needed for save/recall of paged panel settings).
The ‘Bool Splitter’ was introduced to fix this problem, but the bool splitter causes problems of it’s own. The bool splitter ‘reflects‘ any one input signal back out it’s other inputs, this is a bad design because it is not clear which module is in control of the others. The result is modules ‘fighting‘ each other for control. Symptoms include ‘flakey‘ inconsistent behavior and patches not saved/recalled correctly.
3rd party module developers have sometimes copied SynthEdit’s example and released modules that rely on the use of splitters. This is not their fault, however if at all possible avoid using splitters.

Rule 2: The second rule of Patch Memory is: The first wire connected to the ‘Value Out’ plug always resets the Parameter. The Value, Name and Range of the parameter are taken from whatever module you are connecting to. To avoid this behaviour when replacing a wire – connect the new wire first before disconnecting the old one.

Rule 3: Do not connect a Patch Memory to the Polyphony Control module. The Polyphony control is itself a type of Patch Memory, so if you do it will cause data conflicts and the two modules will “fight” over which is doing what.

Rule 4: Never use more than one Patch Memory for each control in a Sub-Control since this can cause some very unpredictable data conflicts and extremely strange behaviors in your GUI controls.

The Patch Memory modules are the hub around which you will construct any
Sub-Control prefab. They are the link from your controls (GUI) to the audio side (DSP) of SynthEdit.
1) GUI to DSP Link: They are the interface (bridge) between the DSP (Audio Processing) side, and the GUI controls and graphics.
2) Storing values for Presets: They allow the storing of values as a preset to “remember” the state or position of a control
3) Use the correct type: There is one Patch Memory for each datatype, divided into input and output controls.
4) When using Patch Memory modules for passing large block of Data between modules (BLOB data is a good example) for samplers (for example) there is a limit to the maximum side of the block of data. They must never exceed 5Mb in size. V1.4 and it’s plug-ins will crash as as soon as the data maximum is exceeded, however the latest version of SynthEdit 1.5 will now not pass the data through the Patch Memory at all, but will not crash. So we still have the 5Mb Data limit but SE and it’s VST plug ins handle the limit in a more stable manner. This limit applies to all the Patch Memory modules.

Note: In the Headings below I just refer to each of the two basic types of module as PatchMemory “Data-Type” 3 or PatchMemory “Data-type” Out3 where Data-Type is for example Integer, or Text to save loads of repetition.

GUI in – DSP out.

PatchMemory Float3 module

These are the modules that take a GUI data input, and convert them to a DSP output, for example the module shown above will take the Position of an Image used as a control, convert it so data suitable for DSP output on the Value Out Plug.

DSP in – GUI out.

PatchMemory Float Out3 module

These are the modules that take a DSP data input, and convert them to a GUI output, for example the module shown above will take the value on the Value In plug, convert it so data suitable for GUI output on the Value, and Animation Position plugs.
Value In:
The Value In plug is always a DSP data plug receiving data from DSP to be sent to the GUI side.
Value out:
The Value Out plug is always a DSP data plug sending data from the GUI modules to the DSP side.

Send or Receive? Which way does the data flow?

This is somewhat confusing and counter intuitive for newcomers to SE but these are the rules for Patch Memory module names:
A Patch Memory Out module always Inputs data from a DSP module.
A Patch Memory Module always Outputs data to a DSP Module.

Note: GUI plugs are bi-directional, they send and receive.
Note: The first wire connected to the ‘Value Out’ plug resets the Parameters. The Value, Name and Range of the parameter are taken from whatever module you are connecting to. To avoid and complications caused by this behaviour when replacing a connection:- always connect the new wire first before disconnecting the old one

Typical use of a  PatchMemory Float3

One of the basic and easy to understand of PatchMemory uses is it’s use in the Knob prefab included in the SynthEdit control modules.
1) The Animation Position plug on the Patch Memory is linked to both of the Image2 modules (the body of the knob, and the shiny cap) as we want these to move together.
Note: Although the Tinted Bitmap Image has an Animation Position plug It’s not used here, as we don’t want the scale for the knob to move.
2) The Patch Memory Float3 module serves three main purposes:
a) To link all the modules together
b) It memorizes the position of the knob
c) It allows us to convert the position of the image of a knob into a Floating Point value, which is output as a DSP value (hence the grey background). This allows us to use the position of image to output a Voltage which can be used to control (for example) the cut-off frequency of a filter module.
3) The Animation Position plugs are always scaled from 0 to 1 as a default, whereas both the Value, and Value Out plugs have the value scaled up to the default 0 to 10 range required for controlling DSP modules.
4) The Text Entry4 module allows us to display a title adjacent to the control knob.
Float to Volts conversion.
The Float to Volts module is included to convert the Floating point output of the Patch Memory to a suitable Data stream for DSP modules. this allows us to set the response speed of the control, so that there is a smooth output signal sent to the DSP controls.
Menu Items, and Menu Selection plugs.
These can be used to set up a Right Click menu for the control knob.

Our two important plugs here are Choice and Item List: Choice is the Integer which refers to the Item from the Item List that is being chosen.
Defining the list:
The list is set up as a text string in the Properties for the module. Each entry is given an ID number starting at 0
Note: the first item is always 0. So if you are choosing pre-defined options from another module, so a typical list could be: Sine=0,Saw=1,Triangle=3,Pulse=4
This is referred to as an “Enumerated List”
There must be no spaces in the list, unless the Item name specifically has a space in it such as “White Noise”.
Note: The last entry is not followed by a comma or period.
Example:
A pop-up menu system is shown below.
If we don’t define a list then the list entries will be read directly from the Oscillator module (OK we expect the Value Out plugs to be uni-directional, but in the case of this module it can extract the item list from the Module that this plug is connected to-trust me it does!)
Limiting our choices:
If we want to limit the choices available in the list then we need to pre-define our list. This is done in the properties for the Popup Menu module.
Note: You must define the list options before connecting the Popup Menu to any other modules, otherwise the Choice and Item List entry boxes will be “greyed out”, and the list will be defined by the Patch Memory List3 and the module it’s reading the list items from.
In this case we use the list: Sine=0,Saw=1,Triangle=3,Pulse=4 which limits the choices available by leaving out Ramp=2,White Noise=5,Pink Noise=6.
The choice option requires no programming, it just selects the ID number from the list supplied.
This system will work with any DSP module that uses the green List Entry plug. Just remember that the first item in the enumerated list will be 0, and not 1.

This is how the properties panel for the Popup Menu module should read: (Unless you want different options of course)

Programmers notes about Patch Mem:

The range attributes are specified in the xml for the parameter, they are called minVal maxVal, the default range being 0 to 10.

A patch memory is pretty much a ‘stub’ box module containing a SE entity called Parameter. The module simply communicates to the parameter value using its pins. A parameter is in effect a memory whose value is stored in presets and which changes for every preset, and can of course be of int, float, bool, blob or string type.

By using xml, a parameter can be linked to either GUI or DSP plugs. The linked pin(s) won’t be exposed, but are used for sending or receiving data to/from the parameter. Therefore, a parameter also allows communication between GUI and DSP.

You must keep in mind that when the GUI is closed, the GUI part of a module (including a PM) effectively does not exist. However, a parameter can still transmit its value to any DSP input plug it is linked to, or receive the value from a DSP output plug it is linked to. Once the GUI is opened (but not until then), it will transmit its value to a GUI plug it is linked to.