Each individual module has its own set of control parameters. Use these functions to obtain or set the state of these parameters.

control_keys(mod, ...)

control(mod, key, ...)

control(mod, key, ...) <- value

Arguments

mod

A tracker module object of class openmpt.

...

Ignored

key

A character string representing a specific control you whish to get or set. Use control_keys() to list all available keys.

value

A replacement value for the specified control key. Check the libopenmpt documentation for the appropriate replacement types and values for each of the key values.

Value

control_keys() returns a vector of strings containing all available control keys for mod. control() returns the value for the specified key'. In case of an assign operator (<-) an updated version of mod` is returned, where the control key has been set if successful.

Examples

mod <- demo_mod()
control_keys(mod)
#>  [1] "load.skip_samples"                   "load.skip_patterns"                 
#>  [3] "load.skip_plugins"                   "load.skip_subsongs_init"            
#>  [5] "seek.sync_samples"                   "subsong"                            
#>  [7] "play.tempo_factor"                   "play.pitch_factor"                  
#>  [9] "play.at_end"                         "render.resampler.emulate_amiga"     
#> [11] "render.resampler.emulate_amiga_type" "render.opl.volume_factor"           
#> [13] "dither"                             

## get a specific control value
control(mod, "play.at_end")
#> [1] "fadeout"

## set a number of control values
control(mod, "play.at_end") <- "stop"
control(mod, "play.pitch_factor") <- 2
control(mod, "load.skip_plugins") <- TRUE
control(mod, "dither") <- 2L

## Show all control settings
all_keys <- control_keys(mod)
structure(
  lapply(all_keys, control, mod = mod),
  names = all_keys
)
#> $load.skip_samples
#> [1] FALSE
#> 
#> $load.skip_patterns
#> [1] FALSE
#> 
#> $load.skip_plugins
#> [1] TRUE
#> 
#> $load.skip_subsongs_init
#> [1] FALSE
#> 
#> $seek.sync_samples
#> [1] TRUE
#> 
#> $subsong
#> [1] 0
#> 
#> $play.tempo_factor
#> [1] 1
#> 
#> $play.pitch_factor
#> [1] 2
#> 
#> $play.at_end
#> [1] "stop"
#> 
#> $render.resampler.emulate_amiga
#> [1] FALSE
#> 
#> $render.resampler.emulate_amiga_type
#> [1] "auto"
#> 
#> $render.opl.volume_factor
#> [1] 1
#> 
#> $dither
#> [1] 2
#>