Type: | Package |
Title: | Read and Play Digital Music (MIDI) |
Version: | 1.0.2 |
Description: | Bindings to 'libfluidsynth' to parse and synthesize MIDI files. It can read MIDI into a data frame, play it on the local audio device, or convert into an audio file. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
Imports: | av, rappdirs |
SystemRequirements: | fluidsynth: fluidsynth-devel (rpm) or libfluidsynth-dev (deb). On Linux you also need a soundfont provided by 'fluid-soundfont-gm' (Fedora) or 'sf3-soundfont-gm' (Debian/Ubuntu) |
URL: | https://docs.ropensci.org/fluidsynth/ https://ropensci.r-universe.dev/fluidsynth |
BugReports: | https://github.com/ropensci/fluidsynth/issues |
NeedsCompilation: | yes |
Packaged: | 2024-10-03 14:12:33 UTC; jeroen |
Author: | Jeroen Ooms |
Maintainer: | Jeroen Ooms <jeroenooms@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-10-04 09:10:13 UTC |
Fluidsynth settings
Description
Get available settings and their types. See fluidsynth docs for more information on the available options.
Usage
fluidsynth_setting_list()
fluidsynth_setting_options(setting)
fluidsynth_setting_default(setting)
libfluidsynth_version()
Arguments
setting |
string with one of the options listed in |
Value
a list with available options
References
See Also
Other fluidsynth:
midi_play()
,
soundfonts
Examples
# List available settings:
fluidsynth_setting_list()
fluidsynth_setting_options('audio.driver')
fluidsynth_setting_default('synth.sample-rate')
Play or convert a midi file
Description
Play a midi file to your audio device, render it to a file, or parse the raw data. Additional settings can be specified, see fluidsynth_setting_list for available options.
Usage
midi_play(
midi = demo_midi(),
soundfont = soundfont_path(),
audio.driver = NULL,
settings = list(),
verbose = interactive()
)
midi_convert(
midi = demo_midi(),
soundfont = soundfont_path(),
output = "output.mp3",
settings = list(),
verbose = interactive()
)
midi_read(midi = demo_midi(), verbose = FALSE)
demo_midi()
Arguments
midi |
path to the midi file |
soundfont |
path to the soundfont |
audio.driver |
which audio driver to use, see fluidsynth docs |
settings |
a named vector with additional settings from |
verbose |
print some progress status to the terminal |
output |
filename of the output. The out |
Details
The midi_convert
function internally uses fluidsynth to generate a raw wav file,
and then av::av_audio_convert()
to convert into the requested about format. See
av::av_muxers()
for supported output formats and their corresponding file extension.
You need a soundfont to synthesize midi, see the soundfonts page. On Linux you may
also need to specify an audio.driver
that works for your hardware, although on
recent distributions the defaults generally work.
Value
midi_read returns data frame with midi events.
See Also
Other fluidsynth:
fluidsynth_settings
,
soundfonts
Examples
df <- midi_read(demo_midi())
Managing soundfonts
Description
FluidSynth requires a soundfont to synthesize a midi. On Linux distributions some soundfonts are often preinstalled, though their quality varies. If your midi sounds very poor, try using another soundfont.
Usage
soundfont_path(download = FALSE)
soundfont_download()
Arguments
download |
automatically download soundfont if none exists. |
Details
GeneralUser-GS by S. Christian Collins
is a nice free soundfont. You can use soundfont_download()
to install a copy
of this soundbank for use by this package.
Value
the path to a local soundfont to synthesize a midi file.
See Also
Other fluidsynth:
fluidsynth_settings
,
midi_play()