Multi-cartridge save

pull/1/head
asb2m10 11 years ago
parent 28d04c91f2
commit 027035e47c
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 12
      Builds/VisualStudio2012/Dexed.sln
  3. 1039
      Builds/VisualStudio2012/Dexed.vcxproj
  4. 86
      Builds/VisualStudio2012/Dexed.vcxproj.filters
  5. 19
      Builds/VisualStudio2013/Dexed.sln
  6. 1543
      Builds/VisualStudio2013/Dexed.vcxproj
  7. 2657
      Builds/VisualStudio2013/Dexed.vcxproj.filters
  8. 30
      Builds/VisualStudio2013/resources.rc
  9. 22
      Dexed.jucer
  10. 13
      README.md
  11. 2
      Source/DXComponents.cpp
  12. 116
      Source/GlobalEditor.cpp
  13. 12
      Source/GlobalEditor.h
  14. 167
      Source/PluginData.cpp
  15. 46
      Source/PluginData.h
  16. 194
      Source/PluginEditor.cpp
  17. 11
      Source/PluginEditor.h
  18. 0
      Source/PluginFx.cpp
  19. 0
      Source/PluginFx.h
  20. 5
      Source/PluginParam.cpp
  21. 12
      Source/PluginProcessor.h

@ -1,23 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dexed", "Dexed.vcxproj", "{1A9EF105-5BF5-9FB6-9634-A91A6D840866}"
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2012
Project("{BD26B4C3-163D-4785-A63F-D3E66858BFF3}") = "Dexed", "Dexed.vcxproj", "{1A9EF105-5BF5-9FB6-9634-A91A6D840866}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|Win32.ActiveCfg = Debug|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|Win32.Build.0 = Debug|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|x64.ActiveCfg = Debug|x64
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|x64.Build.0 = Debug|x64
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|Win32.ActiveCfg = Release|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|Win32.Build.0 = Release|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|x64.ActiveCfg = Release|x64
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

File diff suppressed because it is too large Load Diff

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Dexed">
@ -375,6 +376,9 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_basics\synthesisers\juce_Synthesiser.cpp">
<Filter>Juce Modules\juce_audio_basics\synthesisers</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\AU\juce_AU_Wrapper.mm">
<Filter>Juce Modules\juce_audio_plugin_client\AU</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_DigiCode1.cpp">
<Filter>Juce Modules\juce_audio_plugin_client\RTAS</Filter>
</ClCompile>
@ -390,12 +394,21 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_Wrapper.cpp">
<Filter>Juce Modules\juce_audio_plugin_client\RTAS</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_MacUtilities.mm">
<Filter>Juce Modules\juce_audio_plugin_client\RTAS</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\VST\juce_VST_Wrapper.cpp">
<Filter>Juce Modules\juce_audio_plugin_client\VST</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\VST\juce_VST_Wrapper.mm">
<Filter>Juce Modules\juce_audio_plugin_client\VST</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\AAX\juce_AAX_Wrapper.cpp">
<Filter>Juce Modules\juce_audio_plugin_client\AAX</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\AAX\juce_AAX_Wrapper.mm">
<Filter>Juce Modules\juce_audio_plugin_client\AAX</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\utility\juce_PluginUtilities.cpp">
<Filter>Juce Modules\juce_audio_plugin_client\utility</Filter>
</ClCompile>
@ -420,6 +433,9 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_processors\format\juce_AudioPluginFormatManager.cpp">
<Filter>Juce Modules\juce_audio_processors\format</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\juce_AudioUnitPluginFormat.mm">
<Filter>Juce Modules\juce_audio_processors\format_types</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\juce_LADSPAPluginFormat.cpp">
<Filter>Juce Modules\juce_audio_processors\format_types</Filter>
</ClCompile>
@ -654,6 +670,21 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_linux_Threads.cpp">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_mac_Files.mm">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_mac_Network.mm">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_mac_Strings.mm">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_mac_SystemStats.mm">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_mac_Threads.mm">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_core\native\juce_posix_NamedPipe.cpp">
<Filter>Juce Modules\juce_core\native</Filter>
</ClCompile>
@ -723,9 +754,15 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_events\native\juce_android_Messaging.cpp">
<Filter>Juce Modules\juce_events\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_events\native\juce_ios_MessageManager.mm">
<Filter>Juce Modules\juce_events\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_events\native\juce_linux_Messaging.cpp">
<Filter>Juce Modules\juce_events\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_events\native\juce_mac_MessageManager.mm">
<Filter>Juce Modules\juce_events\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_events\native\juce_win32_Messaging.cpp">
<Filter>Juce Modules\juce_events\native</Filter>
</ClCompile>
@ -825,6 +862,12 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_graphics\native\juce_linux_Fonts.cpp">
<Filter>Juce Modules\juce_graphics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_graphics\native\juce_mac_CoreGraphicsContext.mm">
<Filter>Juce Modules\juce_graphics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_graphics\native\juce_mac_Fonts.mm">
<Filter>Juce Modules\juce_graphics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_graphics\native\juce_win32_Direct2DGraphicsContext.cpp">
<Filter>Juce Modules\juce_graphics\native</Filter>
</ClCompile>
@ -1179,6 +1222,12 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_android_Windowing.cpp">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_ios_UIViewComponentPeer.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_ios_Windowing.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_linux_Clipboard.cpp">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
@ -1188,6 +1237,21 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_linux_Windowing.cpp">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_mac_FileChooser.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_mac_MainMenu.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_mac_MouseCursor.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_mac_NSViewComponentPeer.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_mac_Windowing.mm">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_basics\native\juce_win32_DragAndDrop.cpp">
<Filter>Juce Modules\juce_gui_basics\native</Filter>
</ClCompile>
@ -1233,15 +1297,27 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_android_WebBrowserComponent.cpp">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_ios_UIViewComponent.mm">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_linux_SystemTrayIcon.cpp">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_linux_WebBrowserComponent.cpp">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_mac_AppleRemote.mm">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_mac_NSViewComponent.mm">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_mac_SystemTrayIcon.cpp">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_mac_WebBrowserComponent.mm">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_gui_extra\native\juce_win32_ActiveXComponent.cpp">
<Filter>Juce Modules\juce_gui_extra\native</Filter>
</ClCompile>
@ -1311,14 +1387,6 @@
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\VST\juce_VST_Wrapper.cpp">
<Filter>Juce Library Code</Filter>
</ClCompile>
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\AAX\juce_AAX_Wrapper.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\utility\juce_PluginUtilities.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_DigiCode1.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_DigiCode2.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_DigiCode3.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_WinUtilities.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\RTAS\juce_RTAS_Wrapper.cpp" />
<ClCompile Include="..\..\JuceLibraryCode\modules\juce_audio_plugin_client\VST\juce_VST_Wrapper.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\PluginProcessor.h">

@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2013
Project("{BD26B4C3-163D-4785-A63F-D3E66858BFF3}") = "Dexed", "Dexed.vcxproj", "{1A9EF105-5BF5-9FB6-9634-A91A6D840866}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|Win32.ActiveCfg = Debug|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Debug|Win32.Build.0 = Debug|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|Win32.ActiveCfg = Release|Win32
{1A9EF105-5BF5-9FB6-9634-A91A6D840866}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,30 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Digital Suburban\0"
VALUE "FileDescription", "Dexed\0"
VALUE "FileVersion", "1.0.0\0"
VALUE "ProductName", "Dexed\0"
VALUE "ProductVersion", "1.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif

@ -111,6 +111,28 @@
<MODULEPATH id="juce_audio_basics" path="../../juce"/>
</MODULEPATHS>
</VS2012>
<VS2013 targetFolder="Builds/VisualStudio2013" vstFolder="c:\SDKs\vstsdk2.4">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="1" optimisation="1" targetName="Dexed"/>
<CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="0" optimisation="2" targetName="Dexed"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/>
<MODULEPATH id="juce_audio_utils" path="../../juce"/>
<MODULEPATH id="juce_audio_processors" path="../../juce"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../juce"/>
<MODULEPATH id="juce_audio_devices" path="../../juce"/>
<MODULEPATH id="juce_audio_basics" path="../../juce"/>
</MODULEPATHS>
</VS2013>
</EXPORTFORMATS>
<MODULES>
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>

@ -20,7 +20,7 @@ Features
* All of the 144 DX7 parameters are available from one single panel
* Fully supports DX7 input and output Sysex messages; including controller change. This means that you can use this with a native DX7/TX7 as a patch editor
* Each operator have a realtime VU meter to know wich one is active
* Can load any DX7/TX7 sysex programs
* Can load/save any DX7/TX7 sysex programs. It is also possible to save a single program into a different sysex file.
Binary downloads
----------------
@ -37,14 +37,21 @@ midi in sysex input data to the plugin.
Randomized programs
-------------------
Dexed doesn't check the sysex checksum so you can load any type of files. If the checksum doesn't
match, it will tell you but load it anyway. This features enable a somekind of randomized DX
programs.
match, it will tell you but load it anyway. This feature act as a kind of a randomization
for DX programs.
Credits & thanks
----------------
Raph Levien and msfa team, markusthegeek, Jean-Marc Desprez and all the 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)
TODO - Dexed
------------
* Implement a better DX look and feel (amp, pitch, algo)
* Better implementation of the LPF filter
* Various code cleanup
* Standalone executable
TODO - msfa
-----------

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

@ -29,12 +29,6 @@
//==============================================================================
GlobalEditor::GlobalEditor ()
{
addAndMakeVisible (algo = new Slider ("algo"));
algo->setRange (1, 32, 1);
algo->setSliderStyle (Slider::Rotary);
algo->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
algo->addListener (this);
addAndMakeVisible (lfoType = new ComboBox ("new combo box"));
lfoType->setEditableText (false);
lfoType->setJustificationType (Justification::centredLeft);
@ -84,9 +78,6 @@ GlobalEditor::GlobalEditor ()
reso->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
reso->addListener (this);
addAndMakeVisible (algoDisplay = new AlgoDisplay());
algoDisplay->setName ("algoDisplay");
addAndMakeVisible (pitchRate2 = new Slider ("pitchRate2"));
pitchRate2->setRange (0, 99, 1);
pitchRate2->setSliderStyle (Slider::Rotary);
@ -135,12 +126,6 @@ GlobalEditor::GlobalEditor ()
pitchLevel1->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
pitchLevel1->addListener (this);
addAndMakeVisible (feedback = new Slider ("feedback"));
feedback->setRange (0, 7, 1);
feedback->setSliderStyle (Slider::Rotary);
feedback->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
feedback->addListener (this);
addAndMakeVisible (transpose = new Slider ("transpose"));
transpose->setRange (0, 49, 0);
transpose->setSliderStyle (Slider::LinearVertical);
@ -162,6 +147,21 @@ GlobalEditor::GlobalEditor ()
addAndMakeVisible (pitchEnvDisplay = new PitchEnvDisplay());
pitchEnvDisplay->setName ("pitchEnvDisplay");
addAndMakeVisible (algoDisplay = new AlgoDisplay());
algoDisplay->setName ("algoDisplay");
addAndMakeVisible (feedback = new Slider ("feedback"));
feedback->setRange (0, 7, 1);
feedback->setSliderStyle (Slider::Rotary);
feedback->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
feedback->addListener (this);
addAndMakeVisible (algo = new Slider ("algo"));
algo->setRange (1, 32, 1);
algo->setSliderStyle (Slider::Rotary);
algo->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
algo->addListener (this);
//[UserPreSize]
//[/UserPreSize]
@ -180,7 +180,6 @@ GlobalEditor::~GlobalEditor()
//[Destructor_pre]. You can add your own custom destruction code here..
//[/Destructor_pre]
algo = nullptr;
lfoType = nullptr;
lfoSpeed = nullptr;
lfoAmDepth = nullptr;
@ -188,7 +187,6 @@ GlobalEditor::~GlobalEditor()
lfoDelay = nullptr;
cutoff = nullptr;
reso = nullptr;
algoDisplay = nullptr;
pitchRate2 = nullptr;
pitchRate3 = nullptr;
pitchRate4 = nullptr;
@ -197,12 +195,14 @@ GlobalEditor::~GlobalEditor()
pitchLevel3 = nullptr;
pitchLevel4 = nullptr;
pitchLevel1 = nullptr;
feedback = nullptr;
transpose = nullptr;
oscSync = nullptr;
pitchModSens = nullptr;
lfoSync = nullptr;
pitchEnvDisplay = nullptr;
algoDisplay = nullptr;
feedback = nullptr;
algo = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@ -232,7 +232,6 @@ void GlobalEditor::paint (Graphics& g)
void GlobalEditor::resized()
{
algo->setBounds (568, 32, 24, 24);
lfoType->setBounds (624, 40, 96, 16);
lfoSpeed->setBounds (624, 16, 96, 16);
lfoAmDepth->setBounds (696, 64, 24, 24);
@ -240,7 +239,6 @@ void GlobalEditor::resized()
lfoDelay->setBounds (672, 64, 24, 24);
cutoff->setBounds (8, 40, 48, 48);
reso->setBounds (64, 40, 48, 48);
algoDisplay->setBounds (408, 8, 152, 74);
pitchRate2->setBounds (776, 64, 32, 24);
pitchRate3->setBounds (800, 64, 32, 24);
pitchRate4->setBounds (824, 64, 32, 24);
@ -249,27 +247,39 @@ void GlobalEditor::resized()
pitchLevel3->setBounds (800, 40, 32, 24);
pitchLevel4->setBounds (824, 40, 32, 24);
pitchLevel1->setBounds (752, 40, 32, 24);
feedback->setBounds (568, 56, 24, 24);
transpose->setBounds (728, 0, 24, 56);
oscSync->setBounds (600, 64, 24, 24);
pitchModSens->setBounds (728, 64, 24, 24);
lfoSync->setBounds (624, 64, 24, 24);
pitchEnvDisplay->setBounds (752, 8, 96, 32);
algoDisplay->setBounds (442, 8, 152, 74);
feedback->setBounds (568, 32, 24, 24);
algo->setBounds (568, 8, 24, 24);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
void GlobalEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
//[UsercomboBoxChanged_Pre]
//[/UsercomboBoxChanged_Pre]
if (comboBoxThatHasChanged == lfoType)
{
//[UserComboBoxCode_lfoType] -- add your combo box handling code here..
//[/UserComboBoxCode_lfoType]
}
//[UsercomboBoxChanged_Post]
//[/UsercomboBoxChanged_Post]
}
void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
{
//[UsersliderValueChanged_Pre]
//[/UsersliderValueChanged_Pre]
if (sliderThatWasMoved == algo)
{
//[UserSliderCode_algo] -- add your slider handling code here..
//[/UserSliderCode_algo]
}
else if (sliderThatWasMoved == lfoSpeed)
if (sliderThatWasMoved == lfoSpeed)
{
//[UserSliderCode_lfoSpeed] -- add your slider handling code here..
//[/UserSliderCode_lfoSpeed]
@ -347,11 +357,6 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
pitchEnvDisplay->repaint();
//[/UserSliderCode_pitchLevel1]
}
else if (sliderThatWasMoved == feedback)
{
//[UserSliderCode_feedback] -- add your slider handling code here..
//[/UserSliderCode_feedback]
}
else if (sliderThatWasMoved == transpose)
{
//[UserSliderCode_transpose] -- add your slider handling code here..
@ -362,24 +367,19 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
//[UserSliderCode_pitchModSens] -- add your slider handling code here..
//[/UserSliderCode_pitchModSens]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
void GlobalEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
//[UsercomboBoxChanged_Pre]
//[/UsercomboBoxChanged_Pre]
if (comboBoxThatHasChanged == lfoType)
else if (sliderThatWasMoved == feedback)
{
//[UserComboBoxCode_lfoType] -- add your combo box handling code here..
//[/UserComboBoxCode_lfoType]
//[UserSliderCode_feedback] -- add your slider handling code here..
//[/UserSliderCode_feedback]
}
else if (sliderThatWasMoved == algo)
{
//[UserSliderCode_algo] -- add your slider handling code here..
//[/UserSliderCode_algo]
}
//[UsercomboBoxChanged_Post]
//[/UsercomboBoxChanged_Post]
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
@ -447,10 +447,6 @@ BEGIN_JUCER_METADATA
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="1" initialWidth="855" initialHeight="90">
<BACKGROUND backgroundColour="ffffff"/>
<SLIDER name="algo" id="8a226ddf9bbff752" memberName="algo" virtualName=""
explicitFocusOrder="0" pos="568 32 24 24" min="1" max="32" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="0" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<COMBOBOX name="new combo box" id="31018596af3b34e9" memberName="lfoType"
virtualName="" explicitFocusOrder="0" pos="624 40 96 16" editable="0"
layout="33" items="TRIANGLE&#10;SAW DOWN&#10;SAW UP&#10;SQUARE&#10;SINE&#10;S&amp;HOLD"
@ -479,9 +475,6 @@ BEGIN_JUCER_METADATA
explicitFocusOrder="0" pos="64 40 48 48" min="0" max="1" int="0"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<GENERICCOMPONENT name="algoDisplay" id="b26fb9e3b5f0bc37" memberName="algoDisplay"
virtualName="" explicitFocusOrder="0" pos="408 8 152 74" class="AlgoDisplay"
params=""/>
<SLIDER name="pitchRate2" id="73f386b3c91d3de4" memberName="pitchRate2"
virtualName="" explicitFocusOrder="0" pos="776 64 32 24" min="0"
max="99" int="1" style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1"
@ -514,10 +507,6 @@ BEGIN_JUCER_METADATA
virtualName="" explicitFocusOrder="0" pos="752 40 32 24" min="0"
max="99" int="1" style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="feedback" id="4fac1940c29ab8c" memberName="feedback" virtualName=""
explicitFocusOrder="0" pos="568 56 24 24" min="0" max="7" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="transpose" id="7d1266b1c1534947" memberName="transpose"
virtualName="" explicitFocusOrder="0" pos="728 0 24 56" min="0"
max="49" int="0" style="LinearVertical" textBoxPos="NoTextBox"
@ -535,6 +524,17 @@ BEGIN_JUCER_METADATA
<GENERICCOMPONENT name="pitchEnvDisplay" id="9ddaae8ef924a038" memberName="pitchEnvDisplay"
virtualName="" explicitFocusOrder="0" pos="752 8 96 32" class="PitchEnvDisplay"
params=""/>
<GENERICCOMPONENT name="algoDisplay" id="b26fb9e3b5f0bc37" memberName="algoDisplay"
virtualName="" explicitFocusOrder="0" pos="442 8 152 74" class="AlgoDisplay"
params=""/>
<SLIDER name="feedback" id="4fac1940c29ab8c" memberName="feedback" virtualName=""
explicitFocusOrder="0" pos="568 32 24 24" min="0" max="7" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="algo" id="8a226ddf9bbff752" memberName="algo" virtualName=""
explicitFocusOrder="0" pos="568 8 24 24" min="1" max="32" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="0" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
</JUCER_COMPONENT>
END_JUCER_METADATA

@ -37,8 +37,8 @@
//[/Comments]
*/
class GlobalEditor : public Component,
public SliderListener,
public ComboBoxListener
public ComboBoxListener,
public SliderListener
{
public:
//==============================================================================
@ -58,8 +58,8 @@ public:
void paint (Graphics& g);
void resized();
void sliderValueChanged (Slider* sliderThatWasMoved);
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
void sliderValueChanged (Slider* sliderThatWasMoved);
@ -69,7 +69,6 @@ private:
//[/UserVariables]
//==============================================================================
ScopedPointer<Slider> algo;
ScopedPointer<ComboBox> lfoType;
ScopedPointer<Slider> lfoSpeed;
ScopedPointer<Slider> lfoAmDepth;
@ -77,7 +76,6 @@ private:
ScopedPointer<Slider> lfoDelay;
ScopedPointer<Slider> cutoff;
ScopedPointer<Slider> reso;
ScopedPointer<AlgoDisplay> algoDisplay;
ScopedPointer<Slider> pitchRate2;
ScopedPointer<Slider> pitchRate3;
ScopedPointer<Slider> pitchRate4;
@ -86,12 +84,14 @@ private:
ScopedPointer<Slider> pitchLevel3;
ScopedPointer<Slider> pitchLevel4;
ScopedPointer<Slider> pitchLevel1;
ScopedPointer<Slider> feedback;
ScopedPointer<Slider> transpose;
ScopedPointer<ToggleButton> oscSync;
ScopedPointer<Slider> pitchModSens;
ScopedPointer<ToggleButton> lfoSync;
ScopedPointer<PitchEnvDisplay> pitchEnvDisplay;
ScopedPointer<AlgoDisplay> algoDisplay;
ScopedPointer<Slider> feedback;
ScopedPointer<Slider> algo;
//==============================================================================

@ -32,7 +32,6 @@ uint8_t sysexChecksum(const char *sysex) {
return ((1 << 8) - sum);
}
void extractProgramNames(const char *block, StringArray &dest) {
char programName[11];
@ -66,35 +65,65 @@ void extractProgramNames(const char *block, StringArray &dest) {
}
}
int DexedAudioProcessor::importSysex(const char *imported) {
memcpy(sysex, imported + 6, 4096);
uint8_t checksum = sysexChecksum(sysex);
extractProgramNames(sysex, programNames);
if ( checksum != imported[4102] ) {
TRACE("sysex import checksum doesnt match");
return 1;
}
return 0;
}
void DexedAudioProcessor::exportSysex(char *dest) {
void exportSysex(char *dest, char *src) {
uint8_t header[] = { 0xF0, 0x43, 0x00, 0x09, 0x20, 0x00 };
memcpy(dest, header, 6);
// copy 32 voices
memcpy(dest+6, sysex, 4096);
memcpy(dest+6, src, 4096);
// make checksum for dump
uint8_t footer[] = { sysexChecksum(sysex), 0xF7 };
uint8_t footer[] = { sysexChecksum(src), 0xF7 };
memcpy(dest+4102, footer, 2);
}
/**
* This function normalize data that comes from corrupted sysex data.
* Pack a program into a 32 packed sysex
*/
void packProgram(uint8_t *dest, uint8_t *src, int idx, String name) {
uint8_t *bulk = dest + (idx * 128);
for(int op = 0; op < 6; op++) {
// eg rate and level, brk pt, depth, scaling
memcpy(bulk + op * 17, src + op * 21, 11);
int pp = op*17;
int up = op*21;
// left curves
bulk[pp+11] = (src[up+11]&0x03) | ((src[up+12]&0x03) << 2);
bulk[pp+12] = (src[up+13]&0x07) | ((src[up+20]&0x0f) << 3);
// kvs_ams
bulk[pp+13] = (src[up+14]&0x03) | ((src[up+15]&0x07) << 2);
// output lvl
bulk[pp+14] = src[up+16];
// fcoarse_mode
bulk[pp+15] = (src[up+17]&0x01) | ((src[up+18]&0x1f) << 1);
// fine freq
bulk[pp+16] = src[up+19];
}
memcpy(bulk + 102, src + 126, 9); // pitch env, algo
bulk[111] = (src[135]&0x07) | ((src[136]&0x01) << 3);
memcpy(bulk + 112, src + 137, 4); // lfo
bulk[116] = (src[141]&0x01) | (((src[142]&0x07) << 1) | ((src[143]&0x07) << 4));
bulk[117] = src[144];
int eos = 0;
for(int i=0; i < 10; i++) {
char c = name[i];
if ( c == 0 )
eos = 1;
if ( eos ) {
bulk[117+i] = ' ';
continue;
}
c = c < 32 ? ' ' : c;
c = c > 127 ? ' ' : c;
bulk[117+i] = c;
}
}
/**
* This function normalize data that comes from corrupted sysex.
* It used to avoid engine crashing upon extrem values
*/
char normparm(char value, char max) {
@ -112,6 +141,11 @@ void DexedAudioProcessor::unpackProgram(int idx) {
for (int op = 0; op < 6; op++) {
// eg rate and level, brk pt, depth, scaling
for(int i=0; i<11; i++) {
data[op * 21 + i] = normparm(bulk[op * 17 + i], 99);
}
memcpy(data + op * 21, bulk + op * 17, 11);
char leftrightcurves = bulk[op * 17 + 11];
data[op * 21 + 11] = leftrightcurves & 3;
@ -128,7 +162,12 @@ void DexedAudioProcessor::unpackProgram(int idx) {
data[op * 21 + 19] = bulk[op * 17 + 16]; // fine freq
data[op * 21 + 20] = detune_rs >> 3;
}
memcpy(data + 126, bulk + 102, 9); // pitch env, algo
for (int i=0; i<8; i++) {
data[126+i] = normparm(bulk[102+i], 99);
}
data[134] = normparm(bulk[110], 31);
char oks_fb = bulk[111];
data[135] = oks_fb & 7;
data[136] = oks_fb >> 3;
@ -146,69 +185,29 @@ void DexedAudioProcessor::unpackProgram(int idx) {
data[160] = 1;
}
void DexedAudioProcessor::packProgram(int idx, const char *name) {
char *bulk = sysex + (idx * 128);
int DexedAudioProcessor::importSysex(const char *imported) {
memcpy(sysex, imported + 6, 4096);
for(int op = 0; op < 6; op++) {
// eg rate and level, brk pt, depth, scaling
memcpy(bulk + op * 17, data + op * 21, 11);
int pp = op*17;
int up = op*21;
uint8_t checksum = sysexChecksum(((char *) &sysex));
extractProgramNames(sysex, programNames);
// left curves
bulk[pp+11] = (data[up+11]&0x03) | ((data[up+12]&0x03) << 2);
bulk[pp+12] = (data[up+13]&0x07) | ((data[up+20]&0x0f) << 3);
// kvs_ams
bulk[pp+13] = (data[up+14]&0x03) | ((data[up+15]&0x07) << 2);
// output lvl
bulk[pp+14] = data[up+16];
// fcoarse_mode
bulk[pp+15] = (data[up+17]&0x01) | ((data[up+18]&0x1f) << 1);
// fine freq
bulk[pp+16] = data[up+19];
}
memcpy(bulk + 102, data + 126, 9); // pitch env, algo
bulk[111] = (data[135]&0x07) | ((data[136]&0x01) << 3);
memcpy(bulk + 112, data + 137, 4); // lfo
bulk[116] = (data[141]&0x01) | (((data[142]&0x07) << 1) | ((data[143]&0x07) << 4));
bulk[117] = data[144];
int eos = 0;
for(int i=0; i < 10; i++) {
char c = name[i];
if ( c == 0 )
eos = 1;
if ( eos ) {
bulk[117+i] = ' ';
continue;
}
c = c < 32 ? ' ' : c;
c = c > 127 ? ' ' : c;
bulk[117+i] = c;
if ( checksum != imported[4102] ) {
TRACE("sysex import checksum doesnt match");
return 1;
}
char programName[11];
memcpy(programName, bulk+117, 10);
programName[10] = 0;
programNames.set(idx, String(programName));
return 0;
}
void DexedAudioProcessor::updateProgramFromSysex(const uint8 *rawdata) {
memcpy(data, rawdata, 160);
triggerAsyncUpdate();
}
void DexedAudioProcessor::loadBuiltin(int idx) {
InputStream *is = builtin_pgm->createStreamForEntry(idx);
if ( is == NULL ) {
TRACE("ENTRY IN ZIP NOT FOUND");
return;
}
uint8_t syx_data[4104];
is->read(&syx_data, 4104);
delete is;
char syx_data[4104];
cartManager.getSysex(idx, (char *) &syx_data);
importSysex((char *) &syx_data);
}
@ -234,7 +233,7 @@ void DexedAudioProcessor::getStateInformation(MemoryBlock& destData) {
state.version = CURRENT_PLUGINSTATE_VERSION;
exportSysex((char *)(&state.sysex));
exportSysex((char *)(&state.sysex), (char *) sysex);
memcpy(state.program, data, 161);
state.cutoff = fx.uiCutoff;
state.reso = fx.uiReso;
@ -291,3 +290,27 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte
memcpy((void *) data, source, sizeInBytes);
updateUI();
}*/
CartridgeManager::CartridgeManager() {
MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false);
builtin_pgm = new ZipFile(mis, true);
builtin_pgm->sortEntriesByFilename();
for(int i=0;i<builtin_pgm->getNumEntries();i++) {
const ZipFile::ZipEntry *e = builtin_pgm->getEntry(i);
cartNames.add(e->filename.dropLastCharacters(4));
}
}
void CartridgeManager::getSysex(int idx, char *dest) {
InputStream *is = builtin_pgm->createStreamForEntry(idx);
if ( is == NULL ) {
TRACE("ENTRY IN ZIP NOT FOUND");
return;
}
is->read(dest, 4104);
delete is;
}

@ -22,6 +22,52 @@
#define PLUGINDATA_H_INCLUDED
#include "../JuceLibraryCode/JuceHeader.h"
#define SYSEX_SIZE 4104
enum UpackedOffset {
egRate,
egLevel = 4,
breakpoint = 8,
lScaleDepth,
rScaleDepth,
lKeyScale,
rKeyScale,
rateScaling,
keyVelocity,
outputLevel,
mode,
fCoarse,
fFine,
oscDetune,
// Global values
pitchEgRate = 126,
pitchEgLevel = 130,
algorythm = 134,
feedback,
oscKeySync,
lfoSpeed,
lfoDelay,
lfoPmDepth,
lfoAmDepth,
lfoKeySync,
lfoWave,
middleC,
pModeSens
};
void extractProgramNames(const char *block, StringArray &dest);
void exportSysex(char *dest, char *src);
void packProgram(uint8_t *dest, uint8_t *src, int idx, String name);
class CartridgeManager {
ScopedPointer<ZipFile> builtin_pgm;
public:
StringArray cartNames;
CartridgeManager();
void getSysex(int idx, char *data);
};
#endif // PLUGINDATA_H_INCLUDED

@ -31,40 +31,43 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
: AudioProcessorEditor (ownerFilter),
midiKeyboard (ownerFilter->keyboardState, MidiKeyboardComponent::horizontalKeyboard)
{
LookAndFeel::setDefaultLookAndFeel(&dx_lnf);
setSize (865, 420);
processor = ownerFilter;
addAndMakeVisible (cartButton = new TextButton("CART"));
cartButton->setButtonText ("CART");
cartButton->addListener (this);
cartButton->setBounds(5, 5, 50, 18);
addAndMakeVisible(&cartridges);
cartridges.setEditableText(false);
cartridges.setJustificationType(Justification::centredLeft);
cartridges.setTextWhenNothingSelected(String::empty);
cartridges.setBounds(5, 5, 160, 18);
cartridges.addItemList(processor->cartManager.cartNames, 1);
cartridges.setSelectedItemIndex(0);
cartridges.addListener(this);
addAndMakeVisible (loadButton = new TextButton("LOAD"));
loadButton->setButtonText ("LOAD");
loadButton->addListener (this);
loadButton->setBounds(57, 5, 50, 18);
loadButton->setBounds(169, 5, 50, 18);
addAndMakeVisible(saveButton = new TextButton("SAVE"));
saveButton->setButtonText ("SAVE");
saveButton->addListener (this);
saveButton->setBounds (109, 5, 50, 18);
saveButton->setBounds (222, 5, 50, 18);
addAndMakeVisible (&presets);
presets.setEditableText (false);
presets.setJustificationType (Justification::centredLeft);
presets.setTextWhenNothingSelected (String::empty);
presets.setBounds(163, 5, 180, 18);
rebuildPresetCombobox();
presets.addListener(this);
addAndMakeVisible (&programs);
programs.setEditableText (false);
programs.setJustificationType (Justification::centredLeft);
programs.setTextWhenNothingSelected (String::empty);
programs.setBounds(276, 5, 160, 18);
rebuildProgramCombobox();
programs.addListener(this);
addAndMakeVisible(storeButton = new TextButton("STORE"));
storeButton->setButtonText ("STORE");
storeButton->addListener (this);
storeButton->setBounds (347, 5, 50, 18);
storeButton->setBounds (439, 5, 50, 18);
addAndMakeVisible(aboutButton = new TextButton("ABOUT"));
aboutButton->setButtonText ("ABOUT");
@ -147,8 +150,8 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
fp_in.close();
processor->importSysex((char *) &syx_data);
processor->setCurrentProgram(0);
rebuildPresetCombobox();
presets.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
rebuildProgramCombobox();
programs.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
processor->updateHostDisplay();
}
@ -159,9 +162,9 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
FileChooser fc ("Export DX sysex...", File::nonexistent, "*.syx", 1);
if ( fc.browseForFileToSave(true) ) {
String f = fc.getResults().getReference(0).getFullPathName();
uint8_t syx_data[4104];
char syx_data[4104];
processor->exportSysex((char *) syx_data);
exportSysex((char *) syx_data, (char *) &processor->sysex);
ofstream fp_out(f.toRawUTF8(), ios::binary);
fp_out.write((char *)syx_data, 4104);
@ -178,59 +181,21 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
}
if (buttonThatWasClicked == storeButton) {
AlertWindow dialog(String("Store Program"), "", AlertWindow::NoIcon, this);
dialog.addTextEditor(String("Name"), processor->getProgramName(processor->getCurrentProgram()), String("Name"), false);
StringArray programs;
for(int i=0;i<32;i++) {
programs.add(presets.getItemText(i));
}
dialog.addComboBox(String("Dest"), programs);
dialog.addButton("OK", 0, KeyPress(KeyPress::returnKey));
dialog.addButton("Cancel", 1, KeyPress(KeyPress::escapeKey));
if ( dialog.runModalLoop() == 0 ) {
TextEditor *name = dialog.getTextEditor(String("Name"));
ComboBox *dest = dialog.getComboBoxComponent(String("Dest"));
int programNum = dest->getSelectedItemIndex();
const char *programName = name->getText().toRawUTF8();
processor->packProgram(programNum, programName);
rebuildPresetCombobox();
processor->setCurrentProgram(programNum);
processor->updateHostDisplay();
}
storeProgram();
return;
}
/*
if (buttonThatWasClicked == cartButton) {
StringArray cart;
for(int i=0;i<processor->builtin_pgm->getNumEntries();i++) {
const ZipFile::ZipEntry *e = processor->builtin_pgm->getEntry(i);
cart.add(e->filename.dropLastCharacters(4));
}
AlertWindow dialog(String("Builtin cartridges"), "", AlertWindow::NoIcon, this);
dialog.addComboBox(String("cart"), cart);
dialog.addComboBox(String("cart"), processor->cartManager.cartNames);
dialog.addButton("OK", 0, KeyPress(KeyPress::returnKey));
dialog.addButton("Cancel", 1, KeyPress(KeyPress::escapeKey));
if ( dialog.runModalLoop() == 0 ) {
ComboBox *select = dialog.getComboBoxComponent(String("cart"));
int idx = select->getSelectedItemIndex();
processor->loadBuiltin(idx);
processor->setCurrentProgram(0);
rebuildPresetCombobox();
presets.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
processor->updateHostDisplay();
}
return;
}
*/
if (buttonThatWasClicked == aboutButton) {
AlertWindow::showMessageBoxAsync(AlertWindow::NoIcon, "DEXED - DX Emulator 0.3", "https://github.com/asb2m10/dexed\n"
"(c) 2013-2014 Pascal Gauthier\nUnder the GPL v2\n\n"
@ -242,19 +207,22 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
}
void DexedAudioProcessorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged) {
processor->setCurrentProgram(comboBoxThatHasChanged->getSelectedId()-1);
if ( comboBoxThatHasChanged == &programs ) {
processor->setCurrentProgram(programs.getSelectedId()-1);
processor->updateHostDisplay();
} else {
int idx = comboBoxThatHasChanged->getSelectedItemIndex();
processor->loadBuiltin(idx);
processor->setCurrentProgram(0);
rebuildProgramCombobox();
programs.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
processor->updateHostDisplay();
}
}
void DexedAudioProcessorEditor::timerCallback() {
int32_t env[6];
if ( processor->refreshUI ) {
if ( processor->refreshUI & DexedAudioProcessor::REFRESH_MSG )
global.repaint();
processor->refreshUI = 0;
}
if ( processor->peekEnvStatus(env) == false )
return;
@ -272,18 +240,96 @@ void DexedAudioProcessorEditor::updateUI() {
}
int id = processor->getCurrentProgram() + 1;
presets.setSelectedId(id, NotificationType::dontSendNotification);
programs.setSelectedId(id, NotificationType::dontSendNotification);
global.updateDisplay();
}
void DexedAudioProcessorEditor::rebuildPresetCombobox() {
presets.clear(NotificationType::dontSendNotification);
void DexedAudioProcessorEditor::rebuildProgramCombobox() {
programs.clear(NotificationType::dontSendNotification);
for(int i=0;i<processor->getNumPrograms();i++) {
String id;
id << (i+1) << ". " << processor->getProgramName(i);
presets.addItem(id, i+1);
programs.addItem(id, i+1);
}
presets.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
programs.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
}
void DexedAudioProcessorEditor::storeProgram() {
String currentName(processor->getProgramName(processor->getCurrentProgram()));
char destSysex[4096];
File *externalFile = NULL;
memcpy(&destSysex, processor->sysex, 4096);
while (true) {
String msg;
if ( externalFile == NULL ) {
msg = "Store program to current cartridge";
} else {
msg = "Store program to " + externalFile->getFileName();
}
AlertWindow dialog(String("Store Program"), msg, AlertWindow::NoIcon, this);
dialog.addTextEditor(String("Name"), currentName, String("Name"), false);
// TODO: fix the name length to 10
StringArray programs;
extractProgramNames((char *) &destSysex, programs);
dialog.addComboBox(String("Dest"), programs);
dialog.addButton("OK", 0, KeyPress(KeyPress::returnKey));
dialog.addButton("Cancel", 1, KeyPress(KeyPress::escapeKey));
dialog.addButton("External File", 2, KeyPress());
int response = dialog.runModalLoop();
if ( response == 2 ) {
FileChooser fc("Destination Sysex", File::nonexistent, "*.syx;*.SYX;*.*", 1);
if ( fc.browseForFileToOpen() ) {
if ( externalFile != NULL )
delete externalFile;
MemoryBlock block;
externalFile = new File(fc.getResults().getReference(0));
if ( externalFile->loadFileAsData(block) ) {
block.copyTo(destSysex, 6, 4096);
continue;
}
AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Read error", "Unable to read file");
}
}
if ( response == 0 ) {
TextEditor *name = dialog.getTextEditor(String("Name"));
ComboBox *dest = dialog.getComboBoxComponent(String("Dest"));
int programNum = dest->getSelectedItemIndex();
String programName = name->getText();
if ( programName.length() > 10 ) {
int toStrip = programName.length() - 10;
programName.dropLastCharacters(toStrip);
}
if ( externalFile == NULL ) {
packProgram((uint8_t *) processor->sysex, (uint8_t *) processor->data, programNum, programName);
processor->programNames.set(programNum, programName);
rebuildProgramCombobox();
processor->setCurrentProgram(programNum);
processor->updateHostDisplay();
} else {
packProgram((uint8_t *) &destSysex, (uint8_t *) processor->data, programNum, programName);
char sysexFile[4104];
exportSysex((char *) &sysexFile, (char *) &destSysex);
if ( ! externalFile->replaceWithData(sysexFile, 4104) ) {
AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Write error", "Unable to write file");
}
}
}
break;
}
if ( externalFile != NULL )
delete externalFile;
}

@ -35,15 +35,19 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor,
public ComboBoxListener,
public Timer {
DexedAudioProcessor *processor;
ComboBox presets;
ComboBox programs;
ComboBox cartridges;
MidiKeyboardComponent midiKeyboard;
DXLookNFeel dx_lnf;
ScopedPointer<TextButton> cartButton;
ScopedPointer<TextButton> loadButton;
ScopedPointer<TextButton> saveButton;
ScopedPointer<TextButton> storeButton;
ScopedPointer<TextButton> aboutButton;
ScopedPointer<TextButton> settings;
void storeProgram();
public:
@ -57,11 +61,12 @@ public:
void paint (Graphics& g);
void buttonClicked (Button* buttonThatWasClicked);
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
OperatorEditor operators[6];
GlobalEditor global;
void updateUI();
void rebuildPresetCombobox();
void rebuildProgramCombobox();
};

@ -205,12 +205,7 @@ void CtrlDX::updateComponent() {
*
*/
void DexedAudioProcessor::initCtrl() {
MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false);
builtin_pgm = new ZipFile(mis, true);
builtin_pgm->sortEntriesByFilename();
loadBuiltin(0);
currentProgram = 0;
fxCutoff = new CtrlFloat("Cutoff", &fx.uiCutoff);

@ -28,6 +28,7 @@
#include "msfa/lfo.h"
#include "msfa/synth.h"
#include "PluginParam.h"
#include "PluginData.h"
#include "PluginFx.h"
struct ProcessorVoice {
@ -61,8 +62,6 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater
SInt16 *workBlock;
int workBlockSize;
int currentProgram;
char sysex[4096];
StringArray programNames;
/**
* The last time the state was save, to be able to bypass a VST host bug.
@ -99,12 +98,12 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater
void initCtrl();
public :
static const int REFRESH_MSG = 1;
int refreshUI;
StringArray programNames;
char sysex[4096];
char data[161];
ScopedPointer<ZipFile> builtin_pgm;
CartridgeManager cartManager;
Array<Ctrl*> ctrl;
OperatorCtrl opCtrl[6];
@ -126,7 +125,6 @@ public :
ScopedPointer<CtrlFloat> fxReso;
int importSysex(const char *imported);
void exportSysex(char *dest);
void setDxValue(int offset, int v);
//==============================================================================

Loading…
Cancel
Save