Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Cmd.Instrument.MidiInstDb

Synopsis

Documentation

save_synth :: Path.AppDir -> InstT.SynthName -> [MidiInst.Patch] -> IO () Source #

Some instruments want to load their patches in elaborate slow ways, like parsing a directory full of sysexes. These patches can export a make_db function, which will do the slow parts and save the results in a cache file. The load function will simply read the cache file, if present.

generate_names :: [MidiInst.Patch] -> (Map InstT.Name MidiInst.Patch, [Text]) Source #

inst_name is the name as it appears on the synth, so it's not guaranteed to be unique. Also, due to loading from sysexes, there may be duplicate patches. Generate valid names for the patches, drop duplicates, and disambiguate names that wind up the same.

clean_name :: Text -> InstT.Name Source #

People like to put wacky characters in their names, but it makes them hard to type.