# GenericDrum

GenericDrum is a generic drum synthesizer using delays. This one can make convincing snare and bass drum sounds. Cymbal sounds can be made, but it’s not as good as lower pitched drum sounds.

- Download GenericDrum 0.1.5 `full` - VST 3 (github.com)
- Download GenericDrum 0.1.5 `macOS` - VST 3 (github.com)
- Download Presets (github.com)

Important: Presets may not produce the expected sound if sample rate is not 48000 Hz.

`full` package contains following builds.

- Windows (x86_64)
- Linux (x86_64)
- macOS (Universal 2)

Linux build is built on Ubuntu 24.04. If you are using distribution other than Ubuntu 24.04, plugin will not likely to run. In this case, please take a look at build instruction.

`macOS` package is recommended for macOS user. I can’t purchase Apple Developer Program, therefore installation requires a workaround to bypass Gatekeeper. Details of workaround are written in Installation -> macOS Specific section.

## Contact

Feel free to contact me on GitHub repository or `ryukau@gmail.com.`

You can fund the development through paypal.me/ryukau.

## Installation

### Plugin

Move `*.vst3` directory to:

- `/Program Files/Common Files/VST3/` for Windows.
- `$HOME/.vst3/` for Linux.
- `/Users/$USERNAME/Library/Audio/Plug-ins/VST3/` for macOS.

DAW may provides additional VST3 directory. For more information, please refer to the manual of the DAW.

### Presets

Notice: Some plugins don’t have presets provided by Uhhyou Plugins.

Presets are included in the plugin package linked at the top of this page. To install presets, follow the steps below.

1. Download plugin from a link at the top of this page.
2. Extract downloaded zip file.
3. Open `presets` directory placed in extracted package.
4. Move `Uhhyou` directory into an OS specific preset directory (see below).

Below is a list of preset directories for each OS.

- Windows : `/Users/$USERNAME/Documents/VST3 Presets`
- Linux : `$HOME/.vst3/presets`
- macOS : `/Users/$USERNAME/Library/Audio/Presets`

Preset directory name must be the same as the plugin. If preset directory does not exist, create it.

- Preset Locations - VST 3 Developer Portal

### Windows Specific

If DAW doesn’t recognize the plugin, try installing C++ redistributable (`vc_redist.x64.exe`). Installer can be found in the link below.

- Latest supported Visual C++ Redistributable downloads | Microsoft Learn

### Linux Specific

On Ubuntu 24.04, those packages are required.

    sudo apt install libxcb-cursor0  libxkbcommon-x11-0

If DAW doesn’t recognize the plugin, take a look at `Package Requirements` section of the link below and make sure all the VST3 related package is installed.

- VSTGUI: Setup

REAPER on Linux may not recognize the plugin. A workaround is to delete a file `~/.config/REAPER/reaper-vstplugins64.ini` and restart REAPER.

### macOS Specific

Important: `full` package is not confirmed working. When using `full`, try removing following files.

- `Contents/Resources/Documentation`
- `Contents/x86_64-linux`
- `Contents/x86_64-win`

`macOS` package doesn’t contain above files. Also, all packages are in “ad-hoc signing” state set by `codesign` command.

#### Remove Quarantine

When trying to run plugin first time, following message may appear on macOS.

    <PluginName>.vst3 is damaged and can't be opened. You should move it to the Trash.

In this case, open terminal and try running one or both of following command to unzipped `.vst3` directory. Replace `/path/to/PluginName.vst3` according to your install location.

    xattr -rd com.apple.quarantine /path/to/PluginName.vst3
    xattr -rc /path/to/PluginName.vst3

#### Bypass Gatekeeper

Plugin may be considered as unsigned/un-notarized application. In this case, open System Preferences, go to Security & Privacy → General, then click the Open Anyway button. The offcial Apple help page linked below has screenshots for the procedure. See “If you want to open an app that hasn’t been notarized or is from an unidentified developer” section.

- Safely open apps on your Mac - Apple Support

If the plugin is still not working, try changing install location to `/Library/Audio/Plug-ins/VST3/` or `/Users/$USERNAME/Library/Audio/Plug-ins/VST3/` whichever still haven’t tried.

If all the above methods do not work, try following the steps below.

1. Open terminal and run `sudo spctl --master-disable`.
2. Go to System Preferences → Security and Privacy → General → Allow apps downloaded from, then select “Anywhere”.

Beware that steps above degrades security of your system. To revert the settings, follow the steps below.

1. Go to System Preferences → Security and Privacy → General → Allow apps downloaded from, then select option to “App Store and identified developers”.
2. Open terminal and run `sudo spctl --master-enable`.

#### Applying `codesign`

Note This section may not relevant to `macOS` packages. However it’s not verified. (GitHub issue)

To use `full` package, following command might be used.

    sudo codesign --force --deep -s - /path/to/PluginName.vst3

`codesign` might not be available without installing Xcode.

#### Reference

- Safely open apps on your Mac - Apple Support
- java - “libprism_sw.dylib” cannot be opened because the developer cannot be verified. on mac JAVAFX - Stack Overflow
- How to Fix App “is damaged and can’t be opened. You should move it to the Trash” Error on Mac
- Allowing unsigned/un-notarized applications/plugins in Mac OS | Venn Audio

## GUI Style Configuration

At first time, create color config file to:

- `/Users/USERNAME/AppData/Roaming/UhhyouPlugins/style/style.json` on Windows.
- `$XDG_CONFIG_HOME/UhhyouPlugins/style/style.json` on Linux.
  - If `$XDG_CONFIG_HOME` is empty, make `$HOME/.config/UhhyouPlugins/style/style.json`.
- `/Users/$USERNAME/Library/Preferences/UhhyouPlugins/style/style.json` on macOS.

`style.json` will be loaded for each time a plugin window opens.

Several color themes are available on the link below. To use, copy the text to `style.json`.

- VSTPlugins/package/style/themes at master · ryukau/VSTPlugins

Below is an example of `style.json`.

    {
      "guiScale"          : 1          ,
      "fontFamily"        : "Tinos"    ,
      "fontBold"          : true       ,
      "fontItalic"        : true       ,
      "foreground"        : "#000000"  ,
      "foregroundButtonOn": "#000000"  ,
      "foregroundInactive": "#8a8a8a"  ,
      "background"        : "#ffffff"  ,
      "boxBackground"     : "#ffffff"  ,
      "border"            : "#000000"  ,
      "borderCheckbox"    : "#000000"  ,
      "borderLabel"       : "#000000"  ,
      "unfocused"         : "#dddddd"  ,
      "highlightMain"     : "#0ba4f1"  ,
      "highlightAccent"   : "#13c136"  ,
      "highlightButton"   : "#fcc04f"  ,
      "highlightWarning"  : "#fc8080"  ,
      "overlay"           : "#00000088",
      "overlayHighlight"  : "#00ff0033"
    }

### GUI Scale

- `guiScale`: GUI scaling. For example, `0.75` is 75%, and `2.0` is 200%.

The minimum of `guiScale` is `0.01`. The maximum is practically non-existent (the max value of 64-bit float).

Notice: If `guiScale` is too large, DAW may place the “close” button on the plugin window out of screen, making it unclickable.

### Font Options

Following is a list of font options.

- `fontFamily`: Font family name.
- `fontBold`: Enable bold style when `true`, disable when `false`.
- `fontItalic`: Enable italic style when `true`, disable when `false`.

System font can be used as `fontFamily`. To use different fonts for different plugins, place `*.ttf` file into custom font path: `*.vst3/Contents/Resources/Fonts`.

Notice: If the combination of `fontFamily`, `fontBold`, `fontItalic` does not exist in custom font path, default font of VSTGUI is used.

If `fontFamily` is set to empty string `""`, then `"Tinos"` is used as fallback. If the length is greater than 1 and the font family name doesn’t exist, default font of VSTGUI is used.

Styles other than bold, italic or bold-italic are not supported by VSTGUI. For example, “Thin”, “Light”, “Medium”, and “Black” weights cannot be used.

### Color Options

Hex color codes are used.

- 6 digit color is RGB.
- 8 digit color is RGBA.

First letter `#` is conventional. Plugins ignore the first letter of color code, thus `?102938`, `\n11335577` are valid.

Do not use characters outside of `0-9a-f` for color value.

Following is a list of color options. If an option is missing, default color will be used.

- `foreground`: Text color.
- `foregroundButtonOn`: Text color of active toggle button. Recommend to use the same value of `foreground` or `boxBackground`.
- `foregroundInactive`: Text color of inactive components. Currently, only used for TabView.
- `background`: Background color.
- `boxBackground`: Background color of inside of box shaped components (Barbox, Button, Checkbox, OptionMenu, TextKnob, VSlider).
- `border`: Border color of box shaped components.
- `borderCheckbox`: Border color of CheckBox.
- `borderLabel`: Line color of parameter section label.
- `unfocused`: Color to fill unfocused components. Currently, only used for knobs.
- `highlightMain`: Color to indicate focus is on a component. Highlight colors are also used for value of slider components (BarBox and VSlider).
- `highlightAccent`: Same as `highlightMain`. Used for cosmetics.
- `highlightButton`: Color to indicate focus is on a button.
- `highlightWarning`: Same as `highlightMain`, but only used for parameters which requires extra caution.
- `overlay`: Overlay color. Used to overlay texts and indicators.
- `overlayHighlight`: Overlay color to highlight current focus.

## Controls

`Right Click` on the controls pops up a context menu provided by DAW.

Knob and slider provides following controls:

- `Ctrl` + `Left Click`: Reset value.
- `Shift` + `Left Drag`: Fine adjustment.
- `Middle Click` : Rotate through minimum, default and maximum value.
- `Shift` + `Middle Click` : Take floor of current value.
  - Note: For decibel (`dB`) parameters, floor is applied after the value is converted to amplitude.

## Caution

Recommend to use with external limiter. Gain changes greatly depending on parameter values and note velocity.

Oscillation or blow up may occur depending on the parameter settings. Oscillation is a state in which the amplitude remains constant and the sound does not stop. Blow up (or divergence) is a state in which the sound continues to grow louder over time.

Blow up can result in amplitudes of up to +40 dB. GenericDrum automatically lowers the feedback when it detects blow up. This mechanism is activated when primary or secondary membrane output exceeds +40 dB.

Enabling `Prevent Blow Up` can mostly prevent the blow up caused by collisions between wire and primary. However, the texture of the sound may also change significantly.

Even with `Prevent Blow Up` enabled, combinations of short delay time, high bandpass Q, and high feedback may cause blow up. Below is a list of relevant parameters.

- `Note -> Pitch`
- `Cross Feedback Gain`
- `Cross Feedback Ratio`
- `Delay`
- `BP Q`

## Mechanism Overview

GenericDrum is not a physical model. Because the corresponding physical phenomena are not described. So what is this? It’s a work of art that uses delays to imitate the sound of drums, like using a violin to imitate bird songs. Art here means that a human set the parameters from experimentations, mostly relying on their senses.

GenericDrum is good at making the sound of drums that have 1 or 2 membranes on a cylinder, such as bass drums and snare drums, but It’s not good at the sound of thin metal plates like cymbals. It also does not support expressions like rubbing the drum membrane, or expressions that stop the sound with an impact, such as closing a hi-hat.

To imitate the sound of a drum, it’s better to start from a structure similar to a real drum. GenericDrum can be roughly divided into the following parts.

- Impact
- Wire
- Primary Membrane
- Secondary Membrane

Drums produce sound by hitting a membrane with a hand or a stick. Impact section generates a noise that resembles the impact of a hit. The sound is white noise followed by a lowpass. `Echo` can imitate the clanking sound made by collisions between a drum and something like a stand.

Wire is a part intended for snare drums, and it collides only to primary. It consists of delays connected in series. `Collision Distance` controls the distance between wire and primary. `Rattle-Squeak Mix` changes the texture of the collision. It can produce a sound similar to a cuíca, especially when the value is set closer to the squeak side (1.0), but there is no mechanism to control the rubbing.

An impact hits both the primary and secondary membranes at the same time. This behavior is unrealistic, but makes a nice sound. One membrane consists of a feedback delay network (FDN). A bandpass filter is placed for each feedback path on the FDN. The texture of membranes can be changed by the combination of bandpass cutoff, bandpass Q, and delay times. In particular, lowering the Q produces a brighter sound.

A nonlinearity of thin plate vibrations is imitated by modulating delay time in FDN with their feedback signal. When a plate vibrates, it stretches or shrinks which add a bit more tension to the plate. For sound, more tension means higher pitch. So my idea was to reduce the delay time of FDN depending on the amplitude of feedback signal.

For collisions, perfectly elastic collisions of 2 equal masses is used. The sound decays within FDN, because of `Cross Feedback Gain` and bandpass filters. So, there is no need to consider energy loss of collisions. In addition, the amplitude after the collision is stored and gradually returned to the system, in order to resemble a sound of a snare drum. A delay can approximate a wave propagation, but it can’t represent the state during propagation. In consequence, collisions that occur during propagation also can’t be represented. The fact that collisions do not occur during wave propagation becomes more noticeable when the value of `Delay` is lowered.

## Block Diagram

If the image is small, use `Ctrl` + `Mouse Wheel` or “View Image” on right click menu to scale.

Diagram only shows overview. It’s not exact implementation.

## Parameters

Characters inside of square brackets [] represents unit. Following is a list of units used in GenericDrum.

- [dB] : Decibel.
- [s] : Second.
- [Hz] : Frequency in Hertz.
- [sample] : Time in samples. 1 sample is `1 / (sampling rate)` seconds.
- [oct] : Octave.
- [st.] : Ssemitone. 1 semitone is `1 / 12` octave.
- [cent] : Cent. 1 cent is `1 / 100` semitone.

### Mix & Options

Output [dB]

  Output gain.

Highpass [Hz]

  A highpass filter that can be passed just before the output. The number slider controls cutoff frequency of highpass.

  Warning: Enabling or disabling `Highpass` may cause a pop noise.

2x Sampling [Hz]

  Performs 2-fold oversampling when enabled.

  Warning: Enabling or disabling `2x Sampling` may cause a pop noise.

Normalize Gain

  When enabled, the gain is automatically adjusted according to the following values.

  - Note pitch.
  - `Noise Lowpass` in Impact section.
Reset Seed at Note-on

  When enabled, resets the random number seed on every note-on. This seed is used for noises of impact and collision.

  When disabled, the sound becomes inconsistent. It might be useful for a kind of “humanization” effect.

Prevent Blow Up

  When enabled, it tries to prevent blow up by lowering internal gains around wire.

  When wire blows up, it makes a loud explosion-like sound. `Prevent Blow Up` suppresses this explosion, but as a side effect it tends to result in a less powerful sound without rattling texture. To bring back rattling, try changing parameters on the list below. They are in Wire sections.

  - Raise `Decay`.
  - Lower `Collision Distance`.
  - Lower `Rattle-Squeak Mix`.

  Note that if `Prevent Blow Up` is disabled after making the above changes, the system will be likely in an unstable state that is easy to blow up.

### Stereo Unison

Enabling `Stereo Unison` will double the number of drums. This means that 2 different instances will be placed in each channels. Also the CPU load will be doubled.

Stereo Balance

  Adjust the gain of the left and right channels.

  Unlike panning, the left and right channels won’t be mixed.

Stereo Merge

  Adjust the stereo spread.

### External Input

There are two cases when using external input.

- Using audio from a microphone.
- Using audio from other synthesizers.

When using audio from a microphone, enable `Automatic Trigger` and adjust the `Trigger Threshold`.

When using audio from other synthesizers (source), it’s recommended to share the note events to GenericDrum, so that envelopes in GenericDrum starts precisely at the timing of note-ons. When sharing note events, `Automatic Trigger` is better to be disabled.

Please refer to your DAW’s manual for external audio input and note event routing.

External Gain [dB]

  Gain of external input.

Trigger Threshold [dB]

  Threshold amplitude of automatic trigger.

Automatic Trigger

  Engages automatic triggering when enabled.

### Tuning

The Tuning section contains note event and pitch bend related parameters.

Note -> Pitch

  Amount of pitch modulation applied from the pitch of a note-on event.

  Regardless of the value of `Note -> Pitch`, the amount of pitch modulation will be 0 when the pitch is A3 (57 in MIDI note number).

  When the value of `Note -> Pitch` is 0.0, the pitch of the note is ignored.

  When the value of `Note -> Pitch` is 1.0, the pitch of a note is directly applied to the pitch of the synthesizer. Some drum sounds do not have a clear pitch, so it may sound out of tune in some cases. Also, higher the pitch, more out of tune it becomes. This is because delays doesn’t use interpolations to be more efficient, and to avoid lowpass in feedback path.

  When the value of `Note -> Pitch` is -1.0, the pitch is reversed.

Semitone

  Transposes the pitch of the note in semitone steps.

  Note: No effect when `Note -> Pitch` is 0.0.

Cent

  Transposes the pitch of notes in cents.

  Note: No effect when `Note -> Pitch` is 0.0.

Pitch Bend Range [st.]

  Pitch bend range in semitones.

Slide Time [s]

  Pitch slide time.

  The pitch starts sliding when 2 or more notes are played at the same time.

### Impact

Impact section contains parameters that imitates the collision between the a stick and a membrane.

Seed

  A random number seed.

  Changing the seed allows you to change the sound while maintaining the similar texture.

  GenericDrum has two random number generators for generating collision noise and for setting internal parameters. For noise generation, you can reset the seed on each note-on using `Reset Seed at Note-on`.

Noise Decay [s]

  Decay time of impact noise.

Noise Lowpass [Hz]

  Cutoff frequency of a low-pass filter applied to impact noise.

  When `Normalize Gain` is enabled, the gain is reduced when `Noise Lowpass` becomes higher.

Echo [Hz]

  Frequency that represents the total length of echoes applied to the noise.

  Echo has 4 delays with feedback, so the value specified in `Echo` doesn’t represent the exact frequency.

  Echo is provided to represent the clanking sound caused by the collision between drum and drum stand.

### Wire

Wire section contains parameters that imitates a snare wire.

Impact-Wire Mix

  Mixing ratio between impact noise and wire output.

  0.0 only mixes impact noise, and 1.0 only mixes wire output.

Membrane-Wire Mix

  Mixing ratio between primary membrane and wire output.

  0.0 only mixes primary membrane output, and 1.0 only mixes wire output.

Frequency [Hz]

  Frequency of the entire wire.

  Wire has four sections, so the value specified in `Frequency` doesn’t represetn the exact frequency.

Decay [s]

  Decay time of the wire output.

  Warning: When `Prevent Blow Up` is disabled, increasing the value of `Decay` will make it easier to blow up.

Collision Distance

  Threshold value used to determine collision between wire and primary membrane.

  Warning: When the value of `Collision Distance` is small, there may be a temporary blow up until sufficient gain reduction by `Decay` is applied. Increasing this value reduces the chance of blow up.

Rattle-Squeak Mix

  Texture of collision.

  0.0 gives a full rattling texture, 1.0 gives a full squeak texture. Rattle here means a sound like a snare wire, and squeak means a sound like friction on rubbing.

  Warning: When `Prevent Blow Up` is disabled, and the value of `Rattle-Squeak Mix` is close to 0.0, the system becomes more unstable which means easier to blow up.

### Membrane Tone

Membrane Tone section contains parameters related to the feedbacks of FDNs. An FDN produces a sound of a membrane. The values in the Membrane Tone section are shared by both the primary and secondary membranes.

Cross Feedback Gain

  Gain that adjusts how fast the vibration decays.

  Warning: When `Cross Feedback Gain` approaches 1.0, oscillation or blow up is likely to happen.

Consistency

  Amount of randomization to `Cross Feedback Ratio`.

  0 is totally random, 1 is totally consistent. Randomization is done for each note-on.

Cross Feedback Ratio

  Adjusts the tone of membranes.

  The value of `Cross Feedback Ratio` is converted to a feedback matrix used in both FDNs. Householder transformation is used.

  When all `Cross Feedback Ratio` values are 0.0, the feedbacks won’t be crossed into other delays. In this case, the pitch of the sound becomes easier to hear, but the texture of the sound becomes more like a 1D string vibration, rather than 2D plate vibration.

  When all `Cross Feedback Ratio` values are 1.0, the texture becomes similar to the vibration of a thin plate. The texture varies depending on the values in Primary Membrane section.

  To prevent oscillation or blow up without changing the `Cross Feedback Gain` or `Collision Distance`, changing `Cross Feedback Ratio` is an option.

### Pitch Texture

Pitch Texture section contains parameters related to the internal pitch of FDNs that represents membranes.

Delay Time Spread

  Spread width of the FDN delay time distribution.

BP Cut Spread

  Width of the cutoff frequency distribution of the bandpass filters in FDN.

Pitch Random [cent]

  Amount of randomization to change the pitches of the delays.

### Pitch Envelope

Pitch envelope modulates delay times and bandpass cutoff frequencies in FDNs.

Attack [s]

  Attack time of the pitch envelope.

  Note: Attack time won’t be longer than the value of `Decay`.

Decay [s]

  Decay time of the pitch envelope.

Amount [oct]

  Amount of modulation by the pitch envelope.

### Primary Membrane

Pitch Type

  Type of FDN delay time distribution.

  Note: Do not select `- Reserved * -`. `- Reserved * -` is an empty option reserved for adding a different `Pitch Type` later. Fallback to `Harmonic` when `- Reserved * -` is selected.

Delay [Hz]

  Reference value for the FDN delay time.

  In FDN, there is always one feedback path with the frequency specified as the value of `Delay`, but it’s only a guideline and does not represent the exact pitch. The reason is the chaos caused by cross feedbacks. So the actual pitch depends on the `Cross Feedback Ratio` setting.

Delay Modulation [sample]

  Amount of the delay time modulation with respect to the amplitude of a feedback signal.

  Warning: Increasing `Delay Modulation` increase the chance of oscillation or blow up.

BP Cut [oct]

  Bandpass cutoff frequency with respect to the frequency set by `Delay`.

  Raising `BP Cut` is effective when making high-pitched sounds like cymbals.

  Lowering `BP Cut` is effective to smooth out the noise caused by `Delay Modulation`.

BP Q

  Bandpass Q value. Q means quality factor in filter.

  When `BP Q` is low, the bandwidth becomes wider. This results in a higher and longer sound, but it also becomes easier to oscillate.

  When `BP Q` is high, the bandwidth becomes narrower. This results in a lower and shorter sound.

  Warning: Increasing `BP Q` increase the chance of oscillation or blow up.

### Secondary Membrane

Secondary membrane inherits most of the values from the Primary Membrane section.

Mix

  Mixing ratio between primary and secondary membrane. When set to 1.0, only the output from the secondary will be mixed.

  Note: Collisions will be calculated even if `Mix` is set to 0.0 or 1.0. To stop collision, increase the value of `Collision Distance`.

Pitch Offset [oct]

  Secondary membrane pitch with respect to primary.

  When set to 0.0, the related values are copied from Primary Membrane section.

  Adjusting `Pitch Offset` and `Q Offset` is similar to detuning one side of a snare drum.

Q Offset [oct]

  Bandpass Q of secondary membrane with respect to primary.

Collision Distance

  Threshold value used to determine collision between primary and secondary membrane.

  Warning: Oscillation may occur when the value of `Collision Distance` is small. To prevent oscillation, increase the value.

## Change Log

- 0.1.5
  - Fixed a bug that plugin to show up with incorrect window size (likely 512x512 pixels) at initialization.
- 0.1.4
  - Added GUI scaling.
  - Fixed a bug on BarBox that the “ascending sort” shortcut was disabled.
  - Updated the Linux patch for VSTGUI4.
- 0.1.3
  - Added `Consistency` parameter.
- 0.1.2
  - Fixed GUI on Linux.
- 0.1.1
  - Changed to include presets in plugin zip package.
  - Added a button to randomize parameters.
- 0.1.0
  - Initial release.

## Old Versions

- GenericDrum 0.1.4 - VST 3 (github.com)
- GenericDrum 0.1.3 - VST 3 (github.com)
- GenericDrum 0.1.2 - VST 3 (github.com)
- GenericDrum 0.1.1 - VST 3 (github.com)
- GenericDrum 0.1.0 - VST 3 (github.com)

## License

GenericDrum is licensed under GPLv3. Complete licenses are linked below.

- https://github.com/ryukau/VSTPlugins/tree/master/License

If the link above doesn’t work, please send email to `ryukau@gmail.com`.

### About VST

VST is a trademark of Steinberg Media Technologies GmbH, registered in Europe and other countries.