Title: | Open ModPlug Tracker Port |
---|---|
Description: | Tracker music uses audio samples and pattern tables to organise musical compositions. Such music is stored in module files. This package reads, renders and plays module files using the 'libopenmpt' library <https://lib.openmpt.org/>. |
Authors: | Pepijn de Vries [aut, cre] , Jeroen Ooms [ctb] , Jester [cph, dtc] (Copyright holder of cyberrid.mod), OpenMPT Project Developers and Contributors [cph] |
Maintainer: | Pepijn de Vries <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.1 |
Built: | 2024-12-16 23:23:41 UTC |
Source: | https://github.com/pepijn-devries/openmpt |
Functions to control the global volume of a module, or that of specific channels in the module.
channel_mute_status(mod, channel, ...) channel_mute_status(mod, channel, ...) <- value channel_volume(mod, channel, ...) channel_volume(mod, channel, ...) <- value global_volume(mod, ...) global_volume(mod, ...) <- value
channel_mute_status(mod, channel, ...) channel_mute_status(mod, channel, ...) <- value channel_volume(mod, channel, ...) channel_volume(mod, channel, ...) <- value global_volume(mod, ...) global_volume(mod, ...) <- value
mod |
A tracker module object of class |
channel |
Channel index ( |
... |
Ignored |
value |
Replacement value. In case of ' |
Returns the volume (status), or the updated object in case
of an assign operation (<-
).
mod <- demo_mod() channel_mute_status(mod, 0L) ## Mute the first channel in the module channel_mute_status(mod, 0L) <- TRUE ## Second channel volume at 50% channel_volume(mod, 1L) <- 0.5 channel_volume(mod, 1L) ## global volume at 90% global_volume(mod) <- 0.9 global_volume(mod)
mod <- demo_mod() channel_mute_status(mod, 0L) ## Mute the first channel in the module channel_mute_status(mod, 0L) <- TRUE ## Second channel volume at 50% channel_volume(mod, 1L) <- 0.5 channel_volume(mod, 1L) ## global volume at 90% global_volume(mod) <- 0.9 global_volume(mod)
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
control_keys(mod, ...) control(mod, key, ...) control(mod, key, ...) <- value
mod |
A tracker module object of class |
... |
Ignored |
key |
A |
value |
A replacement value for the specified control |
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.
mod <- demo_mod() control_keys(mod) ## get a specific control value control(mod, "play.at_end") ## 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 )
mod <- demo_mod() control_keys(mod) ## get a specific control value control(mod, "play.at_end") ## 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 )
Renders ModPlug Tracker music to an audio file and encodes it to a desired
output format (e.g. .mp3, .ogg, etc) using av::av_audio_convert()
.
convert_mod( mod, file, start_order = 0L, start_row = 0L, sample_rate = 44100L, duration = NA_real_, verbose = FALSE, ... )
convert_mod( mod, file, start_order = 0L, start_row = 0L, sample_rate = 44100L, duration = NA_real_, verbose = FALSE, ... )
mod |
A tracker module object of class |
file |
Output audio file where the rendered audio is stored. The file name extension is used to determine the type of encoding to be applied. |
start_order |
Starting position ( |
start_row |
Starting row ( |
sample_rate |
Output sample rate in Hz (samples per seconds). |
duration |
Duration in seconds. Rendered sample will not be longer than this duration.
if set to |
verbose |
Passed on to |
... |
Ignored |
Returns NULL
invisibly
mod <- demo_mod() destination <- tempfile(fileext = ".mp3") convert_mod(mod, destination, duration = 2)
mod <- demo_mod() destination <- tempfile(fileext = ".mp3") convert_mod(mod, destination, duration = 2)
Reads the file cyberrid.mod
. It is a ProTracker
file create by Jester.
It is redistributed under the
Attribution Non-commercial Share Alike license.
The music was part of an Amiga computer demo named 'Extension' and was originally released in 1993.
demo_mod()
demo_mod()
Returns the demo module tracker object of class openmpt
mod <- demo_mod()
mod <- demo_mod()
openmpt
class objectWhile playing with play()
or rendering with convert_mod()
, the
state of the module can change continuously (volume, speed, order index, etc.).
These functions return the
current state of an openmpt
class object.
get_current_channel_vu_left(mod, channel, ...) get_current_channel_vu_mono(mod, channel, ...) get_current_channel_vu_rear_left(mod, channel, ...) get_current_channel_vu_rear_right(mod, channel, ...) get_current_channel_vu_right(mod, channel, ...) get_current_estimated_bpm(mod, ...) get_current_order(mod, ...) get_current_pattern(mod, ...) get_current_playing_channels(mod, ...) get_current_row(mod, ...) get_current_speed(mod, ...) get_current_tempo(mod, ...)
get_current_channel_vu_left(mod, channel, ...) get_current_channel_vu_mono(mod, channel, ...) get_current_channel_vu_rear_left(mod, channel, ...) get_current_channel_vu_rear_right(mod, channel, ...) get_current_channel_vu_right(mod, channel, ...) get_current_estimated_bpm(mod, ...) get_current_order(mod, ...) get_current_pattern(mod, ...) get_current_playing_channels(mod, ...) get_current_row(mod, ...) get_current_speed(mod, ...) get_current_tempo(mod, ...)
mod |
A tracker module object of class |
channel |
An |
... |
Ignored |
Return numeric
or integer
values of the requested state.
Function names are pretty self-explanatory. Note that tempo and speed
values are tracker dependent, their meaning depend on the originating
tracker.
mod <- demo_mod() get_current_channel_vu_left(mod, 0L) get_current_channel_vu_mono(mod, 0L) get_current_channel_vu_rear_left(mod, 0L) get_current_channel_vu_rear_right(mod, 0L) get_current_channel_vu_right(mod, 0L) get_current_estimated_bpm(mod) get_current_order(mod) get_current_pattern(mod) get_current_playing_channels(mod) get_current_row(mod) get_current_speed(mod) get_current_tempo(mod)
mod <- demo_mod() get_current_channel_vu_left(mod, 0L) get_current_channel_vu_mono(mod, 0L) get_current_channel_vu_rear_left(mod, 0L) get_current_channel_vu_rear_right(mod, 0L) get_current_channel_vu_right(mod, 0L) get_current_estimated_bpm(mod) get_current_order(mod) get_current_pattern(mod) get_current_playing_channels(mod) get_current_row(mod) get_current_speed(mod) get_current_tempo(mod)
Get the duration of the song from a openmpt
class module object in seconds.
get_duration_seconds(mod, ...)
get_duration_seconds(mod, ...)
mod |
A tracker module object of class |
... |
Ignored |
Returns a numeric
value indicating the song duration in seconds.
mod <- demo_mod() get_duration_seconds(mod)
mod <- demo_mod() get_duration_seconds(mod)
openmpt
module element namesGet names of elements in an openmpt
class object. Use get_metadata()
to get a module's name.
get_instrument_names(mod, ...) get_sample_names(mod, ...) get_channel_names(mod, ...) get_pattern_names(mod, ...) get_order_names(mod, ...) get_subsong_names(mod, ...)
get_instrument_names(mod, ...) get_sample_names(mod, ...) get_channel_names(mod, ...) get_pattern_names(mod, ...) get_order_names(mod, ...) get_subsong_names(mod, ...)
mod |
A tracker module object of class |
... |
Ignored |
A vector
of strings with names
mod <- demo_mod() get_subsong_names(mod) get_channel_names(mod) get_pattern_names(mod) get_order_names(mod) get_instrument_names(mod) get_sample_names(mod)[1:8]
mod <- demo_mod() get_subsong_names(mod) get_channel_names(mod) get_pattern_names(mod) get_order_names(mod) get_instrument_names(mod) get_sample_names(mod)[1:8]
Get meta data of a tracker module such as its "type"
, "title"
and "tracker"
.
Use get_metadata_keys()
to get the available keys for a module object.
get_metadata(mod, key = "title", ...) get_metadata_keys(mod, ...)
get_metadata(mod, key = "title", ...) get_metadata_keys(mod, ...)
mod |
A tracker module object of class |
key |
A key as listed by |
... |
Ignored |
A list of available keys in case of get_metadata_keys()
, the requested
information in case of get_metadata()
.
mod <- demo_mod() get_metadata_keys(mod) get_metadata(mod, "tracker")
mod <- demo_mod() get_metadata_keys(mod) get_metadata(mod, "tracker")
openmpt
moduleFunctions that count specific elements in openmpt
class objects and
returns the resulting number.
get_num_instruments(mod, ...) get_num_samples(mod, ...) get_num_channels(mod, ...) get_num_orders(mod, ...) get_num_patterns(mod, ...) get_num_subsongs(mod, ...) get_pattern_num_rows(mod, pattern)
get_num_instruments(mod, ...) get_num_samples(mod, ...) get_num_channels(mod, ...) get_num_orders(mod, ...) get_num_patterns(mod, ...) get_num_subsongs(mod, ...) get_pattern_num_rows(mod, pattern)
mod |
A tracker module object of class |
... |
Ignored |
pattern |
An |
Returns an integer
count of the requested information.
mod <- demo_mod() get_num_instruments(mod) get_num_samples(mod) get_num_channels(mod) get_num_orders(mod) get_num_patterns(mod) get_num_subsongs(mod) get_pattern_num_rows(mod, 0L)
mod <- demo_mod() get_num_instruments(mod) get_num_samples(mod) get_num_channels(mod) get_num_orders(mod) get_num_patterns(mod) get_num_subsongs(mod) get_pattern_num_rows(mod, 0L)
openmpt
module at a specific order indexA module contains a sequence table describing the order in which to play patterns. This function returns the index of the patter at specific position in the sequence table.
get_order_pattern(mod, order, ...)
get_order_pattern(mod, order, ...)
mod |
A tracker module object of class |
order |
Index of the position in the pattern sequence table (starts at |
... |
Ignored |
Returns the integer
index (starting at 0
) of the pattern at the
indicated order
position.
mod <- demo_mod() get_order_pattern(mod, 3L)
mod <- demo_mod() get_order_pattern(mod, 3L)
Tests if an audio device is present on the system.
has_audio_device()
has_audio_device()
Returns a logical value.
ModArchive is one of the largest online archives of module
files. These functions will assist in accessing this archive.
For mor information see vignette("modarchive")
.
modarchive_info(mod_id, api = modarchive_api()) modarchive_search_mod( text, where = c("filename_or_songtitle", "filename_and_songtitle", "filename", "songtitle", "module_instruments", "module_comments"), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, channels, page, api = modarchive_api() ) modarchive_search_genre( genre = c("unset", modarchive_genres()), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, channels, page, api = modarchive_api() ) modarchive_search_hash(text, api = modarchive_api()) modarchive_random( genre = modarchive_genres(), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, page, api = modarchive_api() ) modarchive_search_artist(text, page, api = modarchive_api()) modarchive_view_by( text, by = c("view_by_list", "view_by_rating_comments", "view_by_rating_reviews", "view_modules_by_artistid", "view_modules_by_guessed_artist"), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, page, api = modarchive_api() ) modarchive_download(mod_id, read_fun = read_mod, ...) modarchive_api() modarchive_requests(api = modarchive_api()) modarchive_genres()
modarchive_info(mod_id, api = modarchive_api()) modarchive_search_mod( text, where = c("filename_or_songtitle", "filename_and_songtitle", "filename", "songtitle", "module_instruments", "module_comments"), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, channels, page, api = modarchive_api() ) modarchive_search_genre( genre = c("unset", modarchive_genres()), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, channels, page, api = modarchive_api() ) modarchive_search_hash(text, api = modarchive_api()) modarchive_random( genre = modarchive_genres(), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, page, api = modarchive_api() ) modarchive_search_artist(text, page, api = modarchive_api()) modarchive_view_by( text, by = c("view_by_list", "view_by_rating_comments", "view_by_rating_reviews", "view_modules_by_artistid", "view_modules_by_guessed_artist"), format = c("unset", "669", "AHX", "DMF", "HVL", "IT", "MED", "MO3", "MOD", "MTM", "OCT", "OKT", "S3M", "STM", "XM"), size, page, api = modarchive_api() ) modarchive_download(mod_id, read_fun = read_mod, ...) modarchive_api() modarchive_requests(api = modarchive_api()) modarchive_genres()
mod_id |
An |
api |
Most ModArchive functions require a personal secret API key.
This key can be obtained from the ModArchive forum. See
|
text |
Text ( |
where |
A |
format |
A |
size |
A vector of two |
channels |
A vector of two |
page |
Many of the ModArchive functions return paginated tables.
When this argument is omitted, the first page is returned. Use an
|
genre |
A genre of music to limit your search to. See
|
by |
A |
read_fun |
Function that accepts an URL first argument.
By default it is |
... |
Arguments passed on to |
Most functions documented here return a data.frame
with information about one or more modules, or an artist. NULL
is returned in case a search has no results.
modarchive_download()
returns the result of calling read_fun
on the requested module.
modarchive_requests()
returns the number of requests that
you made this month using the API key, and how many are available.
modarchive_api()
returns your API key, when you have set it as
environmental variable ("MODARCHIVE_API"
) or session option
("modarchive_api"
). When it is not set it will return ""
.
modarchive_genres()
returns a vector of character
strings,
listing the music genres specified by ModArchive.
elekfunk <- modarchive_download(41529) ## Check how many API requests are left this month reqs <- modarchive_requests() if (length(reqs) > 0) { reqs <- 1 - reqs$current / reqs$maximum } else { reqs <- 0 } ## The examples below will only work with a valid ## API key for modArchive and if more than 25% ## of the monthly requests are left: if (modarchive_api() != "" && reqs > 0.25) { mod_info <- modarchive_info(41529) if (nrow(mod_info) > 0) mod_info$url[[1]] info_search <- modarchive_search_mod("*intro.mod", size = c(8L, 10L), channels = c(1L, 4L)) info_genre <- modarchive_search_genre("Chiptune", "IT") info_hash <- modarchive_search_hash("8f80bcab909f700619025bd7f2975749") info_artist <- modarchive_search_artist("89200") info_list <- modarchive_view_by("A", "view_by_list", "XM", page = 2) info_random <- modarchive_random("Comedy") }
elekfunk <- modarchive_download(41529) ## Check how many API requests are left this month reqs <- modarchive_requests() if (length(reqs) > 0) { reqs <- 1 - reqs$current / reqs$maximum } else { reqs <- 0 } ## The examples below will only work with a valid ## API key for modArchive and if more than 25% ## of the monthly requests are left: if (modarchive_api() != "" && reqs > 0.25) { mod_info <- modarchive_info(41529) if (nrow(mod_info) > 0) mod_info$url[[1]] info_search <- modarchive_search_mod("*intro.mod", size = c(8L, 10L), channels = c(1L, 4L)) info_genre <- modarchive_search_genre("Chiptune", "IT") info_hash <- modarchive_search_hash("8f80bcab909f700619025bd7f2975749") info_artist <- modarchive_search_artist("89200") info_list <- modarchive_view_by("A", "view_by_list", "XM", page = 2) info_random <- modarchive_random("Comedy") }
ModLand is an online archive containing over 400,000 module files. These functions allow you to search in and download from this archive.
modland_search(text, ...) modland_download( format, author, title, mirror = c("modland.com", "ftp.modland.com", "antarctica.no", "ziphoid.com", "exotica.org.uk"), read_fun = read_mod, ... )
modland_search(text, ...) modland_download( format, author, title, mirror = c("modland.com", "ftp.modland.com", "antarctica.no", "ziphoid.com", "exotica.org.uk"), read_fun = read_mod, ... )
text |
Search text, to look for on modland. |
... |
Arguments passed on to |
format |
A single length |
author |
A single length |
title |
A single length |
mirror |
A single length |
read_fun |
Function that accepts an URL first argument.
By default it is |
In case of modland_search()
a data.frame
with search
results are returned (or NULL
if there are no results).
modland_download()
will return the result of the function
specified by read_fun
. By default it will return an openmpt
class object.
search_result <- modland_search("elekfunk mod") ## The URL in the search results will download a rendered ## ogg file. If you want to download te original mod file, ## use this: mod <- modland_download(search_result$format[[1]], search_result$author[[1]], search_result$title[[1]])
search_result <- modland_search("elekfunk mod") ## The URL in the search results will download a rendered ## ogg file. If you want to download te original mod file, ## use this: mod <- modland_download(search_result$format[[1]], search_result$author[[1]], search_result$title[[1]])
A wrapper for the get
function in libopenmpt (see
API documentation)
openmpt_info(key = "library_version", ...)
openmpt_info(key = "library_version", ...)
key |
A key |
... |
Ignored |
Returns a character
string with the requested information.
openmpt_info("library_version") openmpt_info("library_features") openmpt_info("url")
openmpt_info("library_version") openmpt_info("library_features") openmpt_info("url")
openmpt
pattern table or its cellsCollects a specific pattern table from a tracker module and presents it as
a matrix of formatted character
strings in case of pattern()
. The other
functions return a single string for a specific cell inside the pattern table.
pattern(mod, pattern = 0L, width = 0L, pad = TRUE, ...) format_pattern_row_channel(mod, pattern, row, channel, width, pad, ...) format_pattern_row_channel_command(mod, pattern, row, channel, command, ...) highlight_pattern_row_channel(mod, pattern, row, channel, width, pad, ...) highlight_pattern_row_channel_command(mod, pattern, row, channel, command, ...)
pattern(mod, pattern = 0L, width = 0L, pad = TRUE, ...) format_pattern_row_channel(mod, pattern, row, channel, width, pad, ...) format_pattern_row_channel_command(mod, pattern, row, channel, command, ...) highlight_pattern_row_channel(mod, pattern, row, channel, width, pad, ...) highlight_pattern_row_channel_command(mod, pattern, row, channel, command, ...)
mod |
A tracker module object of class |
pattern |
The pattern index (starting at |
width |
The maximum number of characters the string should contain. |
pad |
If |
... |
Ignored |
row |
A row index (starting at |
channel |
a channel (i.e., column) index (starting at |
command |
One of |
A matrix
of pattern cells formatted as character
strings in case of pattern()
.
Each column represents. All other methods return a single string for a specific cell.
an audio channel.
mod <- demo_mod() pattern(mod) format_pattern_row_channel(mod, 0L, 1L, 2L, 0L, TRUE) format_pattern_row_channel_command(mod, 0L, 1L, 2L, "parameter") highlight_pattern_row_channel(mod, 0L, 1L, 2L, 0L, TRUE) highlight_pattern_row_channel_command(mod, 0L, 1L, 2L, "note")
mod <- demo_mod() pattern(mod) format_pattern_row_channel(mod, 0L, 1L, 2L, 0L, TRUE) format_pattern_row_channel_command(mod, 0L, 1L, 2L, "parameter") highlight_pattern_row_channel(mod, 0L, 1L, 2L, 0L, TRUE) highlight_pattern_row_channel_command(mod, 0L, 1L, 2L, "note")
Functions to control the pitch and tempo of a module.
pitch_factor(mod, ...) pitch_factor(mod, ...) <- value tempo_factor(mod, ...) tempo_factor(mod, ...) <- value
pitch_factor(mod, ...) pitch_factor(mod, ...) <- value tempo_factor(mod, ...) tempo_factor(mod, ...) <- value
mod |
A tracker module object of class |
... |
Ignored |
value |
Replacement value. A |
Returns current factor, or the updated object in case
of an assign operation (<-
).
mod <- demo_mod() ## Increase the module pitch with a factor 2 pitch_factor(mod) <- 2 pitch_factor(mod) ## Increase the module tempo with a factor 2 tempo_factor(mod) <- 2 tempo_factor(mod)
mod <- demo_mod() ## Increase the module pitch with a factor 2 pitch_factor(mod) <- 2 pitch_factor(mod) ## Increase the module tempo with a factor 2 tempo_factor(mod) <- 2 tempo_factor(mod)
Renders a module tracker object of class openmpt
and plays it instantaneously.
play(mod, sample_rate = 44100L, progress = "vu", duration = NA_real_, ...)
play(mod, sample_rate = 44100L, progress = "vu", duration = NA_real_, ...)
mod |
A tracker module object of class |
sample_rate |
Output sample rate when playing the module. |
progress |
Progress printed to console while playing. Should be one of
|
duration |
Duration in seconds. Play routine will not last longer than this duration.
if set to |
... |
Ignored |
Returns NULL
invisibly.
if (interactive() && has_audio_device()) { mod <- demo_mod() play(mod) }
if (interactive() && has_audio_device()) { mod <- demo_mod() play(mod) }
Get or set the position of the music player. rewind()
moves the position
to the start of the song.
position_seconds(mod, ...) position_seconds(mod, ...) <- value rewind(mod, ...) set_position_order_row(mod, order, row, ...)
position_seconds(mod, ...) position_seconds(mod, ...) <- value rewind(mod, ...) set_position_order_row(mod, order, row, ...)
mod |
A tracker module object of class |
... |
Ignored |
value |
Position in seconds to move the player to. The value is rounded
to its nearest |
order |
Index of the position in the pattern sequence table (starts at |
row |
Index of the row in the current pattern table (starts at |
Returns NULL
invisibly, or the updated object in case of the assign operator (<-
).
mod <- demo_mod() position_seconds(mod) position_seconds(mod) <- 10.2 set_position_order_row(mod, 1, 4) rewind(mod)
mod <- demo_mod() position_seconds(mod) position_seconds(mod) <- 10.2 set_position_order_row(mod, 1, 4) rewind(mod)
Implementation of basic S3 generics such as print()
.
## S3 method for class 'openmpt' print(x, ...) ## S3 method for class 'openmpt' format(x, ...)
## S3 method for class 'openmpt' print(x, ...) ## S3 method for class 'openmpt' format(x, ...)
x |
Object to apply the method to. |
... |
Ignored. |
In case of print
and format
a formatted string
with basic information about the module is returned.
Read any of the music tracker module file formats supported by libopenmpt: https://wiki.openmpt.org/Manual:_Module_formats.
read_mod(file, ...)
read_mod(file, ...)
file |
File path or URL to read the file from. Binary connections are also supported. |
... |
Ignored |
A modplug
class object. It is an external pointer, pointing to the module object
in memory. It can be used for rendering audio.
## You can read from files mod1 <- read_mod(system.file("cyberrid", "cyberrid.mod", package = "openmpt")) ## but also URLs mod2 <- read_mod("https://api.modarchive.org/downloads.php?moduleid=41529#elektric_funk.mod")
## You can read from files mod1 <- read_mod(system.file("cyberrid", "cyberrid.mod", package = "openmpt")) ## but also URLs mod2 <- read_mod("https://api.modarchive.org/downloads.php?moduleid=41529#elektric_funk.mod")
Each individual module has its own set of render parameters. Use these functions to obtain or set the state of these parameters.
render_param(mod, key, ...) render_param(mod, key, ...) <- value
render_param(mod, key, ...) render_param(mod, key, ...) <- value
mod |
A tracker module object of class |
key |
One of
|
... |
Ignored. |
value |
An |
Returns the current integer render parameter for the specified
key
and mod
. In case of an assign operator (<-
) mod
with an updated
set of render parameters is returned.
mod <- demo_mod() render_param(mod, "STEREOSEPARATION") <- 50 render_param(mod, "STEREOSEPARATION") render_param(mod, "MASTERGAIN") render_param(mod, "INTERPOLATION") render_param(mod, "VOLUMERAMPING")
mod <- demo_mod() render_param(mod, "STEREOSEPARATION") <- 50 render_param(mod, "STEREOSEPARATION") render_param(mod, "MASTERGAIN") render_param(mod, "INTERPOLATION") render_param(mod, "VOLUMERAMPING")
openmpt
moduleTracker music can be composed such that it is intended to play
in a continuous loop. With the repeat count you can affect the number of
times a module is repeated when playing with play()
or rendered with convert_mod()
.
repeat_count(mod, ...) repeat_count(mod, ...) <- value
repeat_count(mod, ...) repeat_count(mod, ...) <- value
mod |
A tracker module object of class |
... |
Ignored |
value |
An |
Returns the integer
repeat count of an openmpt
object. In case
of an assign operator (<-
) an updated mod
is returned with the new repeat count.
mod <- demo_mod() repeat_count(mod) <- 2 repeat_count(mod)
mod <- demo_mod() repeat_count(mod) <- 2 repeat_count(mod)
openmpt
moduleSome openmpt
modules may contain multiple subsongs. Use these
functions to get the current subsong index, or select a different one.
subsong(mod, ...) subsong(mod, ...) <- value
subsong(mod, ...) subsong(mod, ...) <- value
mod |
A tracker module object of class |
... |
Ignored |
value |
An |
Returns the integer
index of the currently selected subsong.
In case of the assign operator (<-
) it returns a version of
mod
with an update selection for the subsong
mod <- demo_mod() subsong(mod) ## a value of -1 plays all subsongs consecutively subsong(mod) <- -1
mod <- demo_mod() subsong(mod) ## a value of -1 plays all subsongs consecutively subsong(mod) <- -1