Stuck with a SynthEdit project?

Tag: Controls

Skins Part 2

The global.txt file

If you were a new user looking at the default skin for the first time, wondering how to make your own slick professional skin, the first thing you should look at is:
C:\Users\Public\Documents\SynthEdit Projects\skins\default\global.txt
This is where fonts, their sizes, colours, backgrounds, etc. are all defined.
Global.txt is the minimum requirement to have a new skin, here are the contents of the global.txt file as defined for the default skin.

Note: If you are familiar with CSS as used in web page design this will look familiar, it’s basically a cut down version of CSS.

Important Note: Never delete or modify the default skin or its global.txt file. Synthedit looks for these file when loading.
As with every other item in the default skin – that SynthEdit looks for when loading – if there is no definition in the global.txt file, it will refer back to the original default folder. That is why you don’t edit the default, among other reasons (you will get a strange display in structure view unless you really know what you’re doing).

Commenting:
A line prefixed by a semicolon is a comment, anything you put in a comment is not read by SE.
Commenting is useful as you may not remember why you changed a setting in a skin, and what the results of the change are. Comments are a designers best friend. Note: You can also use ‘//’ for commenting.

If you see the 3rd party skins made by experts, they only have a few items in them, you only need to include the objects you want to replace or change.
For example: you could, for example, make a skin called “Alternative Fonts1” and it would just contain global.txt – and your new global.txt need only contain a few references, not all, if you only wanted to change fonts for a few but not all text displays.

Fonts:
Beware of using unusual fonts. You’ll experience a bit of a disappointment seeing one of you projects on someone else’s computer with the wrong font, your fonts have to exist on the host system to display correctly, stick to the window (or MAC) system core fonts and you can’t go wrong.

Small Button and LED:– There is the difference between small button and switch or led. The small button is ‘click’ action -momentary- switch is ‘stepped’ -2step ‘latch’ , and the LED isn’t defined, and therefore is ‘passive’, a slave graphic.

Knob med.png and Knob small.png:- These are ‘type animated‘ with mouse response rotary.
In contrast to the fader used with the standard fader, which is a bitmap with a Mask, why the different method? I could replace the bitmap and mask with a PNG with transparency, as long as I observed positioning and size (making it much easier to make new faders)

Are you really supposed to start using the subcontrols knobs straight off? You don’t of course, you use the stock knob and fader when you’re knocking up an idea – so ideally, it would be nice to re-do those in your new skin, even if you were to use subcontrols.
In fact the quest would ideally be to produce a complete replacement generic skin where you can change the colours easily (for example).
That is quite a bit of work if you want to know what is going on with each different object type. The ‘workmanlike’ approach of just bashing out new graphics, rigorously adhering to default sizes, and maintaining consistency in style, may be the quickest and most effective way to achieve this, ultimately.

Note that there is a full set of parameters for each text category, but that it is not always used in full; so you could add extra parameters like background colour to them.

Colours: For some reason the method of specifying colours is non-standard. Instead of RR GG BB (the usual Red-Green-Blue format) in SynthEdit it’s reversed to BB GG RR!

Default skin global.txt (annotated)

;other skin settings
; EVERYTHING WITH SEMICOLONS IS IGNORED
; Fonts
; www.w3.org/TR/REC-CSS1#font-variant
; font-color – BBGGRR Blue-Green-Red mix, hexadecimal numbers
; background-color SAME (-1 = transparent)
; font-size – Height in pixels
; font-family – Searches available fonts, left to right. Specific font name, or generic…
; ‘serif’ (e.g. Times)
; ‘sans-serif’ (e.g. Helvetica)
; ‘cursive’ (e.g. Zapf-Chancery)
; ‘fantasy’ (e.g. Western)
; ‘monospace’ (e.g. Courier). Doesn’t seem to go smaller than 12 (Mind you too much smaller and it will be difficult to read, need to consider usability)
; Arial, Times New Roman, and Courier New are core fonts to Windows
;
; text-decoration underline (overline, line-through, blink not supported)
; font-style normal |italic (oblique not supported)

; font-weight : normal | bold | light | 100 | 200 | 300 | 400
; | 500 | 600 | 700 | 800 | 900
; following not supported at present: bolder | lighter
; text-align center | left | right
;UP TO THIS POINT, EVERYTHING IS INSTRUCTIONS FOR HOW TO DEFINE FONTS AND DISPLAY THEM
;
;TEXT DISPLAY CATEGORIES FOLLOW:
; >(text on modules title bar, structure view)
FONT_CATEGORY module_title
font-family Arial, “sans-Serif”
font-size 12
font-color #FFFFFF

FONT_CATEGORY panel_group (panel lines title font)
;font-family “System”, “sans-Serif” <THIS IS IGNORED but why 2 options below?
font-family “MS Sans Serif”, “sans-Serif”
font-size 14
font-weight bold
font-color #FFFFFF

FONT_CATEGORY control_label (never sure about this one.. ?default control text?)
;font-family System, “monoSpace”
;font-size 12
font-family “MS Sans Serif”, “sans-Serif”
font-size 14
font-weight bold
font-color #FFFFFF

FONT_CATEGORY control_edit (get confused by this one too..)
;font-family System, Arial, “sans-serif”
;font-size 12
font-family “MS Sans Serif”, “sans-Serif”
font-size 14
font-weight bold
;font-color #000000 – don’t apply to edit boxes

this one is obvious
; this category is for LED Stack item labels and rotary switch labels
FONT_CATEGORY switch_label
font-family Verdana, “monoSpace”
font-size 10
font-color #F5F5F5

FONT_CATEGORY selector_text >this too.
;font-family System, “monoSpace”
;font-size 10
font-family “MS Sans Serif”, “sans-Serif”
font-size 14
font-weight bold
font-color #ff0000

; the writing on container and VST plugin displays
FONT_CATEGORY tty
font-family terminal, monoSpace
font-size 10
font-color #00f000
background-color #000000

; plugs the pins in structure view?
FONT_CATEGORY plug
font-family Arial, “MS Sans Serif”, Verdana
font-size 10
font-color #000000

FONT_CATEGORY “Normal”
font-family “MS Sans Serif”
font-size 12
font-color #000000
background-color #ffffff
text-align center

FONT_CATEGORY “Heading 1”
font-family Arial, Verdana
font-size 28
font-color #fff7f7
text-align center
text-decoration underline
;font-style italic
font-weight 900

FONT_CATEGORY “Heading 2”
text-align center
font-family Arial
font-size 18

FONT_CATEGORY “Heading 3”
text-align center
font-family Arial
font-size 14

FONT_CATEGORY “User 1”
font-family Arial Unicode MS
font-size 14
font-color #464646
background-color #ffffff
text-align left

FONT_CATEGORY “User 2”
font-family Courier

FONT_CATEGORY “User 3”
font-family Fixedsys

More about Skins…
Skins Part 1
Skins Part 3

SynthEdit “Prefabs”

What is a prefab?

A Prefab is a SynthEdit file that can be inserted into a project like any other module. Prefabs are simply a container with other modules inside, already connected up to perform a specific function, they are ideal if you have a complex (or simple) structure you have created that you know you’ll re-use over, and over again… if you save it as a Prefab it’s there ready to use whenever you want it.
SynthEdit comes with some pre-built synthesiser and effect prefabs ready to use.

Hint: If you create a Prefab Sub-Folder in your SynthEdit Projects folder and store your Prefabs in there, separate Sub-Folders according on the function of the prefab, they will show up in your Modules panel. If you have control or waveform related Prefabs, and you use these names for the Folders, they will show up in those folders in the Modules Panel…choose your folder names wisely. Controls, Effects, Filters, Modifiers, Sub-Controls, and Waveform are all good choices… not only this, but if you create your own folder names for the Prefabs, then you’ll be saving them in your own categories (just be sure to choose a folder name not already used by synthedit if you want a unique category)

How to find your Pre-Fab  folder

Prefabs are a great time saver when building complex Synthesizers, or you have a complex structure you are going to use frequently. Or even a complex “module” that you had a hard time getting to work as you wanted (Don’t forget to include a read me file with it, you’ll thank yourself later!)
An example of a Prefab and internal structure is shown below. This is a relatively simple example, but one I use frequently. To open a container just double click anywhere on the container module.

All Prefabs will have at least two IO Modules, one for Input and one for Output. If you want to add more inputs and/or out outputs, just create a connection from the desired plug to the “Spare” in on the relevant IO Module.

Saving your prefab.

To save the Container/Structure as a prefab just right click, go to More… in the menu and select “Selection to Prefab”, then a “Save As” dialogue box will open allowing you to choose a folder (or create a new folder), and save the prefab with your own unique name (do not use a name already in use by an existing module).

Loading a prefab.

If it’s a prefab that you have created, then it can be loaded directly from the modules panel on the left hand side. If it’s a new one you have downloaded, then there are two methods you can use:
1) Drag the prefab to the appropriate folder, and re-scan the modules, this will add the prefab into your modules list.
2) Go to the “Files” menu, click on “Import Prefab” locate your downloaded file and select it. Click on OK and it will be imported into SE, then you can right click and navigate to “Selection to Prefab, then you can save it into the folder of your choice.

V1.4 Prefab and V1.5 prefab compatibility.

Important: V1.4 prefabs are saved with an .SE1 file extension, and are not compatible with the V1.5 .seprefab file extension. You will need V1.4 installed so it can be converted.
You need to open the file as if it were a normal SE project file in V1.5. It will then tell you that it was created in an older version of SE, and ask you if you want to convert the file using SE1.4. Once the file has been converted and then opened in V1.5 you can save it as a V1.5 .seprefab file and use it as a normal prefab.

Notes about Prefabs.

Note: You can have as many IO modules in a prefab as you like.
Note: To create a prefab you must containerize all the modules in the prefab before creating the prefab.
Important Note: You prefab does not contain any modules, it’s merely instructions for SE telling it how to connect the modules inside a container, and any parameters etc. that you specify. This means that if you are creating prefabs for other designers, or collaborating with another designer you must tell them if you have used any third party modules, as these will not be included in the prefab.
Missing modules = non-functional prefabs!

SynthEdit:- How Plugs, Patch Cables and Data are used.

Here I’m listing some of the more commonly used Module plug names, the types of data they carry, and their usage along with useful notes.

BLOB data module

Not used very often in SynthEdit, except in passing large amounts of binary data in or between modules when using or creating samplers, or sample players.
In SynthEdit it has a built in limit of 5Mb.
A “BLOB” is a common acronym for “Binary Large Object”, which means it’s an object holding a large amount of binary data. Some languages has native blob types, but C++ doesn’t. Never the less, creating a blob is simple enough – you just create an array of bytes. In your example, this is done by creating an array of chars. This might be confusing, though, as an array of chars has a special meaning in C++ – it’s also a string.
For more information on BLOBS you really need to read in depth C++/DSP programming tutorials and documentation.

Boolean data module

A Boolean or Bool is a data type with two possible values:
true or false (0 or 1). It’s named after the English mathematician and logician George Boole, whose algebraic and logical systems are used in all modern digital computers.
In SynthEdit any value above 0 is considered as “True”.

Floating point module

A floating point number, is a positive or negative whole number with a decimal point. For example, 5.5, 0.25, and -103.342 are all floating point numbers, while 91, and 0 are not. Floating point numbers get their name from the way the decimal point can “float” to any position necessary within the number.
Note: Floating point math by it’s nature cannot be precise when handling very large numbers so you can’t always trust math modules when they are applied to floating point data.

Integer module

The Integer data type stores whole numbers that range from -2,147,483,647 to 2,147,483,647 for 9 or 10 digits of precision. Note:- The number 2,147,483,648 is a reserved value and cannot be used. The Integer value is stored as a signed binary integer and is typically used to store counts, quantities, and so on.

MIDI Module

MIDI is an acronym that stands for Musical Instrument Digital Interface. It’s a way to connect devices that make and control sound — such as synthesizers, samplers, and computers — so that they can communicate with each other, using MIDI messages.
These messages are not only the note that is played on a keyboard, it can be a wide range of data related to volume, positions of controls, how hard the key is pressed etc.
SynthEdit takes the MIDI input from your chosen device, and converts it into control signals (voltages) that it’s modules can understand to control those module’s actions.
With the new MIDI2 standard this has become more complex.

Text module

The Text data type stores any kind of text data including numbers (but these are always treated as text, not values). It can contain both single-byte and multibyte characters that the locale supports. The term simple large object refers to an instance of a Text or Byte data type.

Audio/voltage module

Used to carry Audio, or Control voltage signals. Voltage is essentially floating point data. It is used to send Audio from one DSP module to another, or to send control voltages from one DSP module to another to control the recipients behaviour. DSP Floating Point and Volts pins will inter-connect, but you really should use a Float to Volts converter. You can then set the rate at which the conversion takes place and ensure that the control operates smoothly, and predictably. Leaving out the Float to Volts module can result in the possibility of the control being somewhat “glitchy” and unpredictable.

Control and Audio voltage plugs.

Voltage (audio):
Audio voltage plugs transmit blocks of samples to be processed at sample rate by other input audio plugs. This means that they are operating at the sample rate set in the preferences.
Voltage (Control):
Plugs used for control signals like Volts (non-audio), float, int, string, bool and BLOB work differently, they are event based meaning that processing of a single value at time happens only when a new value is created, for example a control is moved/operated.
The Audio module code is managed differently: it’s done by using a sub process which processes the sample blocks or by an “event handler” respectively.
Accuracy:
Both kinds of data however are transmitted and processed on a sample rate accurate clock. Nothing technically prevents a module from sending an update to a control plug (e.g. float) 48 000 times a second but that would be very inefficient in terms of CPU because the handler used for the receiving modules will be processed continuously at 48 000 times a second to process occasional single control update values.
Control plugs are not meant to transport audio data:
Jeff programmed a suitable converter module which “down samples” an audio stream to send the sample values to a float pin at a much slower rate of 60Hz or even less. Control pins are only suitable for slowly changing parameters or automations, and must never be used for audio streams.

An Example showing an Audio and control plugs:
The Oscillator:- The Audio Out plug carries a very rapidly changing audio voltage (up to the current audio stream rate), so this would naturally be an Audio voltage.
All of the left hand voltage plugs however are considered as control voltages and are not updated as frequently as the Audio output.
The ADSR2:- All of these plugs, both left and right hand side are considered as Control Voltages, and not updated as frequently. Also even though the Attack/Decay/Release sections may change quite rapidly, even the signal out plug carrying the ADSR envelope voltage is not handled as audio.

Note: Voltage plugs are always DSP Plugs, whereas Float Plugs can be DSP or GUI. You cannot connect GUI plugs to DSP plugs without a suitable converter such as a Patch Memory module.
You should never convert a DSP audio voltage to a GUI signal to process using GUI modules…it will be very inefficient and glitchy! Converting Control signals is fine as long as you use the correct modules for the job.

Patch cables.

These are our links between the plugs on the modules, much like hardware patch leads. The colours of the leads match the types of data they carry. Synthedit will not allow you to connect incompatible data plugs and sockets- you will just get an error message:

Or if you try and connect a DSP plug to a GUI plug even if it’s the same data-type you’ll get this error message:

More about patch cables.
When you click on a cable it’s highlighted in yellow. As you can see below there are also different styles of line; some have nodes added (the white dots) which can be added by clicking on the line once it’s selected. These allow us to “bend” the cables. By right clicking on a selected patch cable we get the menu shown, with the options; Straighten line (remove all bends), Delete Line, Curvey (I know it’s miss spelled-but I’m using the spelling from Synthedit to save confusion), and Straight. Curvey give us a line in the style of the one highlighted, and straight – the one with sharp corners. To move a node just select the cable then click on a node and drag it to the new position.

Spare Plugs.
Where you see a plug like the one below with the title “Spare Output” this is a self replicating plug which means that as soon as you connect it, another appears below it titled “Spare Output“. These plugs when connected take their title from that of the plug they are connected to.

The correct way to convert a GUI Floating Point control value to a DSP Voltage control value.

You should always use a Patch Memory module to convert from GUI to DSP and vice versa. Likewise Floating Point must always be converted to Volts using a Float to Volts module to ensure the controls work smoothly with no data loss.

Converting GUI control floating point to DSP voltage


Some ways in which data plugs are used:

Hint:- (Text) This text displays as a popup yellow tooltip when the mouse hovers over a control on the VST’s panel.
Both of the items below (Menu Item and Choice) form the replacement for the older “Drop Down List” and form a selection menu based on an “Enumerated List
Menu Items:- (Text) Comma separated text list. Provides a right-click popup context menu for the image. Commonly used for adding a MIDI-Learn menu.
Choice or Menu Selection:- (Integer) Selects items from the list based on their numeric position in the text also Commonly used for adding a MIDI-Learn menu.
(NOTE: An enumerated list starts always at 0, not at 1). This also provides a right-click popup context menu for a control or image. Commonly used for adding a MIDI-Learn menu.


Animation Position: (Floating Point) Returns the position of a knob or slider control. The value of this is (normalized) to between 0 and 1, so for controlling DSP modules needs to be scaled up to the usual 0 to 10 Volts range Patch Memory (Float) modules do this scaling automatically.
This Animation Position data is normally Bi-Directional.


Mouse Down: (Boolean) Sends a “True” value when a control or image receives a left click from a mouse.

Properties.
Some settings or controls may not always be available as Plugs, they may only be available in the Module’s Properties panel:
Writeable:- (Boolean) Makes read-only or writeable.
Greyed:- (Boolean) Displays text in a disabled, grey style.
Background Colour: (Text)
Foreground Colour: (Text)
Ignore Program Change: (Boolean)
Mouse Down:- (Boolean) Provides a Boolean “True” signal whenever the mouse is left clicked on the image.
Read Only:- You can only read data from a module when this is set to True, it will not accept any inputs.
Greyed:-

NOTE: Fixed value modules only have outputs, and their values are set in the properties panel so they cannot be altered in any way from the VST’s control panel, however you can allow the VST plug-in’s user to select from a bank of fixed values via a drop down list, or similar selector.