An open API service indexing awesome lists of open source software.

https://github.com/bgribble/mfp

Music For Programmers, a graphical patching language
https://github.com/bgribble/mfp

jack midi music puredata python

Last synced: 28 days ago
JSON representation

Music For Programmers, a graphical patching language

Awesome Lists containing this project

README

        

BUILDING AND INSTALLING MFP
===================================

Post version 0.07, 2024-01-15

TL;DR
---------------------

$ ./waf configure --python=python3 --virtualenv --prefix ~/mfpvirt build install install_deps
[...]
$ ~/mfpvirt/bin/mfp -v

THINGS TO KNOW
---------------------

OS platform: I have only tested MFP on 32-bit (raspi) and 64-bit
Linux.

python: MFP requires Python 3.x at this time.

waf: MFP uses 'waf', which you can think of as a replacement for
autotools and make. You do not need to install waf; the correct
version is supplied in the MFP source tree. That's the way waf
is designed to work More information can be found at
https://code.google.com/p/waf/. MFP's "Makefile" or
"configure.in" equivalent is the file "wscript", which is a plain
Python file. The entry points used by waf are the functions
"configure" and "build", defined near the bottom of the file.

venv: Python dependencies for MFP can either be installed globally
with your installed "pip" or into a virtual environment created
at install time. I recommend using the virtual environment. This
requires the Python "venv" module, which is part of the standard
Python library but Debian and others have it packaged separately.
If you see a configure error about this you may need to install
python3-venv or similar. Configure to use venv with the "--virtualenv"
arg to "waf configure"

setuptools: The build process depends on Python setuptools. If
you have virtualenv installed, you have setuptools already, but
if you aren't using virtualenv you may need to install setuptools
separately. It's packaged as "python-setuptools" on Debian and
Ubuntu.

pip: Pip is still the default package installer for Python. You
will need it installed to build the "wheel" packages.

gcc: The C components of mfp (mfpdsp, pluginfo, and testext) are
straightforward C but include some c99-isms, mainly due to LV2. I
have been using versions from gcc-4.8.3 to 9.3.0 with no trouble.

CONFIGURING
-----------------------

The basic form:

$ ./waf configure [options]

A full list of options is shown by ./waf --help, under
"Configuration options". Most of these are waf builtin options. The custom
options for MFP are:

| Option | Purpose |
|--------|---------|
| `--virtualenv` | Build in a virtualenv (default: false) |
| `--with-clutter` | Enable Clutter backend (default: don't build) |
| `--without-imgui` | Disable Dear ImGUI backend (default: build) |

LIBRARIES
-----------------------

The "mfpdsp" C library/program needs a few C libraries with their
development headers and pkg-config files installed:

* ladspa.h (LADSPA plugins)
* glib-2.0 (GLib/GObject)
* json-glib-2.0 (JSON serializing/deserializing)
* serd-0 (LV2 TTL parsing)
* jack (duh)
* liblo (OSC library, needed by pyliblo)
* lv2 headers (LV2 load/save)
* libfaust ([faust~] for embedded Faust DSP)
* llvm (LLVM, for Faust live compilation and linking)
* libpolly (LLVM helper library needed for Faust+LLVM)

You'll get errors in the "./waf configure" process if these aren't installed.

Python runtime dependencies will be installed automatically.

Note that the Python language bindings for Gtk+/GLib and Clutter libraries
CANNOT be automatically installed by this build process. You need to
install your OS package manager's package for the "GIR" (GObject
Introspection Repository) data for Clutter, Glib, Gtk+, Gdk,
GtkClutter, and Pango, and the Python infrastructure to use that data.
In Debian, these are packaged as:

gir1.2-clutter-1.0
gir1.2-gtkclutter-1.0
gir1.2-pango-1.0
gir1.2-glib-2.0
gir1.2-gtk-3.0
python-gi

They are only needed if you are building the Clutter UI.

BUILDING
-----------------------

$ ./waf build

This will build the project into ./wafbuild (or other directory as
specified to "configure"). There may be some temporary stuff placed
into ./build/ and ./dist/ by setuptools, so I wouldn't use those as
names for the waf build directory.

INSTALLING
--------------------------

$ ./waf install

The installation root defaults to /usr/local and can be modified
by passing in the --prefix argument to "./waf configure". You can use a
shared area like /opt/ or /usr/local/ or specify a MFP-specific dir
such as /opt/mfp or ~/mfp/. There will be a couple of things in $prefix/bin,
one shared library in $prefix/lib, and then a bunch of stuff in
$prefix/share/mfp/.

You don't have to add anything to any paths to launch MFP;
$prefix/bin/mfp is a wrapper which does that for you. Just run it
and you should be good to go.

Note that once you have installed MFP to a $prefix, there's some
stuff hardcoded into the launcher so you can't just move the
whole directory to another location. You will need to install
again to the new location.

DESKTOP FILE
--------------------------

The template desktop file `mfp.desktop` will be populated with
paths and installed to ${PREFIX}/share/mfp/com.billgribble.mfp.desktop. You will
need to copy it to wherever such things go on your system.

The icon path is what I needed to get icons working on my Gnome
system. You may need to change it. If you need to do something
manual, the actual icon image is the one in mfp.svg. I can't
express how crabby I am about how messed up icons are on the
Linux desktop.

For what it's worth, on my system the desktop file should be
~/.local/share/applications/com.billgribble.mfp.desktop

RUNNING TESTS
--------------------------

There are some tests, though not as many as I would like. What's
there basically comes in two flavors, all of which can be run
with various incantations of the `nosetests` test runner:

* Python test cases in mfp/test: run with plain `nosetests -v mfp/test/`

* C test cases in mfpdsp/test_*: run with the `testext` plugin
to nosetests, `nosetests -v --with-testext --exe wafbuild/libmfpdsp.so`

Note on nosetests: I started using it because, 12+ years ago, it
was the best test runner. Now other tools like pytest have won
more mindshare. I spent some effort on the plugins to run C tests
for mfpdsp so I am sticking with nosetests.

HOWEVER, the original nosetests is abandoned and doesn't work
with current Python versions, and the "new" version of nosetests
(nose2) changed the way plugins worked, and doesn't support the
--exe option needed to point nose to the libmfpdsp.so file. So I
switched over to "pynose", which is a fork of the original
nosetests, just updated to work with contemporary Python. It gets
installed by install_deps.