-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added FST Bank and Preset handling. #11
Conversation
Thank you, this is awesome! I will take a deeper look at it once I'm done with the features that I'm currently working on, and I'll take a look at how this feature could be added to the VST 3 plugin as well, and then I'm going to merge it. As I said, it might take some time, but I'm on it. Until then, you don't need to bother with keeping the branch in sync with One small question though: do you mind, if I change the copyright header in the affected files like the following?
|
Thank you - for this wonderful synth! Take your time, no hurry at all - I've already got a version with this feature in ;-) Regarding VST3: Regarding the copyright header: Looking forward to the new features you're working on! And in the meantime I'm curious about how parameter automation in the FST could be implemented/work ;-) |
I see you have started experimenting with that already. :-) I think that directly exporting the parameters might raise a lot of problems, e.g. what should happen if the DAW is automating a parameter which also has a controller assigned within the synth? What if the in-synth one is an envelope (which is polyphonic)? One way to avoid this problem would be to define a couple of host-automation controllers explicitly, let's say 20, and export 20 dummy automatable parameters. Then the synth would use those dummy parameters for driving those internal parameters which have these special controllers assigned. But wait - this is almost the same thing as what VST 3 does. VST 3 plugins receive all MIDI CC messages as parameter automation rather than as actual MIDI messages. In fact, the FST could implement automation with a similar trick: export one parameter for each supported MIDI CC, and let the DAW automate those. Though some ambiguity would still remain with this approach (e.g. if we get an automated and a MIDI value for a CC at the same time - in VST 3, the winner is the one which came later), at least there would be no conflicts with poliphony, and the two plugin types would work the same way. At least, this is how I plan to implement it after I'm done with tempo sync and log scale filter frequencies (almost there), and with merging your PR. |
Hmmm, I currently do not really understand, how those MIDI CC controllers are meant to work.... And then, when it comes to recording of automation: E.g. when I use ''blooo' VSTi from 'Full Bucket Music' and I have a nice sound where I want to live tweak the cutoff of Filter 1 with a knob on my keyboard which sends on MIDI CC 86, then I first 'LEARN' blooo to used MIDI CC 86 for Filter 1 cutoff. This is how I somewhat learned how live tweaking/automation of parameters is supposed to work (with VST2 at least). I hope that what I wrote just above is somewhat understandable. For js80p the current state is, that as soon as a parameter has a MIDI CC controller assigned, that parameter cannot be automated in any way - from what I have experienced with my draft... I will create a PR now for you with for this draft - maybe it can be of help for you to try out / play around. This draft is not at all meant to be really pulled into your main repo. I will now be away from my computer for some days. Cheers, |
They are stored so that it is possible to create presets that use the well-defined CC controllers more or less the way one would expect them to work (e.g. modwheel CC1, volume CC7, etc.). Also, I wanted to keep things simple, and use the same serailization for patch export/import and
You are right, this feature was missing from JS80P. I should have thought about users who have many reassignable knobs and faders on their keyboard.
I think there should be some limitations on what CC can be assigned freely by the user to knobs and faders, because there are CC numbers which have special meanings. E.g. assigning CC 33 to a user-assignable fader would interfere with 14 bit CC messages of the modwheel. (This is why JS80P omits CC 32-63 and many others: they have special meanings that I might want to implement some day.)
I agree, that's why I try to restrict the presets that I include in JS80P releases to only use the modwheel from the CC numbers, because that's what's usually available on all keyboards with a standard CC number. (The only exception is
This is the workflow that I had in mind originally, and why I didn't export the parameters in the first few releases.
I haven't checked out your draft yet, but I'm not sure I understand this part. The workflow that you described above should work in JS80P even without exporting any parameters to the DAW. If I understand correctly, the problem is that you would need trial and error to figure out which knobs on your keyboard correspond to which CC in the plugin, and that's what MIDI Learn could do instantly. Do I understand it correctly?
I hope I can get to show some progress with your PR by the time you get back. |
Yep, this works - automation gets recorded - in XT64 as 'Control Change' for the assigned MIDI CC. I see, you already implemented MIDI learn! Great! |
This is the conflict which I plan to avoid by exporting the supported MIDI CCs as parameters instead of exporting the synth's parameters directly. Then you can automate those, and It will work the same way as in VST3, where the plugin has no choice but to define these virtual parameters if it wants to handle CC events. (The only difference will be that in VST3, these exposed parameters are automatically assigned to the respective MIDI CC by the host, which cannot be done in FST - but fortunately it's not needed, since unlike VST3, the FST plugin receives the raw MIDI with CC and everything.) So for example, on the GUI, you would assign the Modwheel to the wavefolder, and then it's up to you if you want to physically turn the wheel while recording, or if you want to draw automation for the exported parameter named "Modwheel".
Though they also say that you can let the users overwrite the built-in presets (similarly to the As for the program names: those won't be editable by the user in the FST version on the GUI, since user supplied texts can bring a lot of complications that I'd rather avoid. (Where to put it on the GUI, encodings, right-to-left writing systems, IMEI, etc. Also, since I don't use any high-level GUI libraries in the Linux version in order to have maximum portability, it would need some extra e as well. Of course, I could rely on |
Yes, this is nice that you'll use the first bank slots and initialize them with the built-in presets.
Absolutely fine - as this is something which is now possible from within a host (if the host supports it - and I think most hosts do so nowadays).
Yes, I guess this might be somewhat conflicting - but it seems other FSTs I know either are able to deal with this kind of conflict or it is somehow possible to just ignore the conflicting situation and let the 'stronger' or first or whatever win and think: MIDI Learn works great! |
Finally, banks and presets are on I made a few changes here and there, and though in theory, it should be compatible with your format, make sure to have a backup of your existing presets and banks before you try it.
It's up to the host to manage the names of the VST3 presets, just like for VST2/FST. The only difference is that you can't overwrite the presets that come with the plugin, and you can't rename them either. But with the presets that you create using the host's preset management, you can of course do whatever you want (and whatever the host allows doing). Now I'll start working on #7. |
Wow, thanks a lot for your work! I see that this got somewhat more complicated then what I've implemented, especially when it comes to clearing events and whatnot and ensuring that parameter values are really the ones that get loaded for a program/preset! Looking forward to your implementation of parameter automation. |
And it got even more complicated: I forgot to restart the LFOs after resetting the synth's state for the patch import. 😅 |
Hi Attila! But - when it comes to preset handling, something is not quite right. I hope you can find some time to investigate. Edit: Also: I for sure also tried in energyXT, where there are the same resp. similar issues. Edit 2: |
Thanks, I'll take a look at it, it looks like it's not enough to test in just Reaper and FL Studio. (I haven't seen any strange behavior in these two with regards to preset handling.) Next week is going to be a bit more busy for me than usual, so it might take some time. |
FYI: 1.7.6 is out with the fix for this. |
Wow, thanks a lot! |
Hi Attila! Me again... I was busy with releasing my VeeSTeeEx VST2 wrapper plugin (which I was writing for years and tried to test with nearly every interesting VST2 plugin that was released before and during development - that's how I found your jsp80 and that it initially didn't support bank and preset handling which is a precondition to be wrapped by VeeSTeeEx in the way it is supposed to work - see here: https://www.kvraudio.com/product/veesteeex-by-zonderp-productions) Now that I finally have some time, I want to report, that unfortunately js80p still doesn't work quite right when it comes to loading of preset (.fxp) files. Sometimes the loaded preset just doesn't sound as it should, but instead just more like the 'init' or default sound. Then clicking 'next' and 'prev' again (e.g. in SAVIHost or via my VeeSTeeEx wrapper) to be back at the index where to the preset was loaded into, the preset sounds as it should. In my VeeSTeeEx I save more or less the same data as gets stored in a fxp files (just with a little bit smaller header) into a database, and it is easy to just select such a preset and then also the same procedure takes place as if a preset would get loaded from a preset file. Here the same applies. Sometimes the selected preset sounds right and sometimes not. If you want to see js80p wrapped via 'js80pEx.ddl' (my VeeSTeeEx wrapper renamed so that it loads js80p.dll) here is a link to a 7z files which contains everything needed in a folder: https://drive.google.com/file/d/17jsisPe_CnazgQHZsnI-Qio_FvoKIeaw/view?usp=sharing Essentially it contains SAVIHost.exe renamed to 'js80pEx.exe', then 'js80pEx.dll' and 'js80p.dll' (version 2.0.0) as well as a presets folder with all 2.0.0 presets as fxp files and VeeSTeeEx's database, local settings and GUI file. But no matter if it just doesn't work good with my wrapper - loading of presets also doesn't (always) work with SAVIHost or any other host which offers the functionality of loading a fxp preset file into a VST2 plugin. I hope you have an idea of what could be the reason for it and how it could be fixed. Regards, |
Hi! Thanks, I will take a look at it some time next week. |
The 'Synth' class got one additional 'pseudo'-parameter called 'name'.
It defaults to 'Init' and gets serialized/imported alongside the regular synth parameters in the 'serialize' and 'import' functions of the 'Serializer' class.
The FST plugin code has most of the relevant changes:
'set_chunk' and 'get_chunk' got an additional parameter indicating if only a preset's or the whole bank's state should get restored/stored.
There also functions for handling opcodes 'effSetProgram', 'effGetProgram', 'effSetProgramName', 'effGetProgramName' and 'effGetProgramNameIndexed' got introduced.
I made js80p support banks of 128 presets - as this is what most FST 2 plugins have.
This means that the FST plugin code needs to keep an array of 128 serialized strings representing those 128 presets.
It also keeps an array of 128 preset names (each an empty string initially, but if accessed and still empty then get parsed from the respective preset's serialized string).
The code shouldn't affect the VST3 version at all (except that also the preset name 'Init' would be serialized) and also all other code not related to bank and preset handling is untouched.
I guess code in 'serialize' and 'import' of the 'Serialize' class could be adjusted to make it work more like the other code there, but because I couldn't really debug, I didn't do that.
I tested 'only' the 64 bit Windows version with Herman Seib's 'savihost_64.exe' and with 'real' DAW 'EXT64 beta 1' (https://www.xtsware.com/?page_id=297).
I didn't even try to give the synth the ability to name a preset from its GUI, as this is not a requirement for the functionality of the FST bank and preset handling - but this is something which would be possible now.