NAME
Synth::Config - Synthesizer settings librarian
VERSION
version 0.0007
SYNOPSIS
use Synth::Config ();
my $synth = Synth::Config->new(model => 'Moog Matriarch');
my $name = 'Foo!';
my $id1 = $synth->make_setting(name => $name, etc => '...');
my $id2 = $synth->make_setting(name => $name, etc => '???');
my $setting = $synth->recall_setting(id => $id1);
# { etc => '...' }
my $settings = $synth->recall_settings(name => $name);
# [ 1 => { etc => '...' }, 2 => { etc => '???' } ]
my $names = $synth->recall_names;
# [ 'Foo!' ]
DESCRIPTION
Synth::Config
provides a way to save and recall synthesizer control settings in a database.
This does not control the synth. It is simply a way to manually record the parameters defined by knob, slider, switch, or patch settings in an SQLite database. It is a "librarian", if you will.
ATTRIBUTES
model
$model = $synth->model;
The required model name of the synthesizer.
This is turned into lowercase and all non-alpha-num characters are converted to an underline character (_
).
dbname
$dbname = $synth->dbname;
Database name
Default: synth-config.db
verbose
$verbose = $synth->verbose;
Show progress.
METHODS
new
$synth = Synth::Config->new(model => $model);
Create a new Synth::Config
object.
This automatically makes an SQLite database with a table named for the given model.
make_setting
my $id = $synth->make_setting(%args);
Save a named setting and return the record id.
The name is required. If an id is given, an update is performed. Otherwise, a database insert is made.
Example:
name: 'My Best Setting!'
settings:
group parameter control bottom top value unit is_default
filter cutoff knob 20 20000 200 Hz true
recall_setting
my $setting = $synth->recall_setting(id => $id);
Return the parameters of a setting for the given id.
recall_settings
my $settings = $synth->recall_settings(name => $name);
Return all the settings for a given name.
recall_names
my $names = $synth->recall_names;
Return all the setting names.
SEE ALSO
The t/01-methods.t file in this distribution
Knob: https://codepen.io/jhnsnc/pen/KXYayG
Switch: https://codepen.io/magnus16/pen/grzqMz
Slider: ?
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2023 by Gene Boggs.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)