Browse Source

xap/zynaddsubfx: Upgraded to zynaddsubfx-2.4.3.

slackware-14.2
Damien Goutte-Gattat 9 years ago
parent
commit
3255896b40
  1. 55
      xap/zynaddsubfx/ZynAddSubFX-2.4.1-fltk-1.3.0.diff
  2. 125
      xap/zynaddsubfx/ZynAddSubFX-2.4.1-program-change.diff
  3. 1
      xap/zynaddsubfx/ZynAddSubFX-2.4.1.tar.bz2.sha1
  4. 17
      xap/zynaddsubfx/ZynAddSubFX-2.4.3-homedir.diff
  5. 82
      xap/zynaddsubfx/ZynAddSubFX-2.4.3-xdgconfig.diff
  6. 1
      xap/zynaddsubfx/ZynAddSubFX-2.4.3.tar.bz2.sha1
  7. 19
      xap/zynaddsubfx/zynaddsubfx.SlackBuild

55
xap/zynaddsubfx/ZynAddSubFX-2.4.1-fltk-1.3.0.diff

@ -1,55 +0,0 @@
Index: ZynAddSubFX-2.4.1/src/UI/BankUI.fl
===================================================================
--- ZynAddSubFX-2.4.1.orig/src/UI/BankUI.fl
+++ ZynAddSubFX-2.4.1/src/UI/BankUI.fl
@@ -32,7 +32,7 @@ decl {\#include "../Misc/Config.h"} {pub
class BankProcess_ {} {
Function {process()} {open return_type {virtual void}
- } {}
+ } {code{;}}
decl {Bank *bank;} {public
}
}
Index: ZynAddSubFX-2.4.1/src/UI/OscilGenUI.fl
===================================================================
--- ZynAddSubFX-2.4.1.orig/src/UI/OscilGenUI.fl
+++ ZynAddSubFX-2.4.1/src/UI/OscilGenUI.fl
@@ -129,7 +129,7 @@ delete [] spc;} {selected
class PSlider {: {public Fl_Slider}
} {
- Function {PSlider(int x,int y, int w, int h, const char *label=0):Fl_Slider(x,y,w,h,label)} {} {}
+ Function {PSlider(int x,int y, int w, int h, const char *label=0):Fl_Slider(x,y,w,h,label)} {} {code{;}}
Function {handle(int event)} {return_type int
} {
code {int X=x(),Y=y(),W=w(),H=h();
Index: ZynAddSubFX-2.4.1/src/UI/PartUI.fl
===================================================================
--- ZynAddSubFX-2.4.1.orig/src/UI/PartUI.fl
+++ ZynAddSubFX-2.4.1/src/UI/PartUI.fl
@@ -85,7 +85,7 @@ end();} {}
class PartUI_ {} {
Function {showparameters(int kititem,int engine)} {return_type virtual
- } {}
+ } {code{;}}
}
class PartKitItem {: {public Fl_Group}
Index: ZynAddSubFX-2.4.1/src/UI/PresetsUI.fl
===================================================================
--- ZynAddSubFX-2.4.1.orig/src/UI/PresetsUI.fl
+++ ZynAddSubFX-2.4.1/src/UI/PresetsUI.fl
@@ -18,9 +18,9 @@ decl {\#include "../Params/Presets.h"} {
class PresetsUI_ {} {
Function {refresh()} {open return_type {virtual void}
- } {}
+ } {code{;}}
Function {~PresetsUI_()} {open return_type virtual
- } {}
+ } {code{;}}
}
class PresetsUI {} {

125
xap/zynaddsubfx/ZynAddSubFX-2.4.1-program-change.diff

@ -1,125 +0,0 @@
diff --git a/src/Input/ALSAMidiIn.cpp b/src/Input/ALSAMidiIn.cpp
index d50795d..53493c6 100644
--- a/src/Input/ALSAMidiIn.cpp
+++ b/src/Input/ALSAMidiIn.cpp
@@ -99,6 +99,11 @@ void ALSAMidiIn::getmidicmd(MidiCmdType &cmdtype,
cmdparams[1] = midievent->data.control.value;
//fprintf(stderr,"t=%d val=%d\n",midievent->data.control.param,midievent->data.control.value);
break;
+ case SND_SEQ_EVENT_PGMCHANGE:
+ cmdtype = MidiPgmChange;
+ cmdchan = midievent->data.control.channel;
+ cmdparams[0] = midievent->data.control.value;
+ break;
}
}
diff --git a/src/Input/MidiIn.cpp b/src/Input/MidiIn.cpp
index 3d7c5b2..5df311d 100644
--- a/src/Input/MidiIn.cpp
+++ b/src/Input/MidiIn.cpp
@@ -28,6 +28,9 @@ int MidiIn::getcontroller(unsigned char b)
/**\todo there might be a better way to do this*/
int ctl = C_NULL;
switch(b) {
+ case 0:
+ ctl = C_bankselectmsb; //Bank Select MSB
+ break;
case 1:
ctl = C_modwheel; //Modulation Wheel
break;
@@ -40,6 +43,9 @@ int MidiIn::getcontroller(unsigned char b)
case 11:
ctl = C_expression; //Expression
break;
+ case 32:
+ ctl = C_bankselectlsb; //Bank Select LSB
+ break;
case 64:
ctl = C_sustain; //Sustain pedal
break;
diff --git a/src/Input/MidiIn.h b/src/Input/MidiIn.h
index 5d978ea..a83efac 100644
--- a/src/Input/MidiIn.h
+++ b/src/Input/MidiIn.h
@@ -26,7 +26,7 @@
#include "../globals.h"
enum MidiCmdType {
- MidiNull, MidiNoteOFF, MidiNoteON, MidiController
+ MidiNull, MidiNoteOFF, MidiNoteON, MidiController, MidiPgmChange
};
#define MP_MAX_BYTES 4000 //in case of loooong SYS_EXes
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
index fa5e1b0..8f8996c 100644
--- a/src/Misc/Master.cpp
+++ b/src/Misc/Master.cpp
@@ -177,6 +177,16 @@ void Master::SetController(unsigned char chan, unsigned int type, int par)
}
/*
+ * Program Change
+ */
+void Master::SetProgram(unsigned char chan, unsigned int pgm)
+{
+ for(int npart = 0; npart < NUM_MIDI_PARTS; npart++)
+ if(chan == part[npart]->Prcvchn)
+ bank.loadfromslot(pgm, part[npart]);
+}
+
+/*
* Internal Controllers
*/
void Master::setcontroller(unsigned char chan, unsigned int type, int par)
@@ -202,6 +212,11 @@ void Master::setcontroller(unsigned char chan, unsigned int type, int par)
}
;
}
+ else if(type == C_bankselectmsb) { //Bank Select messages
+ par += 1;
+ if(par > 0 && (strcmp(bank.bankfiletitle, bank.banks[par].dir) != 0))
+ bank.loadbank(bank.banks[par].dir);
+ }
else { //other controllers
for(int npart = 0; npart < NUM_MIDI_PARTS; npart++) //Send the controller to all part assigned to the channel
if((chan == part[npart]->Prcvchn) && (part[npart]->Penabled != 0))
diff --git a/src/Misc/Master.h b/src/Misc/Master.h
index eb47522..18ae4d3 100644
--- a/src/Misc/Master.h
+++ b/src/Misc/Master.h
@@ -77,6 +77,7 @@ class Master
unsigned char velocity);
void NoteOff(unsigned char chan, unsigned char note);
void SetController(unsigned char chan, unsigned int type, int par);
+ void SetProgram(unsigned char chan, unsigned int pgm);
//void NRPN...
diff --git a/src/globals.h b/src/globals.h
index 7c07171..0875b4c 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -201,7 +201,8 @@ enum ONOFFTYPE {
};
enum MidiControllers {
- C_NULL = 0, C_pitchwheel = 1000, C_expression = 11, C_panning = 10,
+ C_bankselectmsb = 0, C_pitchwheel = 1000, C_NULL = 1001,
+ C_expression = 11, C_panning = 10, C_bankselectlsb = 32,
C_filtercutoff = 74, C_filterq = 71, C_bandwidth = 75, C_modwheel = 1,
C_fmamp = 76,
C_volume = 7, C_sustain = 64, C_allnotesoff = 123, C_allsoundsoff = 120,
diff --git a/src/main.cpp b/src/main.cpp
index 1e0d345..da09d22 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -144,6 +144,8 @@ void *thread1(void *arg)
master->NoteOff(cmdchan, note);
if(cmdtype == MidiController)
master->SetController(cmdchan, cmdparams[0], cmdparams[1]);
+ if(cmdtype == MidiPgmChange)
+ master->SetProgram(cmdchan, cmdparams[0]);
pthread_mutex_unlock(&master->mutex);
}

1
xap/zynaddsubfx/ZynAddSubFX-2.4.1.tar.bz2.sha1

@ -1 +0,0 @@
5abffff4ff2710dc427c4888a167c8f8a74d7c7e ZynAddSubFX-2.4.1.tar.bz2

17
xap/zynaddsubfx/ZynAddSubFX-2.4.3-homedir.diff

@ -0,0 +1,17 @@
diff --git a/src/Misc/Bank.cpp b/src/Misc/Bank.cpp
index 1a673da..e23cecc 100644
--- a/src/Misc/Bank.cpp
+++ b/src/Misc/Bank.cpp
@@ -349,6 +349,12 @@ void Bank::rescanforbanks()
void Bank::scanrootdir(string rootdir)
{
+ if(rootdir[0] == '~') {
+ const char *home;
+ if((home = getenv("HOME")))
+ rootdir.replace(0, 1, home);
+ }
+
DIR *dir = opendir(rootdir.c_str());
if(dir == NULL)
return;

82
xap/zynaddsubfx/ZynAddSubFX-2.4.3-xdgconfig.diff

@ -0,0 +1,82 @@
diff --git a/src/Misc/Config.cpp b/src/Misc/Config.cpp
index 9e2a430..34bd0ef 100644
--- a/src/Misc/Config.cpp
+++ b/src/Misc/Config.cpp
@@ -27,6 +27,7 @@
#include "Config.h"
#include "XMLwrapper.h"
+#include "Util.h"
using namespace std;
@@ -235,6 +236,8 @@ void Config::readConfig(const char *filename)
void Config::saveConfig(const char *filename)
{
+ makedir(filename, 0700);
+
XMLwrapper *xmlcfg = new XMLwrapper();
xmlcfg->beginbranch("CONFIGURATION");
@@ -295,6 +298,11 @@ void Config::saveConfig(const char *filename)
void Config::getConfigFileName(char *name, int namesize)
{
+ const char *cfg_dir;
+
name[0] = 0;
- snprintf(name, namesize, "%s%s", getenv("HOME"), "/.zynaddsubfxXML.cfg");
+ if((cfg_dir = getenv("XDG_CONFIG_HOME")))
+ snprintf(name, namesize, "%s/zynaddsubfx/zynaddsubfxXML.cfg", cfg_dir);
+ else
+ snprintf(name, namesize, "%s/.config/zynaddsubfx/zynaddsubfxXML.cfg", getenv("HOME"));
}
diff --git a/src/Misc/Util.cpp b/src/Misc/Util.cpp
index d75ab2f..66d6b29 100644
--- a/src/Misc/Util.cpp
+++ b/src/Misc/Util.cpp
@@ -117,6 +117,30 @@ bool fileexists(const char *filename)
return false;
}
+int makedir(const char *path, int mode)
+{
+ char *p;
+ int ret;
+ struct stat st_buf;
+
+ for(p = (char *)(path + 1), ret = 0; *(p - 1) && ret == 0; ++p) {
+ if(*p == '/' ) {
+ *p = '\0';
+
+ if(stat(path, &st_buf) == -1)
+ ret = mkdir(path, mode);
+ else if(!S_ISDIR(st_buf.st_mode)) {
+ errno = ENOTDIR;
+ ret = -1;
+ }
+
+ *p = '/';
+ }
+ }
+
+ return ret;
+}
+
void set_realtime()
{
sched_param sc;
diff --git a/src/Misc/Util.h b/src/Misc/Util.h
index 1c1545d..4d79dc7 100644
--- a/src/Misc/Util.h
+++ b/src/Misc/Util.h
@@ -34,6 +34,8 @@ extern float VelF(float velocity, unsigned char scaling);
bool fileexists(const char *filename);
+int makedir(const char *path, int mode);
+
#define N_DETUNE_TYPES 4 //the number of detune types
extern float getdetune(unsigned char type,
unsigned short int coarsedetune,

1
xap/zynaddsubfx/ZynAddSubFX-2.4.3.tar.bz2.sha1

@ -0,0 +1 @@
af375f51093fecc9c80064295b3938b9e70b2edf ZynAddSubFX-2.4.3.tar.bz2

19
xap/zynaddsubfx/zynaddsubfx.SlackBuild

@ -1,6 +1,6 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2011 Damien Goutte-Gattat
# Copyright (C) 2011,2012 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
@ -30,13 +30,13 @@
# Source package infos
NAMESRC=${NAMESRC:-ZynAddSubFX}
VERSION=${VERSION:-2.4.1}
VERSION=${VERSION:-2.4.3}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.bz2}
WGET=${WGET:-http://downloads.sourceforge.net/zynaddsubfx/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-zynaddsubfx}
BUILD=${BUILD:-4GGD}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -87,16 +87,15 @@ cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
# Fix bug #3175784 that prevents compiling against FLTK 1.3.0
patch -p 1 < $CWD/ZynAddSubFX-2.4.1-fltk-1.3.0.diff
# Add support for Program Change and Bank Select messages
patch -p 1 < $CWD/ZynAddSubFX-2.4.1-program-change.diff
# Recognize ~ when scanning banks directories
patch -p 1 < $CWD/ZynAddSubFX-2.4.3-homedir.diff
# Place config file in XDG_HOME_DIR
patch -p 1 < $CWD/ZynAddSubFX-2.4.3-xdgconfig.diff
mkdir build && cd build
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DOutputModule=jack \
..
make -j $JOBS
make install DESTDIR=$PKG
@ -107,12 +106,12 @@ find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \
# Install banks and examples
mkdir -p $PKG/usr/share/zynaddsubfx
cp -r ../banks ../examples $PKG/usr/share/zynaddsubfx/
cp -r ../instruments/banks ../instruments/examples \
$PKG/usr/share/zynaddsubfx/
# Add bank numbers
(
cd $PKG/usr/share/zynaddsubfx/banks
rmdir default_bank
i=0
find . -type d | sed '1d;s,^\./,,' | sort | while read bank ; do
i=$(($i+1))

Loading…
Cancel
Save