Birch-san / juicysfplugin

Audio plugin (e.g. VST, AU) to play soundfonts on macOS, Windows, Linux
GNU General Public License v3.0
211 stars 28 forks source link

Any plans for ASDR support? #4

Closed ghost closed 4 years ago

ghost commented 5 years ago

I would like to know if there are any plans for ASDR support (Attack, Sustain, Decay, Release) in the future. This is pretty much a perfect replacement for FL Studio’s own Soundfont Player (which is not available on the Mac edition) but does not quite have feature parity. Regardless, I have been searching for something like this for a while. This seems to be the only plugin that can handle Soundfonts with multiple instruments correctly!

Birch-san commented 5 years ago

I must confess, I'd never used that feature.

Fruity SoundFont Player Manual

Envelope2 Section You can use this section to override the volume envelope settings used in the SoundFont instrument. The four sliders represent the Attack (A), Decay (D), Sustain /s, Release (R) levels of the SoundFont envelope. Keep these sliders set to minimum to disable overriding of the predefined values.

I've looked a bit at the fluidsynth codebase and don't immediately understand how to build this.

I assume it involves adding a default modulator (similar to https://github.com/Birch-san/juicysfplugin/issues/2#issuecomment-397872150). I never successfully got that to make any audible difference to the sound; there wasn't much documentation.

Probably these (src/synth/fluid_gen.c include/fluidsynth/gen.h) are the generator params that are involved.

Your proposal sounds like it could be some kind of globally-configured envelope, whereas Archer's proposal https://github.com/Birch-san/juicysfplugin/issues/2#issuecomment-397803893 involved controlling envelopes via MIDI commands. Which sounds harder, but perhaps could solve both problems with the same solution. I also wonder whether there's some idiomatic way to enable General MIDI Level 2 features in fluidsynth.

Birch-san commented 5 years ago

@lrcaldwell I've exposed these programmatically.

https://github.com/Birch-san/juicysfplugin/releases/tag/2.1.0

juicysfplugin now forwards MIDI CC messages to fluidsynth, and I've configured fluidsynth to map the following GM2 CC messages such that they modulate envelopes.

Birch-san commented 5 years ago

image Release 2.2.0 provides a GUI for manipulating envelopes.

MIDI CC messages also work (in case you want to automate).

KJinx101 commented 5 years ago

I really wanted to say AMAZING work on this plugin! This saves so many people who rely heavily on soundfonts and use workstations that are dropping support for sf2's and sf3's. This is the may be the best soundfont player I've ever used, and with ASDR and Cut/Res, I think'll it'll top good ol Fruity Soundfont Player as well.

Also, one thing I wanted to add was (after the stable release of ASDR, Cut/Res, and Pitch Bend) perhaps the addition of some sort of Mod Wheel Envelope. In Plogue's SFZ plugin, they use CC001 to create a sort of 'vibrato'ey filter. I hadn't thought of this at all, but when I heard your demo used chip-tune styled soundfonts, I thought about how electronic instruments would largely benefit from this CC# especially as an automation tool or with performance when using the mod wheel.

Once again, thanks for your work on this amazing plugin

Birch-san commented 5 years ago

thanks for the kind words. I'm actively working to stabilise this release — mostly the mundane bits like how to save the last-selected value, and restore it when the synth is re-opened. all the hard questions are answered, so just working my way through all the parameters and rewriting older stuff to use the new patterns.

hey, looks like we actually support CC001 already. there's no GUI or save/load for it, but I think that's acceptable for parameters that are used for note-control rather than instrument control (any parameters controlling the note are presumably saved as MIDI messages in your DAW project).

as of release 2.1.0, we forward all MIDI CC messages into fluidsynth. fluidsynth automatically provides the ten "default modulators" prescribed in the SoundFont Specification v2.4.

8.4.4 MIDI Continuous Controller 1 to Vibrato LFO Pitch Depth

that looks like the modulator you're referring to.

Birch-san commented 4 years ago

ADSR is now fully-supported on macOS as of release 2.3.0.

donarturo11 commented 4 years ago

@Birch-san Because you added codes to original fluidsynth, I would like ask you, how to assign CC to modulator. I found control modulators only by NRPNs. Do you have any idea to patch original fluidsynth?