State fix size and Synprez naming

pull/1/head
asb2m10 11 years ago
parent d9800f1617
commit 166e39da57
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 2427
      JuceLibraryCode/BinaryData.cpp
  3. BIN
      Resources/builtin_pgm.zip
  4. 10
      Source/DXLookNFeel.cpp
  5. 31
      Source/PluginParam.cpp
  6. 5
      Source/PluginProcessor.cpp
  7. 5
      Source/PluginProcessor.h

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -30,13 +30,13 @@ static const char algoArr[][13] = {
{ 0, 0, 1, 3, 0, 0, 0, -2, 4, 0, 0, 5, 6 }, // 2
{ 0, 0, 1, 4, 0, 0, 0, 2, 5, 0, 3, -6, 0 }, // 3
{ 0, 0, 1, -4, 0, 0, 0, 2, -5, 0, 3, -6, 0 }, // 4
{ 0, 1, 3, 5, 0, 0, 0, 2, 4, -6, 0, 0, 0 }, // 5
{ 0, 1, 3, -5, 0, 0, 0, 2, 4, -6, 0, 0, 0 }, // 6
{ 0, 1, 3, 5, 0, 0, 2, 4, -6, 0, 0, 0, 0 }, // 5
{ 0, 1, 3, -5, 0, 0, 2, 4, -6, 0, 0, 0, 0 }, // 6
{ 0, 1, 3, 0, 0, 0, -2, 4, 5, 0, 0, 6, 0 }, // 7
{ 0, 1, 3, 0, 0, 0, 2, -4, 5, 0, 0, 6, 0 }, // 8
{ 0, 1, 3, 0, 0, 0, -2, 4, 5, 0, 0, 0, 0 }, // 9
{ 0, 0, 0, 4, 1, 0, 5, 6, 2, 0, 0, -3, 0 }, // 10
{ 0, 0, 0, 4, 1, 0, 5, -6, 2, 0, 0, 3, 0 }, // 11
{ 0, 1, 3, 0, 0, 0, -2, 4, 5, 0, 0, 6, 0 }, // 9
{ 0, 0, 4, 1, 0, 0, 5, 6, 2, 0, 0, -3, 0 }, // 10
{ 0, 0, 4, 1, 0, 0, 5, -6, 2, 0, 0, 3, 0 }, // 11
{ 0, 0, 3, 0, 1, 0, 4, 5, 6, -2, 0, 0, 0 }, // 12
{ 0, 0, 3, 0, 1, 0, 4, 5, -6, 2, 0, 0, 0 }, // 13
// 1 2 3 4 5 6 7 8 9 A B C D

@ -408,6 +408,21 @@ void DexedAudioProcessor::exportSysex(char *dest) {
memcpy(dest+4102, footer, 2);
}
/**
* This function normalize data that comes from corrupted sysex data.
* It used to avoid engine crashing upon extrem values
*/
char normparm(char value, char max) {
if ( value <= max )
return value;
// if this is beyond the max, we expect a 0-255 range, normalize this
// to the expected return value; and this value as a random data.
return ((float)value)/255 * max;
}
void DexedAudioProcessor::unpackProgram(int idx) {
char *bulk = sysex + (idx * 128);
@ -553,7 +568,12 @@ int DexedAudioProcessor::getCurrentProgram() {
void DexedAudioProcessor::setCurrentProgram(int index) {
TRACE("setting program %d state", index);
if ( lastStateSave + 2 < time(NULL) ) {
if ( lastStateSave + 2 > time(NULL) ) {
TRACE("skipping save, storage recall to close");
return;
}
for (int i = 0; i < MAX_ACTIVE_NOTES; i++) {
if (voices[i].keydown == false && voices[i].live == true) {
voices[i].live = false;
@ -562,7 +582,6 @@ void DexedAudioProcessor::setCurrentProgram(int index) {
index = index > 31 ? 31 : index;
unpackProgram(index);
lfo.reset(data + 137);
}
currentProgram = index;
updateUI();
}
@ -584,12 +603,10 @@ const String DexedAudioProcessor::getParameterText(int index) {
return ctrl[index]->getValueDisplay();
}
#define CURRENT_PLUGINSTATE_VERSION 1
#define CURRENT_PLUGINSTATE_VERSION 2
struct PluginState {
int version;
uint8_t sysex[4011];
uint8_t sysex[4104];
uint8_t program[161];
float cutoff;
float reso;
@ -631,7 +648,7 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte
}
if ( sizeInBytes > sizeof(PluginState) ) {
TRACE("hmmm, too big plugin state size %d", sizeInBytes);
TRACE("too big plugin state size %d", sizeInBytes);
sizeInBytes = sizeof(PluginState);
}

@ -49,6 +49,7 @@ DexedAudioProcessor::DexedAudioProcessor() {
initCtrl();
setCurrentProgram(0);
sendSysexChange = true;
normalizeDxVelocity = false;
}
DexedAudioProcessor::~DexedAudioProcessor() {
@ -254,6 +255,10 @@ void DexedAudioProcessor::keydown(uint8_t pitch, uint8_t velo) {
return;
}
if ( normalizeDxVelocity ) {
velo = ((float)velo) * 0.7874015; // 100/127
}
int note = currentNote;
for (int i = 0; i < MAX_ACTIVE_NOTES; i++) {
if (!voices[note].keydown) {

@ -80,6 +80,9 @@ class DexedAudioProcessor : public AudioProcessor
*/
bool refreshVoice;
bool normalizeDxVelocity;
bool sendSysexChange;
MidiBuffer midiOut;
void processMidiMessage(MidiMessage *msg);
@ -94,7 +97,7 @@ public :
static const int REFRESH_COMP = 1 << 1;
int refreshUI;
bool sendSysexChange;
char data[161];
ScopedPointer<ZipFile> builtin_pgm;

Loading…
Cancel
Save