Safe Haskell | Safe-Inferred |
---|
Synopsis
- save_synth :: Path.AppDir -> InstT.SynthName -> [MidiInst.Patch] -> IO ()
- load_synth :: (Patch.Patch -> MidiInst.Code) -> InstT.SynthName -> Text -> Path.AppDir -> IO (Maybe MidiInst.Synth)
- generate_names :: [MidiInst.Patch] -> (Map InstT.Name MidiInst.Patch, [Text])
- clean_name :: Text -> InstT.Name
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.
load_synth :: (Patch.Patch -> MidiInst.Code) -> InstT.SynthName -> Text -> Path.AppDir -> IO (Maybe MidiInst.Synth) Source #
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.