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. 12
      Source/DXLookNFeel.cpp
  5. 2
      Source/GlobalEditor.cpp
  6. 2
      Source/GlobalEditor.h
  7. 43
      Source/PluginParam.cpp
  8. 5
      Source/PluginProcessor.cpp
  9. 7
      Source/PluginProcessor.h

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -29,14 +29,14 @@ static const char algoArr[][13] = {
{ 0, 0, 1, 3, 0, 0, 0, 2, 4, 0, 0, 5, -6 }, // 1
{ 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, 0, 1, -4, 0, 0, 0, 2, -5, 0, 3, -6, 0 }, // 4
{ 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

@ -314,7 +314,7 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
else if (sliderThatWasMoved == pitchRate4)
{
//[UserSliderCode_pitchRate4] -- add your slider handling code here..
pitchEnvDisplay->repaint();
pitchEnvDisplay->repaint();
//[/UserSliderCode_pitchRate4]
}
else if (sliderThatWasMoved == pitchRate1)

@ -51,7 +51,7 @@ public:
void setSystemMessage(String msg);
void setParamMessage(String msg);
void updateDisplay();
String systemMsg;
String paramMsg;
//[/UserMethods]

@ -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,16 +568,20 @@ int DexedAudioProcessor::getCurrentProgram() {
void DexedAudioProcessor::setCurrentProgram(int index) {
TRACE("setting program %d state", index);
if ( lastStateSave + 2 < time(NULL) ) {
for (int i = 0; i < MAX_ACTIVE_NOTES; i++) {
if (voices[i].keydown == false && voices[i].live == true) {
voices[i].live = false;
}
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;
}
index = index > 31 ? 31 : index;
unpackProgram(index);
lfo.reset(data + 137);
}
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) {

@ -79,7 +79,10 @@ class DexedAudioProcessor : public AudioProcessor
* and needs to be updated.
*/
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