Skip to content

Instantly share code, notes, and snippets.

@niya3
Last active December 1, 2021 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niya3/c8c0040f73265eafce8ff4d0ffff8ee8 to your computer and use it in GitHub Desktop.
Save niya3/c8c0040f73265eafce8ff4d0ffff8ee8 to your computer and use it in GitHub Desktop.
Frescobaldi MIDI generation and playback in Linux

Generating MIDI file via LilyPond

  1. add \midi {} line to \score {} section
  2. click LilyPond - Engrave
  3. check if there is now line like MIDI output to 'example.midi'... in LilyPond Log window
  4. see also https://www.frescobaldi.org/uguide#help_ts_midi_generate

Playing MIDI file from Frescobaldi

  1. install package fluidsynth and soundfont-fluid to your system
  2. create symlink sudo ln -s /usr/share/soundfonts/FluidR3_GM.sf2 /usr/share/soundfonts/default.sf2
  3. create service file ~/.config/systemd/user/fluidsynth.service with content as follows
  4. start service systemctl --user daemon-reload; systemctl --user start fluidsynth.service
  5. select Edit - Preferences - MIDI Settings - Player output: FluidSynth
  6. jfyi, Close unusend MIDI output is a recommended option
  7. (feel free to restart Frescobaldi)
  8. click LilyPond - Engrave
  9. click play in MIDI player window (Tools - MIDI - MIDI Player) and hear the music!
  10. see also https://github.com/frescobaldi/frescobaldi/wiki/MIDI-playback-on-Linux and https://wiki.archlinux.org/title/FluidSynth
# ~/.config/systemd/user/fluidsynth.service
[Unit]
Description=FluidSynth launched in server mode
After=sound.target
[Service]
ExecStart=/usr/bin/fluidsynth -a pulseaudio -m alsa_seq -i -l -s -p FluidSynth /usr/share/soundfonts/default.sf2
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment