hello guys,
since I'm using a SFZ soundfont that needs some CC settings (without no
sound can be played) that are set by set_cc directive in the control
header, yesterday I wrote a quick and simple patch for linuxsampler. It
seems to work
fine for me, I don't know if you want to test in some way, to implement
better or something else and then use in the official source tree.
Giovanni
diff --git a/src/engines/sfz/EngineChannel.cpp b/src/engines/sfz/EngineChannel.cpp
index 10ef971..1a97bd3 100644
--- a/src/engines/sfz/EngineChannel.cpp
+++ b/src/engines/sfz/EngineChannel.cpp
@@ -158,6 +158,7 @@ namespace LinuxSampler { namespace sfz {
InstrumentIdxName = newInstrument->GetName();
InstrumentStat = 100;
+ memcpy(ControllerTable, newInstrument->SetCCTable, SETCC_TABLE_SIZE - 1);
{
InstrumentChangeCmd< ::sfz::Region, ::sfz::Instrument>& cmd =
diff --git a/src/engines/sfz/sfz.cpp b/src/engines/sfz/sfz.cpp
index ee4e186..b405051 100755
--- a/src/engines/sfz/sfz.cpp
+++ b/src/engines/sfz/sfz.cpp
@@ -230,6 +230,7 @@ namespace sfz
curves.add(c); curves.add(c); curves.add(c); curves.add(c);
curves.add(c); curves.add(c); curves.add(c);
///////
+ memset(SetCCTable, 0x00, SETCC_TABLE_SIZE - 1);
}
Instrument::~Instrument()
@@ -2043,6 +2044,7 @@ namespace sfz
else if ("pan_curve" == key_cc) pCurDef->pan_curvecc.add( CC(num_cc, 0, check(key, 0, 30000, ToInt(value))) );
else if ("pan_smooth" == key_cc) pCurDef->pan_smoothcc.add( CC(num_cc, 0, -1, check(key, 0.0f, 100000.0f /* max? */, ToFloat(value))) );
else if ("pan_step" == key_cc) pCurDef->pan_stepcc.add( CC(num_cc, 0, -1, 0, check(key, -100.0f, 100.0f, ToFloat(value))) );
+ else if ("set_" == key_cc) _instrument->SetCCTable[num_cc] = ToInt(value);
else std::cerr << "The opcode '" << key << "' is unsupported by libsfz!" << std::endl;
}
diff --git a/src/engines/sfz/sfz.h b/src/engines/sfz/sfz.h
index 170240e..517d821 100755
--- a/src/engines/sfz/sfz.h
+++ b/src/engines/sfz/sfz.h
@@ -44,6 +44,7 @@
#define TRIGGER_LEGATO ((unsigned char) (1 << 3)) // 0x08
#define optional LinuxSampler::optional
+#define SETCC_TABLE_SIZE 130
namespace sfz
{
@@ -649,6 +650,7 @@ namespace sfz
friend class File;
friend class Query;
+ uint8_t SetCCTable[SETCC_TABLE_SIZE];
private:
std::string name;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel