Good File Selection Sample Plugin Code

I am working on a plugin that requires me to select a wav file to be loaded on the MOD DWARF.

What would be a simple existing open source plugin module I can use as a reference to learn a good way to do this?

Ideally it would be a purely LV2 + modgui to make the task easier (I don’t want to use an external framework).

I have developed a fairly standard LV2 plugin for my dwarf (does level matching helping me to do equal volume gain staging), so I have a basic idea of the process for LV2 development now, but couldn’t find relevant information I needed for this particular task for a new plugin (Will create IRs using deconvolution and apply them).

I took a look at the audio player but it was based on carla and had a lot of extra features I was struggling to filter the relevant code out of and figured someone might have a better suggestion for me to look at:

Thanks.

So I have decided to take a look at:

The irfiles state that is set with the name of the file to be loaded seems simple enough and it seems adding the fileTypes parameter allows the template rendering to know the possible list of files available to be selected from:
https://moddevices.github.io/mod-sdk/mod/#fileTypes

However my use-case doesn’t really fit the existing file types. I will create IR’s as an end product but also want to store extra data in a structured naming scheme (I can go into the details if necessary but is a bit of a distraction I think)

Ideally I would specify something like:

<https://github.com/bjcosta/baudio-plugins/bflat_eq#irfile>
    a lv2:Parameter ;
    rdfs:label "IR File" ;
    mod:fileMatches "*.ir.wav" ;
    mod:fileSearchPaths "bflat_eq/" ;
    rdfs:range atom:Path .

But that would require new support in mod-sdk I think, but would I think allow for custom file types to be defined by plugins.

Does anything like this exist already and if not what would be involved in adding something like this to allow plugins more flexibility in managing files themselves?

I couldn’t see any relevant code in mod-sdk to implement something like this myself and provide a PR. It just has the ttl definition, so I assume I am looking in the wrong place.

Might ping @falkTX as he seems to have implemented most of the code I have looked at so far :slight_smile:

So I have looked at the code in modep and can see how files work now.
There is no “generic” support for new custom folders/extensions defined in the ttl files but usage needs to fit into the existing categories.

Basically there is a mapping from file type to folder+extensions, and also the reverse in:

So I will instead work-around this and use:

  • cabsim file type and store my generated IRs in that folder, and other plugins can use them as well then
  • I will add other files in that same folder used to generate my IRs so I can re-generate with extra measurements but with different extensions like .wavbfe

I havent tested this yet, but from looking at the code this will mean my custom files wont be seen by the other IR loaders because of the unsupported extension (which is what I want) and I will just know what they are called and can find them in my plugin.

3 Likes

I’d be really interested in this too. When you’ve got it working could you share your code? Thanks

1 Like

Yeah no problem. Might be a few months before I get back to this again (and I only looked into how to possibly do it) but will post once I have something. I had to start working on the core DSP code again and stopped looking at the GUI.

3 Likes