midi sample reso + reopen UI bugfix

pull/1/head
asb2m10 11 years ago
parent 04a78a6300
commit ced347bb37
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 8
      README.md
  3. 3
      Source/PluginEditor.cpp
  4. 4
      Source/PluginFx.cpp
  5. 2
      Source/PluginFx.h
  6. 58
      Source/PluginProcessor.cpp
  7. 6
      Source/PluginProcessor.h

@ -25,8 +25,8 @@ Features
Changelog Changelog
--------- ---------
#### Version 0.4.0 (current sprint) #### Version 0.4.0 (current sprint)
* Modulatioin wheel support * Modulation wheel support
* Now using the [OBxd](https://obxd.wordpress.com) 4-pole lowpass filter implementation * Now using the [Obxd](https://obxd.wordpress.com) 4-pole lowpass filter implementation
Binary downloads Binary downloads
---------------- ----------------
@ -58,7 +58,7 @@ valid checksum for your DX7 keyboard. I'm in now way responsible if this breaks
Credits & thanks Credits & thanks
---------------- ----------------
* DX Synth engine : Raph Levien and the [msfa](https://code.google.com/p/music-synthesizer-for-android) team * DX Synth engine : Raph Levien and the [msfa](https://code.google.com/p/music-synthesizer-for-android) team
* LP Filter : Filatov Vadim (2DaT); taken from the excellent [OBxd](https://obxd.wordpress.com) project * LP Filter : Filatov Vadim (2DaT); taken from the excellent [Obxd](https://obxd.wordpress.com) project
* Original DX7 compilation : Jean-Marc Desprez (author of [SynprezFM](http://www.synprez.com/SynprezFM)) and to all the all crew who made these historic DX programs: Dave Benson, Frank Carvalho, Tim Conrardy, Jack Deckard, Chris Dodunski, Tim Garrett, Hitaye, Stephan Ibsen, Christian Jezreel, Narfman, Godric Wilkie * Original DX7 compilation : Jean-Marc Desprez (author of [SynprezFM](http://www.synprez.com/SynprezFM)) and to all the all crew who made these historic DX programs: Dave Benson, Frank Carvalho, Tim Conrardy, Jack Deckard, Chris Dodunski, Tim Garrett, Hitaye, Stephan Ibsen, Christian Jezreel, Narfman, Godric Wilkie
* markusthegeek direct implication for this project * markusthegeek direct implication for this project
@ -66,7 +66,7 @@ TODO - Dexed
------------ ------------
* Implement a better DX look and feel (amp, pitch, algo) * Implement a better DX look and feel (amp, pitch, algo)
* Various code cleanup * Various code cleanup
* Standalone executable (for full support of the editor) * Standalone executable (for full support of the sysex editor)
TODO - msfa TODO - msfa
----------- -----------

@ -43,7 +43,7 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
cartridges.setTextWhenNothingSelected(String::empty); cartridges.setTextWhenNothingSelected(String::empty);
cartridges.setBounds(5, 5, 160, 18); cartridges.setBounds(5, 5, 160, 18);
cartridges.addItemList(processor->cartManager.cartNames, 1); cartridges.addItemList(processor->cartManager.cartNames, 1);
cartridges.setSelectedItemIndex(0); cartridges.setSelectedItemIndex(0, NotificationType::dontSendNotification);
cartridges.addListener(this); cartridges.addListener(this);
addAndMakeVisible (loadButton = new TextButton("LOAD")); addAndMakeVisible (loadButton = new TextButton("LOAD"));
@ -132,7 +132,6 @@ void DexedAudioProcessorEditor::paint (Graphics& g) {
} }
void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) { void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
if (buttonThatWasClicked == loadButton) { if (buttonThatWasClicked == loadButton) {
FileChooser fc ("Import original DX sysex...", File::nonexistent, "*.syx;*.SYX;*.*", 1); FileChooser fc ("Import original DX sysex...", File::nonexistent, "*.syx;*.SYX;*.*", 1);

@ -1,9 +1,9 @@
/** /**
* *
* Copyright (c) 2013-2014 Pascal Gauthier. * Copyright (c) 2013-2014 Pascal Gauthier.
* Copyright (C) 2013-2014 Filatov Vadim. * Copyright (c) 2013-2014 Filatov Vadim.
* *
* Filter taken from the OBXd project : * Filter taken from the Obxd project :
* https://github.com/2DaT/Obxd * https://github.com/2DaT/Obxd
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or

@ -36,7 +36,7 @@ class PluginFx {
int mmch; int mmch;
inline float NR24(float sample,float g,float lpc); inline float NR24(float sample,float g,float lpc);
// preprocess value from the UI // preprocess values taken the UI
float rCutoff; float rCutoff;
float rReso; float rReso;

@ -88,6 +88,9 @@ void DexedAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock)
workBlock = new SInt16[samplesPerBlock]; workBlock = new SInt16[samplesPerBlock];
keyboardState.reset(); keyboardState.reset();
nextMidi= new MidiMessage(0xF0);
midiMsg = new MidiMessage(0xF0);
} }
void DexedAudioProcessor::releaseResources() { void DexedAudioProcessor::releaseResources() {
@ -130,23 +133,46 @@ void DexedAudioProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& mi
// add messages to the buffer if the user is clicking on the on-screen keys // add messages to the buffer if the user is clicking on the on-screen keys
keyboardState.processNextMidiBuffer (midiMessages, 0, numSamples, true); keyboardState.processNextMidiBuffer (midiMessages, 0, numSamples, true);
// check input
MidiBuffer::Iterator it(midiMessages); MidiBuffer::Iterator it(midiMessages);
MidiMessage msg; hasMidiMessage = it.getNextEvent(*nextMidi,midiEventPos);
int pos;
float *channelData = buffer.getSampleData(0);
int samplePos = 0;
while(it.getNextEvent(msg, pos)) { while(getNextEvent(&it, numSamples)) {
processMidiMessage(&msg); processMidiMessage(midiMsg);
} }
midiMessages.clear();
processSamples(numSamples, workBlock); while ( samplePos < numSamples ) {
float *channelData = buffer.getSampleData(0); int block = numSamples;
for(int i = 0; i < numSamples; i++ ) {
float f = ((float) workBlock[i]) / (float) 32768; /*
* MIDI message needs to be bound to
* the sample. When a rendering occurs
* very large blocks can be passed and
* without this code, the plugin will be
* out of sync... TODO!
while(getNextEvent(&it, samplePos)) {
processMidiMessage(midiMsg);
}
if ( hasMidiMessage ) {
block = midiEventPos - samplePos;
} else {
block = numSamples - samplePos;
}
*/
processSamples(block, workBlock);
for(int i = 0; i < block; i++ ) {
float f = ((float) workBlock[i+samplePos]) / (float) 32768;
if( f > 1 ) f = 1; if( f > 1 ) f = 1;
if( f < -1 ) f = -1; if( f < -1 ) f = -1;
channelData[i] = (double) f; channelData[i+samplePos] = (double) f;
}
samplePos += block;
} }
fx.process(channelData, numSamples); fx.process(channelData, numSamples);
@ -163,6 +189,7 @@ void DexedAudioProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& mi
buffer.clear (i, 0, buffer.getNumSamples()); buffer.clear (i, 0, buffer.getNumSamples());
} }
midiMessages.clear();
if ( ! midiOut.isEmpty() ) { if ( ! midiOut.isEmpty() ) {
midiMessages.swapWith(midiOut); midiMessages.swapWith(midiOut);
} }
@ -175,6 +202,15 @@ AudioProcessor* JUCE_CALLTYPE createPluginFilter() {
return new DexedAudioProcessor(); return new DexedAudioProcessor();
} }
bool DexedAudioProcessor::getNextEvent(MidiBuffer::Iterator* iter,const int samplePos) {
if (hasMidiMessage && midiEventPos <= samplePos) {
*midiMsg = *nextMidi;
hasMidiMessage = iter->getNextEvent(*nextMidi, midiEventPos);
return true;
}
return false;
}
void DexedAudioProcessor::processMidiMessage(MidiMessage *msg) { void DexedAudioProcessor::processMidiMessage(MidiMessage *msg) {
if ( msg->isSysEx() ) { if ( msg->isSysEx() ) {

@ -98,6 +98,12 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater
PropertiesFile::Options prefOptions; PropertiesFile::Options prefOptions;
MidiMessage* nextMidi,*midiMsg;
bool hasMidiMessage;
int midiEventPos;
bool getNextEvent(MidiBuffer::Iterator* iter,const int samplePos);
public : public :
StringArray programNames; StringArray programNames;
char sysex[4096]; char sysex[4096];

Loading…
Cancel
Save