The mystery of LMMS' DrumSynth

All your LV2 and LADSPA goodness and more.

Moderators: MattKingUSA, khz

Post Reply
paul
Established Member
Posts: 226
Joined: Wed May 07, 2014 9:50 pm
Location: UK
Has thanked: 1 time
Been thanked: 1 time

The mystery of LMMS' DrumSynth

Post by paul »

In the default "samples" folder of LMMS there is a folder called "drumsynth", whose files are not quite audio files, but seem to be presets for a drum synth plugin. For example, the file "classic_clap.ds" is a text file, and it starts reading as follows:

Code: Select all

[General]
Version=DrumSynth v2.0
Tuning=0.00
Stretch=100.0
Level=0
Filter=1
HighPass=1
Resonance=1
FilterEnv=0,21 442000,100 443000,0
...
Now, first of all, what is that "DrumSynth v2.0"? I do have a "DrumSynth" plugin installed in my system, the one of Juced - however, that one should be version 0.something, for sure not 2. Moreover, if I read this ds file with the Juced DrumSynth (for example, in Ardour), the file sounds completely different than in LMMS - so it seems to be a different plugin with the same name.

On top of that, it seems that the Audio File Processor of LMMS treats this ds file as if it were a real audio file: it displays its waveform, it can be stretched and reversed, all seemingly in real time.

So...what is going on? What plugin inside LMMS is reading these files, how does it work, and why can they be treated basically as audiofiles? Also, how do I create my own sounds for that program?
Keep on rocking in the free world!
Basslint
Established Member
Posts: 1518
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 386 times
Been thanked: 300 times

Re: The mystery of LMMS' DrumSynth

Post by Basslint »

There are no mysteries in libre software, thankfully: a tour of the source code would solve them :D

In this case, even though I am no Sherlock Holmes (so anybody, correct me if I am wrong please), the .ds format seems to be an .ini format for an internal synth whose headers are separate modules (like [Distortion]) and whose parameters are like the knobs of that module (like Clipping=20).

When you load those files into LMMS, they are pretty much rendered as audio files.

Of course, if you load those .ds files into another DrumSynth-compatible program, the result is likely going to be different because the synthesis engine is different.

To create your own sounds from that program, you basically have to study the spec for the .ds format. I don't think an official spec exist (since it's a proprietary format which LMMS re-implements freely) but you could just read the DrumSynth.cpp file. Some tips:
- The headers (which I called "modulers" before) are: General, Noise, Tone, Overtones, NoiseBand, NoiseBand2, Distortion
- The parameters (which I called "knobs" before) are those generally retrieved by using the GetPrivateProfile___ function. So, if you search for GetPrivateProfile in your editor (or grep) you will find all parameters for each module right after the module is initialized (so, after strcpy is called in the DrumSynth.cpp file)

For the sake of posterity (people searching the Interwebs) I will translate the DrumSynth.cpp file from the LMMS codebase to a semi-readable spec:

Code: Select all

[General]
Version=
Comment=
Stretch=
Level=
Tuning=
Filter=
Resonance=
HighPass=

[Noise]
On=
Level=
Slope=

[Tone]
On=
Level=
F1=
F2=
Droop=
Phase=

[Overtones]
On=
Level=
Method=
F1=
F2=
Wave1=
Wave2=
Param=
Filter=
Track1=
Track2=

[NoiseBand]
On=
Level=
F=
dF=

[NoiseBand2]
On=
Level=
F=
dF=

[Distortion]
On=
Rate=
Bits=
Clipping=
I am not a LMMS expert so if someone wants to correct me or add type information (i.e. possible values for each parameter), that'd be great! But looking at the dozens of included presets in LMMS should be enough to get started.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
User avatar
LAM
Established Member
Posts: 1074
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 152 times
Been thanked: 390 times

Re: The mystery of LMMS' DrumSynth

Post by LAM »

As you said this look like the JUCE lv2 plugin: DISTRHO Ports
I used the lv2 version but there is a weird glitch (bug?) on the kick drum oscillator sweeping frequencies when other notes (ex. snare) are playing.
It's a real pity because on linux there are few drum synths.
I'm assuming it's the same plugin because of the same name, same preset extension, and same parameters:
Image

in mix, nobody can hear your screen

paul
Established Member
Posts: 226
Joined: Wed May 07, 2014 9:50 pm
Location: UK
Has thanked: 1 time
Been thanked: 1 time

Re: The mystery of LMMS' DrumSynth

Post by paul »

Basslint wrote: Mon Nov 09, 2020 7:16 am ...
- The headers (which I called "modulers" before) are: General, Noise, Tone, Overtones, NoiseBand, NoiseBand2, Distortion
- The parameters (which I called "knobs" before) are those generally retrieved by using the GetPrivateProfile___ function.
...
Thank you!

Wow, this makes it look *a lot* like the Juced DrumSynth. And still, the two programs read the file differently. I wonder if they are descendants of the same code.
Keep on rocking in the free world!
Post Reply