I'm a big fan of listening to MIDI music using custom soundfonts; sadly, Polyphone isn't in the repo because I wanted to create or edit it. The good thing is also I found it on the FreeBSD port.
polyphone
PKGBUILD
# Maintainer (Arch): David Runge <dvzrv@archlinux.org>
# Maintainer: Jayvee Enaguas <harvettfox96@tilde.club>
pkgname=polyphone
pkgver=2.2.0
pkgrel=1
_debver=${pkgver}
_dfsgrel=dfsg1
_debrel=3
pkgdesc="A soundfont editor for quickly designing musical instruments"
arch=('x86_64' 'i686')
url="https://polyphone-soundfonts.com/"
license=('GPL-3')
depends=('gcc-libs' 'glibc' 'hicolor-icon-theme' 'libressl' 'qt-base' 'qt-svg' 'zlib')
makedepends=('flac' 'jack2' 'libogg' 'libvorbis' 'portaudio' 'qcustomplot' 'qt-tools' 'rtmidi' 'stk')
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/davy7125/${pkgname}/archive/${pkgver}.tar.gz"
${pkgname}-2.2.0-qt5.15.patch::"https://github.com/davy7125/polyphone/commit/7cfa7fe96533e402dd37e533b63c3105af36cd34.patch"
"142.patch"
"no-gplv2-v3-mix.patch")
sha512sums=('88b4f0d951f75ed517e0942e75d543eca28c92fe8f2f99aee1d4be69f7d4fd74ee2219d7779b68b918befc8554cac5dc3f93ac9055bd8a94327e777a0725e5e3'
'a412b16b304ea53665ae3d8a8769898e16297c9b5a57d16cc68a71e8fbd35ee938a364de5226d9cccbff4fd0b87c9d4d10f809a8fd75325a39701d895958f220'
'cc1c8798a93c37ad31e2adb3a60d2b1e0bec28893491ab74a723dc223d308ddaad6363e9b0bf76ac23fbb91f64709c549d77a9b5d03d40bbe0d14fc567c542d8'
'f6e124926dac46a56ac3e98c1597291abc852ff30b49789ca0e13000fd0e70d27df9234b48c16ada1fc412bb496538dbd5adae84b6a39ecc070832fabf6a9551')
prepare() {
cd ${pkgname}-${pkgver}
# Fix missing include required to build against qt >= 5.15.0
patch -p1 -i ../${pkgname}-${pkgver}-qt5.15.patch
patch -p1 -i ../142.patch
patch -p1 -i ../no-gplv2-v3-mix.patch
# Disable accessing the online repo that may contain soundfonts under non-libre CC licenses
sed -i 's#s://www.polyphone-soundfonts.com/en/api/soundfonts#://127.0.0.1#' sources/repository/repositorymanager.cpp
sed -i 's#s://www.polyphone-soundfonts.com/en/create-an-account#://127.0.0.1/#' sources/{context/interface/configsectionrepository,repository/browser/soundfontbrowser}.cpp
sed -i 's#s://www.polyphone-soundfonts.com/en/subscribe#://127.0.0.1/#' sources/{context/interface/configsectionrepository,repository/browser/soundfontbrowser}.cpp
sed -i 's#\"2013 -\" + QString::number(QDate::currentDate().year())#\"2013–2020\"#' sources/dialogs/dialog_about.cpp
}
build() {
cd ${pkgname}-${pkgver}/sources
qmake-qt5 PREFIX=/usr ${pkgname}.pro
make
}
package() {
cd ${pkgname}-${pkgver}/sources
# Doesn't have an install target
# https://github.com/davy7125/polyphone/issues/62/
install -Dm755 bin/${pkgname} -t "${pkgdir}/usr/bin"
install -Dm644 contrib/${pkgname}.svg -t "${pkgdir}/usr/share/icons/hicolor/scalable/apps"
install -Dm644 resources/${pkgname}.png -t "${pkgdir}/usr/share/icons/hicolor/512x512/apps"
install -Dm644 contrib/${pkgname}.desktop -t "${pkgdir}/usr/share/applications"
install -Dm644 contrib/${pkgname}.1 -t "${pkgdir}/usr/share/man/man1"
install -Dm644 contrib/${pkgname}.fr.1 -t "${pkgdir}/usr/share/man/fr/man1"
install -Dm644 contrib/${pkgname}.xml -t "${pkgdir}/usr/share/mime/packages"
install -Dm644 changelog -t "$pkgdir/usr/share/doc/${pkgname}"
install -Dm644 ../LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
142.patch
Description: allow offset values greater than 16-bit signed integer
A fix for issue #141, which was broken by commit
f80fc38b406ad094a1d3d2563da5d8124818e2e3. This fix reverts to the
use of qRound when storing offset values for sample and loop start/end.
From: "S. Christian Collins" <s_chriscollins@hotmail.com>
Origin: https://github.com/davy7125/polyphone/pull/142
Bug: https://github.com/davy7125/polyphone/issues/141
--- a/sources/core/types/attribute.cpp
+++ b/sources/core/types/attribute.cpp
@@ -181,11 +181,11 @@ AttributeValue Attribute::fromRealValue(
break;
case champ_startloopAddrsCoarseOffset: case champ_endloopAddrsCoarseOffset:
case champ_startAddrsCoarseOffset: case champ_endAddrsCoarseOffset:
- storedValue.shValue = Utils::round16(realValue) / 32768;
+ storedValue.shValue = static_cast<qint16>(qRound(realValue) / 32768);
break;
case champ_startloopAddrsOffset: case champ_startAddrsOffset:
case champ_endloopAddrsOffset: case champ_endAddrsOffset:
- storedValue.shValue = static_cast<qint16>(Utils::round16(realValue) % 32768);
+ storedValue.shValue = static_cast<qint16>(qRound(realValue) % 32768);
break;
case champ_keyRange: case champ_velRange:
storedValue.rValue.byHi = static_cast<quint8>(0.001 * realValue);
no-gplv2-v3-mix.patch
Description: Remove SF3 support until legally distributable
Author(s):
- Jayvee Enaguas <harvettfox96@tilde.club>
- Thorsten Glaser <tg@debian.org>
Date: 2023-04-20 03:05:00 +0000
Bug: https://github.com/davy7125/polyphone/issues/105/
Forwarded: https://github.com/davy7125/polyphone/pull/119/
--- a/sources/polyphone.pro
+++ b/sources/polyphone.pro
@@ -179,7 +179,6 @@
clavier \
sound_engine \
sound_engine/elements \
- lib/sf3 \
repository \
repository/browser \
repository/daily \
@@ -204,8 +203,6 @@
core/input/not_supported/inputparsernotsupported.cpp \
core/input/sf2/inputparsersf2.cpp \
core/input/sf2/inputsf2.cpp \
- core/input/sf3/inputparsersf3.cpp \
- core/input/sf3/inputsf3.cpp \
core/input/sfark/inputparsersfark.cpp \
core/input/sfark/inputsfark.cpp \
core/input/sfz/inputparsersfz.cpp \
@@ -287,7 +284,6 @@
sound_engine/elements/calibrationsinus.cpp \
sound_engine/elements/enveloppevol.cpp \
sound_engine/elements/oscsinus.cpp \
- lib/sf3/sfont.cpp \
options.cpp \
mainwindow/widgetshowhistory.cpp \
mainwindow/widgetshowhistorycell.cpp \
@@ -438,7 +434,6 @@
core/output/not_supported/outputnotsupported.cpp \
core/output/sfz/sfzparamlist.cpp \
core/output/sf2/sf2indexconverter.cpp \
- core/output/sf3/outputsf3.cpp \
core/input/sfz/sfzparameter.cpp \
core/input/sfz/sfzparametergroup.cpp \
core/input/sfz/sfzparametergroupassembly.cpp \
@@ -524,8 +519,6 @@
core/input/not_supported/inputparsernotsupported.h \
core/input/sf2/inputparsersf2.h \
core/input/sf2/inputsf2.h \
- core/input/sf3/inputparsersf3.h \
- core/input/sf3/inputsf3.h \
core/input/sfark/inputparsersfark.h \
core/input/sfark/inputsfark.h \
core/input/sfz/inputparsersfz.h \
@@ -613,7 +606,6 @@
sound_engine/elements/calibrationsinus.h \
sound_engine/elements/enveloppevol.h \
sound_engine/elements/oscsinus.h \
- lib/sf3/sfont.h \
options.h \
mainwindow/widgetshowhistory.h \
mainwindow/widgetshowhistorycell.h \
@@ -772,7 +764,6 @@
core/output/not_supported/outputnotsupported.h \
core/output/sfz/sfzparamlist.h \
core/output/sf2/sf2indexconverter.h \
- core/output/sf3/outputsf3.h \
core/input/sfz/sfzparameter.h \
core/input/sfz/sfzparametergroup.h \
core/input/sfz/sfzparametergroupassembly.h \
--- a/sources/core/input/inputfactory.cpp
+++ b/sources/core/input/inputfactory.cpp
@@ -28,7 +28,6 @@
#include "abstractinputparser.h"
#include "abstractinput.h"
#include "sf2/inputsf2.h"
-#include "sf3/inputsf3.h"
#include "sfz/inputsfz.h"
#include "sfark/inputsfark.h"
#include "grandorgue/inputgrandorgue.h"
@@ -45,10 +44,6 @@
_inputs[input->getInputExtension().toLower()] = input;
_orderedInputs << input;
- input = new InputSf3();
- _inputs[input->getInputExtension().toLower()] = input;
- _orderedInputs << input;
-
input = new InputSfz();
_inputs[input->getInputExtension().toLower()] = input;
_orderedInputs << input;
--- a/sources/core/output/outputfactory.cpp
+++ b/sources/core/output/outputfactory.cpp
@@ -31,7 +31,6 @@
#include "contextmanager.h"
#include "abstractoutput.h"
#include "sf2/outputsf2.h"
-#include "sf3/outputsf3.h"
#include "sfz/outputsfz.h"
#include "not_supported/outputnotsupported.h"
#include "empty/outputdummy.h"
@@ -54,11 +53,6 @@
// Format sf2
output = new OutputSf2();
}
- else if (extension == "sf3")
- {
- // Format sf3
- output = new OutputSf3();
- }
else if (extension == "sfz")
{
// Format sfz
qcustomplot
PKGBUILD
# Maintainer (Arch): David Runge <dvzrv@archlinux.org>
# Maintainer: Jayvee Enaguas <harvettfox96@tilde.club>
pkgbase=qcustomplot
pkgname=('qcustomplot' 'qcustomplot-doc')
_name=QCustomPlot
pkgver=2.0.1
_debver=${pkgver}
_dfsgrel=dfsg1
_debrel=4
pkgrel=1
pkgdesc="Qt C++ widget for plotting and data visualization"
arch=('x86_64' 'i686')
url="https://www.qcustomplot.com/"
license=('GPL-3')
makedepends=('doxygen' 'graphviz' 'qt-tools')
source=(${pkgbase}-${pkgver}.tar.bz2::"https://gitlab.com/DerManu/${_name}/-/archive/v${pkgver}/${_name}-v${pkgver}.tar.bz2"
${pkgbase}-${pkgver}-source.tar.gz::"https://www.qcustomplot.com/release/${pkgver}/${_name}-source.tar.gz"
"https://deb.debian.org/debian/pool/main/q/${pkgbase}/${pkgbase}_${_debver}+${_dfsgrel}-${_debrel}.debian.tar.xz")
sha512sums=('fb9184d517007b7c280e7122b3c14b6e49bf6b550bf41b95fe6808cc1c66c66dd82383796bfa4f43ce1ff0406e4c53e579ecc0aa2992741c5a45e5469f4bf5e8'
'b44abbd8fd95970a829bbb6e7becc0765e24bd8f05958c8c1223303b68fb4c0a64f503cf0a2fe4fc53957e6e61a6618500475cff3e81ed0ab387a9eada2c83a3'
'8044f7b74d101f2db4890000d48a468db7d633ad2b7dcb4175abc1e508e4d1266e402a8d74e8c0bf8897fa8a01375ebc0ab846da9d33518838ddf94088255083')
prepare() {
cd ${_name}-v${pkgver}
# Copy required amalgameted sources into place
cp ../${pkgbase}-source/*.{cpp,h} .
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
cp -r ${srcdir}/debian .
quilt push -av
fi
}
build() {
cd ${_name}-v${pkgver}
qmake-qt5 sharedlib/sharedlib-compilation/sharedlib-compilation.pro
make
# Create documentation
doxygen
cd documentation
qhelpgenerator html/index.qhp -o qthelp/qcustomplot.qch
rm html/*.{md5,map,qhp}
}
package_qcustomplot() {
depends=('qt-base')
cd ${_name}-v${pkgver}
# There's no install target
install -d "${pkgdir}/usr/lib" && cp -a lib${pkgname}.so* "${pkgdir}/usr/lib"
install -Dm644 ${pkgname}.h -t "${pkgdir}/usr/include"
install -Dm644 changelog.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm644 GPL.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
package_qcustomplot-doc() {
pkgdesc+=" (docs)"
cd ${_name}-v${pkgver}/documentation
install -d "${pkgdir}/usr/share/doc/${pkgbase}" && cp -r ../examples "${pkgdir}/usr/share/doc/${pkgbase}"
install -Dm644 qthelp/*.qch -t "${pkgdir}/usr/share/doc/qt"
install -Dm644 html/* -t "${pkgdir}/usr/share/doc/${pkgbase}/html"
install -Dm644 ../GPL.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}