diff --git a/JuceOPLVSTi.jucer b/JuceOPLVSTi.jucer index eec510f..b26abbb 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPLVSTi.jucer @@ -1,13 +1,13 @@ - diff --git a/Source/OPLLookAndFeel.cpp b/Source/OPLLookAndFeel.cpp index baa25a2..8776ca8 100644 --- a/Source/OPLLookAndFeel.cpp +++ b/Source/OPLLookAndFeel.cpp @@ -16,6 +16,8 @@ OPLLookAndFeel::OPLLookAndFeel() toggleOff = ImageCache::getFromMemory(PluginGui::toggle_off_sq_png, PluginGui::toggle_off_sq_pngSize), 1.000f, Colour(0x00000000); toggleOn = ImageCache::getFromMemory(PluginGui::toggle_on_sq_png, PluginGui::toggle_on_sq_pngSize), 1.000f, Colour(0x00000000); toggleRect = Rectangle((float)toggleOff.getWidth(), (float)toggleOn.getHeight()); + + setColour(Label::ColourIds::outlineWhenEditingColourId, Colours::black); } void OPLLookAndFeel::drawTickBox(Graphics &g, diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index 168f54a..eb6f563 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -1983,6 +1983,8 @@ void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) else if (comboBoxThatHasChanged == velocityComboBox2) { //[UserComboBoxCode_velocityComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Carrier Velocity Sensitivity", id); //[/UserComboBoxCode_velocityComboBox2] } else if (comboBoxThatHasChanged == algorithmComboBox) @@ -1995,6 +1997,8 @@ void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox2) { //[UserComboBoxCode_keyscaleAttenuationComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Carrier Keyscale Level", id); //[/UserComboBoxCode_keyscaleAttenuationComboBox2] } else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox) diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 684f428..ba7378c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -748,10 +748,10 @@ void AdlibBlasterAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBu Opl->SetAttenuation(ch, 2, getEnumParameter("Carrier Attenuation")); break; case 1: - Opl->SetAttenuation(ch, 2, 16 - (midi_message.getVelocity() / 8)); + Opl->SetAttenuation(ch, 2, 32 - (midi_message.getVelocity() / 4)); break; case 2: - Opl->SetAttenuation(ch, 2, 32 - (midi_message.getVelocity() / 4)); + Opl->SetAttenuation(ch, 2, 63 - (midi_message.getVelocity() / 2)); break; } switch (getEnumParameter("Modulator Velocity Sensitivity")) { diff --git a/Source/hiopl.cpp b/Source/hiopl.cpp index 9be4c5e..a9c8758 100644 --- a/Source/hiopl.cpp +++ b/Source/hiopl.cpp @@ -213,8 +213,23 @@ static const char* STATE[] = { "D", "A", }; -const char* Hiopl::GetState(int ch) const { - return STATE[adlib->chip.chan[ch - 1].op[1].state]; +// in-memory ordering of DOSBox emulator +static int DOSBOX_CH_MAP[] = { + -1, // channel numbering starts at 1 + 0, + 2, // 1 + 4, // 2 + 1, // 3 + 3, // 4 + 5, + 6, + 7, + 8, + 9, +}; +const char* Hiopl::GetState(int ch) const { + int dosboxCh = DOSBOX_CH_MAP[ch]; + return STATE[adlib->chip.chan[dosboxCh].op[1].state]; } bool Hiopl::IsActive(int ch) { @@ -277,31 +292,20 @@ Hiopl::~Hiopl() { }; +// Check that _GetOffset parameters are in range. bool Hiopl::_CheckParams(int ch, int osc=OSCILLATORS) { return ch > 0 && ch <= CHANNELS && osc > 0 && osc <= OSCILLATORS; } +// The register offset for parameters that affect a specific oscillator. int Hiopl::_GetOffset(int ch, int osc) { assert(_CheckParams(ch, osc)); return (1 == osc) ? _op1offset[ch] : _op2offset[ch]; } -// re-ordered to match in-memory ordering of DOSBox emulator -static int OFFSET_MAP[] = { - -1, - 0, - 3,//1, - 1,//2, - 4,//3, - 2,//4, - 5, - 6, - 7, - 8, - 9, -}; +// The register offset for parameters that affect the entire channel. int Hiopl::_GetOffset(int ch) { assert(_CheckParams(ch)); - return OFFSET_MAP[ch]; + return ch - 1; } diff --git a/cmd/win.cmd b/cmd/win.cmd new file mode 100644 index 0000000..18a2d92 --- /dev/null +++ b/cmd/win.cmd @@ -0,0 +1,23 @@ +@ECHO OFF +IF [%1]==[] GOTO usage + +ECHO Building Windows Release +SET RELEASE_VERSION=%1 + +MSBUILD Builds\VisualStudio2015\JuceOPLVSTi.vcxproj /p:Configuration="Release - 32-bit" /p:Platform="x86" +MSBUILD Builds\VisualStudio2015\JuceOPLVSTi.vcxproj /p:Configuration="Release - 64-bit" /p:Platform="x64" + +MKDIR %RELEASE_TEMP% +COPY "Builds\VisualStudio2015\Release - 32-bit\JuceOPLVSTi.dll" . +COPY "Builds\VisualStudio2015\x64\Release - 64-bit\JuceOPLVSTi x64.dll" . + +REM We can zip using jar from the JDK! +REM http://stackoverflow.com/a/29879102/1480560 +DEL JuceOPLVSTi_%RELEASE_VERSION%.zip +jar -cMf JuceOPLVSTi_%RELEASE_VERSION%.zip "JuceOPLVSTi x64.dll" JuceOPLVSTi.dll Instruments +DEL "JuceOPLVSTi x64.dll" JuceOPLVSTi.dll +GOTO :eof + +:usage +ECHO Specify version on command line (eg 0-14-1) +