├── .appveyor.yml ├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── CMakeSettings.json ├── ConvertTheFuck ├── App.config ├── CMakeLists.txt ├── ConvertTheFuck.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── Data ├── background.png ├── data.rc ├── knob1.png ├── optionmenu-pressed.png ├── optionmenu-unpressed.png ├── resource.h └── tinybutton.png ├── Docs ├── Composition.md ├── DAW-Support.md ├── Devices.md ├── Home.md └── Serialized-song-format.md ├── LICENSE ├── MSVCRT ├── CMakeLists.txt ├── mainCRTStartup.c └── msvcrt.def ├── Media └── logo-black.png ├── ProjectManager ├── App.config ├── CMakeLists.txt ├── Program.cs ├── ProjectDetails.Designer.cs ├── ProjectDetails.cs ├── ProjectDetails.resx ├── ProjectManager.Designer.cs ├── ProjectManager.cs ├── ProjectManager.csproj ├── ProjectManager.resx ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── logicoma_basic_CoA_icon.ico ├── README.md ├── Tests ├── PlayerTest │ ├── CMakeLists.txt │ ├── Song.h │ └── main.cpp └── WaveSabreConvertTests │ ├── App.config │ ├── CMakeLists.txt │ ├── Diff.cs │ ├── Printer.cs │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Refs │ ├── Arps9.als.ref │ ├── Arps9_compoedit.als.ref │ ├── Arps9_looppoints.als.ref │ ├── Backscatter.als.ref │ ├── Bare Faced Cheek.als.ref │ ├── Effects Automation Test.xrns.ref │ ├── Effects Muted Send Test.xrns.ref │ ├── Effects Send Test.xrns.ref │ ├── Elysian.als.ref │ ├── Engage.als.ref │ ├── FLSingle.flp.ref │ ├── Global Groove.xrns.ref │ ├── Group Test.xrns.ref │ ├── GroupTest.als.ref │ ├── GroupTest2.als.ref │ ├── Instrument Automation Test.xrns.ref │ ├── Migraine.als.ref │ ├── Nested Group Test.xrns.ref │ ├── Punqtured's Tune.xrns.ref │ ├── Renoise 2.8 File.xrns.ref │ ├── Reverence.als.ref │ ├── SabreWulf 02.als.ref │ ├── SabreWulf 03.als.ref │ ├── SabreWulf 04.als.ref │ ├── SabreWulf 05.als.ref │ ├── SabreWulf 06.als.ref │ ├── SabreWulf 07.als.ref │ ├── SabreWulf 08.als.ref │ ├── SabreWulf 08_cputest.als.ref │ ├── SabreWulf 09.als.ref │ ├── SabreWulf 09_cputest.als.ref │ ├── SabreWulf 09_cputest2.als.ref │ ├── SabreWulf 10.als.ref │ ├── SabreWulf 11.als.ref │ ├── SabreWulf 12.als.ref │ ├── SabreWulf 13.als.ref │ ├── SabreWulf 14.als.ref │ ├── SabreWulf 15.als.ref │ ├── SabreWulf 16.als.ref │ ├── SabreWulf 17.als.ref │ ├── SabreWulf 18.als.ref │ ├── SabreWulf 19.als.ref │ ├── SabreWulf 20.als.ref │ ├── SabreWulf 21.als.ref │ ├── SabreWulf.als.ref │ ├── SideChainTest.flp.ref │ ├── SomeNotesAndAutoTests.flp.ref │ ├── SpecimenTest.xrns.ref │ ├── almostblanktest01.als.ref │ ├── almostblanktest02.als.ref │ ├── eladamri-Try_Stopping_abl11_triplet_issue.als.ref │ └── nhersierhtest01.als.ref │ ├── Test.cs │ ├── Tests │ ├── Arps9.als │ ├── Arps9_compoedit.als │ ├── Arps9_looppoints.als │ ├── Backscatter.als │ ├── Bare Faced Cheek.als │ ├── Effects Automation Test.xrns │ ├── Effects Muted Send Test.xrns │ ├── Effects Send Test.xrns │ ├── Elysian.als │ ├── Engage.als │ ├── FLSingle.flp │ ├── Global Groove.xrns │ ├── Group Test.xrns │ ├── GroupTest.als │ ├── GroupTest2.als │ ├── Instrument Automation Test.xrns │ ├── Migraine.als │ ├── Nested Group Test.xrns │ ├── Punqtured's Tune.xrns │ ├── Renoise 2.8 File.xrns │ ├── Reverence.als │ ├── SabreWulf 02.als │ ├── SabreWulf 03.als │ ├── SabreWulf 04.als │ ├── SabreWulf 05.als │ ├── SabreWulf 06.als │ ├── SabreWulf 07.als │ ├── SabreWulf 08.als │ ├── SabreWulf 08_cputest.als │ ├── SabreWulf 09.als │ ├── SabreWulf 09_cputest.als │ ├── SabreWulf 09_cputest2.als │ ├── SabreWulf 10.als │ ├── SabreWulf 11.als │ ├── SabreWulf 12.als │ ├── SabreWulf 13.als │ ├── SabreWulf 14.als │ ├── SabreWulf 15.als │ ├── SabreWulf 16.als │ ├── SabreWulf 17.als │ ├── SabreWulf 18.als │ ├── SabreWulf 19.als │ ├── SabreWulf 20.als │ ├── SabreWulf 21.als │ ├── SabreWulf.als │ ├── SideChainTest.flp │ ├── SomeNotesAndAutoTests.flp │ ├── SpecimenTest.xrns │ ├── almostblanktest01.als │ ├── almostblanktest02.als │ ├── eladamri-Try_Stopping_abl11_triplet_issue.als │ └── nhersierhtest01.als │ ├── WaveSabreConvertTests.csproj │ └── packages.config ├── Vst3.x └── README ├── Vsts ├── Adultery │ ├── AdulteryEditor.cpp │ ├── AdulteryEditor.h │ ├── AdulteryVst.cpp │ └── AdulteryVst.h ├── CMakeLists.txt ├── Cathedral │ ├── CathedralEditor.cpp │ ├── CathedralEditor.h │ ├── CathedralVst.cpp │ └── CathedralVst.h ├── Chamber │ ├── ChamberEditor.cpp │ ├── ChamberEditor.h │ ├── ChamberVst.cpp │ └── ChamberVst.h ├── Crusher │ ├── CrusherEditor.cpp │ ├── CrusherEditor.h │ ├── CrusherVst.cpp │ └── CrusherVst.h ├── Echo │ ├── EchoEditor.cpp │ ├── EchoEditor.h │ ├── EchoVst.cpp │ └── EchoVst.h ├── Falcon │ ├── FalconEditor.cpp │ ├── FalconEditor.h │ ├── FalconVst.cpp │ └── FalconVst.h ├── Leveller │ ├── LevellerEditor.cpp │ ├── LevellerEditor.h │ ├── LevellerVst.cpp │ └── LevellerVst.h ├── Scissor │ ├── ScissorEditor.cpp │ ├── ScissorEditor.h │ ├── ScissorVst.cpp │ └── ScissorVst.h ├── Slaughter │ ├── SlaughterEditor.cpp │ ├── SlaughterEditor.h │ ├── SlaughterVst.cpp │ └── SlaughterVst.h ├── Smasher │ ├── SmasherEditor.cpp │ ├── SmasherEditor.h │ ├── SmasherVst.cpp │ └── SmasherVst.h ├── Specimen │ ├── SpecimenEditor.cpp │ ├── SpecimenEditor.h │ ├── SpecimenVst.cpp │ └── SpecimenVst.h ├── Thunder │ ├── ThunderEditor.cpp │ ├── ThunderEditor.h │ ├── ThunderVst.cpp │ └── ThunderVst.h └── Twister │ ├── TwisterEditor.cpp │ ├── TwisterEditor.h │ ├── TwisterVst.cpp │ └── TwisterVst.h ├── WaveSabreConvert ├── CMakeLists.txt ├── FLConverter.cs ├── FLParser │ ├── LICENSE │ └── Monad.FLParser.dll ├── ILog.cs ├── LiveConverter.cs ├── LiveParser.cs ├── LiveProject.cs ├── MetaPlugin.cs ├── ProjectConverter.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ReaperConverter.cs ├── ReaperElements │ ├── ReaperElement.cs │ ├── ReaperProject.cs │ ├── ReaperTag.cs │ └── ReaperTrack.cs ├── ReaperParser.cs ├── RenoiseConverter.cs ├── RenoiseInject.cs ├── RenoiseParser.cs ├── RenoiseSchema │ ├── Readme.txt │ └── RenoiseSong63.xsd ├── RenoiseSong63.cs ├── Resources │ ├── Song.xml │ └── template.xrns ├── SendItConfig.cs ├── Serializer.cs ├── Song.cs ├── Utils.cs └── WaveSabreConvert.csproj ├── WaveSabreCore ├── CMakeLists.txt ├── include │ ├── WaveSabreCore.h │ └── WaveSabreCore │ │ ├── Adultery.h │ │ ├── AllPass.h │ │ ├── AllPassDelay.h │ │ ├── BiquadFilter.h │ │ ├── Cathedral.h │ │ ├── Chamber.h │ │ ├── Comb.h │ │ ├── Crusher.h │ │ ├── DelayBuffer.h │ │ ├── Deprecated │ │ └── Thunder.h │ │ ├── Device.h │ │ ├── Devices.h │ │ ├── Echo.h │ │ ├── Envelope.h │ │ ├── Falcon.h │ │ ├── GmDls.h │ │ ├── GsmSample.h │ │ ├── Helpers.h │ │ ├── Leveller.h │ │ ├── MxcsrFlagGuard.h │ │ ├── ResampleBuffer.h │ │ ├── SamplePlayer.h │ │ ├── Scissor.h │ │ ├── Slaughter.h │ │ ├── Smasher.h │ │ ├── Specimen.h │ │ ├── StateVariableFilter.h │ │ ├── SynthDevice.h │ │ └── Twister.h └── src │ ├── Adultery.cpp │ ├── AllPass.cpp │ ├── AllPassDelay.cpp │ ├── BiquadFilter.cpp │ ├── CHANGELOG.md │ ├── Cathedral.cpp │ ├── Chamber.cpp │ ├── Comb.cpp │ ├── Crusher.cpp │ ├── DelayBuffer.cpp │ ├── Deprecated │ └── Thunder.cpp │ ├── Device.cpp │ ├── Echo.cpp │ ├── Envelope.cpp │ ├── Falcon.cpp │ ├── GmDls.cpp │ ├── GsmSample.cpp │ ├── Helpers.cpp │ ├── Leveller.cpp │ ├── MxcsrFlagGuard.cpp │ ├── ResampleBuffer.cpp │ ├── SamplePlayer.cpp │ ├── Scissor.cpp │ ├── Slaughter.cpp │ ├── Smasher.cpp │ ├── Specimen.cpp │ ├── StateVariableFilter.cpp │ ├── SynthDevice.cpp │ └── Twister.cpp ├── WaveSabrePlayerLib ├── CMakeLists.txt ├── include │ ├── WaveSabrePlayerLib.h │ └── WaveSabrePlayerLib │ │ ├── CriticalSection.h │ │ ├── DirectSoundRenderThread.h │ │ ├── IPlayer.h │ │ ├── PreRenderPlayer.h │ │ ├── RealtimePlayer.h │ │ ├── SongRenderer.h │ │ └── WavWriter.h └── src │ ├── CriticalSection.cpp │ ├── DirectSoundRenderThread.cpp │ ├── IPlayer.cpp │ ├── PreRenderPlayer.cpp │ ├── RealtimePlayer.cpp │ ├── SongRenderer.Track.cpp │ ├── SongRenderer.cpp │ └── WavWriter.cpp ├── WaveSabreStandAlonePlayer ├── CMakeLists.txt └── main.cpp └── WaveSabreVstLib ├── CMakeLists.txt ├── include ├── WaveSabreVstLib.h └── WaveSabreVstLib │ ├── Common.h │ ├── ImageManager.h │ ├── NoTextCOptionMenu.h │ ├── VstEditor.h │ └── VstPlug.h └── src ├── ImageManager.cpp ├── NoTextCOptionMenu.cpp ├── VstEditor.cpp └── VstPlug.cpp /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | image: 3 | - Visual Studio 2013 4 | - Visual Studio 2017 5 | - Visual Studio 2019 6 | 7 | platform: 8 | - Win32 9 | - x64 10 | 11 | cache: 12 | - C:\tmp\VST3 SDK 13 | 14 | install: 15 | - ps: | 16 | if (-Not (Test-Path "C:\tmp\VST3 SDK")) { 17 | Invoke-WebRequest "https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip" 18 | Expand-Archive "vstsdk.zip" "C:\tmp" 19 | } 20 | 21 | build_script: 22 | # build native code/tests 23 | - mkdir build 24 | - cd build 25 | - cmake -DCMAKE_GENERATOR_PLATFORM=%PLATFORM% -DVSTSDK3_DIR="C:/tmp/VST3 SDK" .. 26 | - msbuild /v:minimal /nologo WaveSabre.sln 27 | - msbuild /v:minimal /nologo /property:Configuration="MinSizeRel" WaveSabre.sln 28 | - cd .. 29 | 30 | test_script: 31 | - cd build 32 | - Tests\WaveSabreConvertTests\Debug\WaveSabreConvertTests.exe 33 | - cd .. 34 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.lib binary 2 | *.dll binary 3 | *.png binary 4 | *.ico binary 5 | *.xrns binary 6 | *.xsd binary 7 | *.als binary 8 | *.flp binary 9 | 10 | * text=auto 11 | 12 | *.md text 13 | *.ref text 14 | *.txt text 15 | *.h text 16 | *.cpp text 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | # Ignore OS specific and temporary files. 8 | .DS_Store 9 | Thumbs.db 10 | *.swp 11 | 12 | # Ignore user-specific Visual Studio .NET-files 13 | *.suo 14 | *.vcxproj.user 15 | *.csproj.user 16 | *.sdf 17 | *.opensdf 18 | 19 | # Ignore locally installed NuGet packages. 20 | .nuget/ 21 | packages/ 22 | 23 | # Ignore compiled and generated code. 24 | bin/ 25 | obj/ 26 | lib/ 27 | Debug/ 28 | Release/ 29 | 30 | # Misc 31 | Vsts/build/ 32 | Tests/PlayerTest/build/ 33 | build/ 34 | Vst3.x/* 35 | !Vst3.x/README 36 | Data/data.aps 37 | Vsts/*/*.def 38 | 39 | # Ignore VS 2017 IDE fluff 40 | .vs/ 41 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project("WaveSabre" LANGUAGES C CXX CSharp) 2 | 3 | # Enable C# Utilities also for the VS2013 AppVeyor stage. 4 | cmake_policy(SET CMP0057 NEW) 5 | include(CSharpUtilities) 6 | set(CMAKE_CSharp_FLAGS ${CMAKE_CSharp_FLAGS} "/langversion:6") 7 | 8 | cmake_minimum_required(VERSION 3.11) 9 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 10 | 11 | if(MSVC) 12 | # disable exceptions globally (will be added back for VSTs) 13 | string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) 14 | endif() 15 | 16 | set(BUILD_VST_PLUGINS ON CACHE BOOL "Opt out of building the VST plugins.") 17 | set(BUILD_WAVESABRE_CONVERT ON CACHE BOOL "Do not build WaveSabreConvert.") 18 | set(BUILD_WAVESABRE_CONVERT_TESTS ON CACHE BOOL "Do not build the WaveSabreConvert tests.") 19 | set(BUILD_CONVERT_THE_FUCK ON CACHE BOOL "Do not build ConvertTheFuck.") 20 | set(BUILD_PROJECT_MANAGER ON CACHE BOOL "Do not build the project manager.") 21 | set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location") 22 | 23 | # Download and unpack VST3 SDK 24 | set(DOWNLOAD_VST3SDK OFF CACHE BOOL "Download and unpack VST3 SDK automatically.") 25 | if(${BUILD_VST_PLUGINS} AND ${DOWNLOAD_VST3SDK}) 26 | find_file(VST3SDK_TEST name public.sdk HINTS ${VSTSDK3_DIR}) 27 | if(${VST3SDK_TEST} MATCHES VST3SDK_TEST-NOTFOUND) 28 | message(STATUS "VST3 SDK not found. Will download.") 29 | file(DOWNLOAD https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip vstsdk366_27_06_2016_build_61.zip SHOW_PROGRESS) 30 | file(ARCHIVE_EXTRACT INPUT vstsdk366_27_06_2016_build_61.zip DESTINATION vstsdk366_27_06_2016_build_61 VERBOSE) 31 | file(GLOB VST3SDK_FILES "${CMAKE_CURRENT_BINARY_DIR}/vstsdk366_27_06_2016_build_61/VST3\ SDK/*") 32 | file(COPY ${VST3SDK_FILES} DESTINATION ${VSTSDK3_DIR}) 33 | endif() 34 | endif() 35 | 36 | # shared code 37 | add_subdirectory(MSVCRT) 38 | add_subdirectory(WaveSabreCore) 39 | add_subdirectory(WaveSabrePlayerLib) 40 | 41 | # binaries 42 | add_subdirectory(Tests/PlayerTest) 43 | add_subdirectory(WaveSabreStandAlonePlayer) 44 | 45 | # VSTs 46 | if(${BUILD_VST_PLUGINS} AND VSTSDK3_DIR) 47 | add_subdirectory(WaveSabreVstLib) 48 | add_subdirectory(Vsts) 49 | endif() 50 | 51 | # Project file conversions 52 | if(${BUILD_WAVESABRE_CONVERT}) 53 | add_subdirectory(WaveSabreConvert) 54 | endif() 55 | if(${BUILD_WAVESABRE_CONVERT_TESTS}) 56 | add_subdirectory(Tests/WaveSabreConvertTests) 57 | endif() 58 | if(${BUILD_CONVERT_THE_FUCK}) 59 | add_subdirectory(ConvertTheFuck) 60 | endif() 61 | 62 | # Project manager 63 | if(${BUILD_PROJECT_MANAGER}) 64 | add_subdirectory(ProjectManager) 65 | endif() 66 | -------------------------------------------------------------------------------- /ConvertTheFuck/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ConvertTheFuck/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CONVERT_THE_FUCK_SOURCES 2 | Program.cs 3 | 4 | Properties/AssemblyInfo.cs 5 | ) 6 | 7 | add_executable(ConvertTheFuck 8 | App.config 9 | 10 | ${CONVERT_THE_FUCK_SOURCES} 11 | ) 12 | 13 | target_link_libraries(ConvertTheFuck WaveSabreConvert) 14 | 15 | csharp_set_designer_cs_properties(${CONVERT_THE_FUCK_SOURCES}) 16 | csharp_set_windows_forms_properties(${CONVERT_THE_FUCK_SOURCES}) 17 | set_property(TARGET ConvertTheFuck PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") 18 | set_property(TARGET ConvertTheFuck PROPERTY VS_DOTNET_REFERENCES 19 | "System" 20 | "System.Core" 21 | "System.Xml.Linq" 22 | "System.Data.DataSetExtensions" 23 | "Microsoft.CSharp" 24 | "System.Data" 25 | "System.Xml" 26 | ) 27 | set_target_properties(ConvertTheFuck PROPERTIES VS_GLOBAL_ROOTNAMESPACE ConvertTheFuck) 28 | -------------------------------------------------------------------------------- /ConvertTheFuck/ConvertTheFuck.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EFA32D77-8698-4A7F-848A-1E0357BAD979} 8 | Exe 9 | Properties 10 | ConvertTheFuck 11 | ConvertTheFuck 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {f97425c7-8471-47ad-b398-ec5f37e848fc} 54 | WaveSabreConvert 55 | 56 | 57 | 58 | 65 | -------------------------------------------------------------------------------- /ConvertTheFuck/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using WaveSabreConvert; 8 | 9 | namespace ConvertTheFuck 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | try 16 | { 17 | if (args.Length != 3) 18 | { 19 | Console.WriteLine( 20 | "usage: ConvertTheFuck [input file] [option] [output file]\n\toption:\t-h export cpp song header file\n\t\t-b export binary song file\n"); 21 | } 22 | else 23 | { 24 | var logger = new ConsoleLogger(); 25 | var song = new ProjectConverter().Convert(args[0], logger); 26 | var option = args[1]; 27 | var outFile = args[2]; 28 | 29 | switch (option) 30 | { 31 | case "-h": 32 | File.WriteAllText(outFile, new Serializer().Serialize(song)); 33 | break; 34 | case "-b": 35 | File.WriteAllBytes(outFile, new Serializer().SerializeBinary(song)); 36 | break; 37 | default: 38 | Console.WriteLine(string.Format("ERROR: unknown option {0}", args[1])); 39 | break; 40 | } 41 | } 42 | } 43 | catch (Exception e) 44 | { 45 | Console.WriteLine("ERROR: " + e.Message); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ConvertTheFuck/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConvertTheFuck")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ConvertTheFuck")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("283112d6-6c60-4f32-a833-b7981c0ec880")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Data/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Data/background.png -------------------------------------------------------------------------------- /Data/data.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // Neutral (Default) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD) 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT 20 | 21 | ///////////////////////////////////////////////////////////////////////////// 22 | // 23 | // PNG 24 | // 25 | 26 | IDB_PNG1 PNG "background.png" 27 | IDB_PNG2 PNG "knob1.png" 28 | IDB_PNG3 PNG "tinybutton.png" 29 | IDB_PNG4 PNG "optionmenu-unpressed.png" 30 | IDB_PNG5 PNG "optionmenu-pressed.png" 31 | #endif // Neutral (Default) resources 32 | ///////////////////////////////////////////////////////////////////////////// 33 | 34 | 35 | #ifndef APSTUDIO_INVOKED 36 | ///////////////////////////////////////////////////////////////////////////// 37 | // 38 | // Generated from the TEXTINCLUDE 3 resource. 39 | // 40 | 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | #endif // not APSTUDIO_INVOKED 44 | 45 | -------------------------------------------------------------------------------- /Data/knob1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Data/knob1.png -------------------------------------------------------------------------------- /Data/optionmenu-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Data/optionmenu-pressed.png -------------------------------------------------------------------------------- /Data/optionmenu-unpressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Data/optionmenu-unpressed.png -------------------------------------------------------------------------------- /Data/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by data.rc 4 | // 5 | #define IDB_PNG1 101 6 | #define IDB_PNG2 102 7 | #define IDB_PNG3 103 8 | #define IDB_PNG4 105 9 | #define IDB_PNG5 106 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NEXT_RESOURCE_VALUE 107 16 | #define _APS_NEXT_COMMAND_VALUE 40001 17 | #define _APS_NEXT_CONTROL_VALUE 1001 18 | #define _APS_NEXT_SYMED_VALUE 101 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /Data/tinybutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Data/tinybutton.png -------------------------------------------------------------------------------- /Docs/DAW-Support.md: -------------------------------------------------------------------------------- 1 | Currently supported DAW software 2 | 3 | |DAW|Platform|x86|x64| 4 | |--|--|--|--| 5 | |Ableton 9|PC|native|support via [jBridge](https://jstuff.wordpress.com/jbridge/)| 6 | |Ableton 10|PC|untested|untested| 7 | |Renoise|PC|native|to be tested| 8 | |FL Studio 12|PC|native|works with internal bridge| 9 | |FL Studio 20|PC|native|works with internal bridge| 10 | |Reaper|PC|coming soon|coming soon| 11 | |Ableton 9|MAC|no|coming soon| 12 | |Renoise|MAC|no|coming soon| 13 | -------------------------------------------------------------------------------- /Docs/Home.md: -------------------------------------------------------------------------------- 1 | # WaveSabre Wiki 2 | 3 | ## Building 4 | 5 | - WaveSabre builds have only been tested with Visual Studio 2013/2015/2017/2019 and version 3.6.6 of the VST3 SDK. 6 | - Due to licensing requirements, WaveSabre requires you to either [download](https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip) and copy the VST3 SDK into the build yourself. Download, extract, and copy into the *"Vst3.x"* folder. See [this readme](https://github.com/logicomacorp/WaveSabre/blob/master/Vst3.x/README) or download the VST3 SDK automatically using CMake (see below). 7 | 8 | ### CMake 9 | 10 | WaveSabre has a new [CMake](https://cmake.org/) based build-system that can generate Visual Studio project files for you. 11 | 12 | - Install CMake v3.11 or later 13 | - The latest installer [can be found here](https://cmake.org/download/#latestbinary) 14 | - Alternatively, you can install CMake from [Chocolatey](https://chocolatey.org/) or other package managers. 15 | - Run `cmake -B build` to generate the Visual Studio project files and solution 16 | - Optionally, you can also specify `-DVSTDIR=` to copy the VST plugins into your DAW's VST plugin directory upon build. 17 | - Optionally, you can specify `-DDOWNLOAD_VST3SDK=ON` to let CMake download and unpack the VST3 SDK for you. 18 | - You can specify `-DBUILD_VST_PLUGINS=OFF` to avoid building the plugins (useful for projects that only need the synthesizer and not the plugins). 19 | - You can also specify `-DVSTSDK3_DIR=` to use a VSTSDK from outside of the source-tree. 20 | - You can limit the tools you want to build by using `-DBUILD_WAVESABRE_CONVERT=OFF`, `-DBUILD_WAVESABRE_CONVERT_TESTS=OFF`, `-DBUILD_CONVERT_THE_FUCK=OFF` or `-DBUILD_PROJECT_MANAGER=OFF`. 21 | - As of Visual Studio 2019, `-A Win32` is required to generate a project with 32-bit targets. 22 | - Open the generated solution from the build directory, and proceed as normal. 23 | 24 | ## New Device Check List 25 | 26 | - Add device to WaveSabreCore/Devices.h 27 | - Add device to WaveSabreConvert/Song.cs 28 | - Add device to WaveSabrePlayer/include/SongRenderer.h 29 | - Add device to WaveSabreStandAlongPlayer/main.cpp 30 | - Re-run cmake to create new Vst project file 31 | - Add Build dependencies for WaveSabreCore and WaveSabrePlayer to VST Project 32 | - Profit! 33 | -------------------------------------------------------------------------------- /Docs/Serialized-song-format.md: -------------------------------------------------------------------------------- 1 | ``` 2 | int: tempo 3 | int: sample rate 4 | double: song length (seconds) 5 | int: device count 6 | list of devices: 7 | byte: device id 8 | int: chunk size 9 | byte[]: chunk data 10 | int: midi lane count 11 | list of midi lanes: 12 | int: event count 13 | list of events: 14 | int: samples from last event (or from 0 if first event) 15 | byte: msb is type (on or off) remaining 7 bits = note 16 | byte: velocity (only present if type is note on) 17 | int: track count 18 | list of tracks (in calculation order): 19 | float: track volume 20 | int: receive count (including original children) 21 | list of receives: 22 | int: sending track index 23 | int: receiving channel index 24 | float: volume 25 | int: device count 26 | list of device indexes: 27 | int: device index 28 | int: midi lane id 29 | int: automation count 30 | list of automations: 31 | int: device index 32 | int: param id 33 | int: point count 34 | list of points: 35 | int: samples from last point (or from 0 if first point) 36 | byte: quantized value (0-255) 37 | 38 | effect id's: 39 | 00: Falcon 40 | 01: Slaughter 41 | 02: Thunder 42 | 03: Scissor 43 | 04: Leveller 44 | 05: Crusher 45 | 06: Echo 46 | 07: Smasher 47 | 08: Chamber 48 | 09: Twister 49 | 10: Cathedral 50 | 11: Adultery 51 | 12: Specimen 52 | 53 | event types: 54 | 0: Note on 55 | 1: Note off 56 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012-2021 WaveSabre Team 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /MSVCRT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/msvcrt.lib 2 | MAIN_DEPENDENCY msvcrt.def 3 | COMMAND lib.exe /machine:${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} /def:${CMAKE_CURRENT_SOURCE_DIR}/msvcrt.def /out:${CMAKE_CURRENT_BINARY_DIR}/msvcrt.lib 4 | COMMENT "Creating msvcrt.lib" 5 | VERBATIM) 6 | add_custom_target(build-msvcrt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/msvcrt.lib) 7 | 8 | add_library(msvcrt_dll SHARED IMPORTED GLOBAL) 9 | set_target_properties(msvcrt_dll PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_BINARY_DIR}/msvcrt.lib) 10 | add_dependencies(msvcrt_dll build-msvcrt) 11 | 12 | add_library(msvcrt STATIC mainCRTStartup.c) 13 | target_link_libraries(msvcrt msvcrt_dll) 14 | -------------------------------------------------------------------------------- /MSVCRT/mainCRTStartup.c: -------------------------------------------------------------------------------- 1 | #if defined(_MSC_VER) 2 | int __getmainargs(int *argc, char ***argv, char ***env, int dowildcards, int *new_mode); 3 | int main(int argc, char **argv); 4 | int mainCRTStartup() 5 | { 6 | int argc; 7 | char **argv, **env; 8 | int new_mode = 0; 9 | __getmainargs(&argc, &argv, &env, 0, &new_mode); 10 | return main(argc, argv); 11 | } 12 | #endif -------------------------------------------------------------------------------- /Media/logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Media/logo-black.png -------------------------------------------------------------------------------- /ProjectManager/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ProjectManager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PROJECT_MANAGER_SOURCES 2 | Program.cs 3 | ProjectDetails.cs 4 | ProjectDetails.Designer.cs 5 | ProjectManager.cs 6 | ProjectManager.Designer.cs 7 | 8 | Properties/AssemblyInfo.cs 9 | Properties/Resources.Designer.cs 10 | Properties/Settings.Designer.cs 11 | 12 | Properties/Resources.resx 13 | Properties/Settings.settings 14 | 15 | logicoma_basic_CoA_icon.ico 16 | 17 | ProjectDetails.resx 18 | ProjectManager.resx 19 | ) 20 | 21 | add_executable(ProjectManager 22 | App.config 23 | 24 | ${PROJECT_MANAGER_SOURCES} 25 | ) 26 | 27 | target_link_libraries(ProjectManager WaveSabreConvert) 28 | 29 | set_property(TARGET ProjectManager PROPERTY VS_GLOBAL_ApplicationIcon "${CMAKE_CURRENT_SOURCE_DIR}/logicoma_basic_CoA_icon.ico") 30 | csharp_set_designer_cs_properties(${PROJECT_MANAGER_SOURCES}) 31 | csharp_set_windows_forms_properties(${PROJECT_MANAGER_SOURCES}) 32 | set_property(TARGET ProjectManager PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") 33 | set_property(TARGET ProjectManager PROPERTY VS_DOTNET_REFERENCES 34 | "System" 35 | "System.Core" 36 | "System.Xml.Linq" 37 | "System.Data.DataSetExtensions" 38 | "Microsoft.CSharp" 39 | "System.Data" 40 | "System.Xml" 41 | "System.Windows" 42 | "System.Windows.Forms" 43 | "System.Drawing" 44 | ) 45 | set_target_properties(ProjectManager PROPERTIES VS_GLOBAL_ROOTNAMESPACE ProjectManager) 46 | 47 | add_custom_command(TARGET ProjectManager POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $) 48 | -------------------------------------------------------------------------------- /ProjectManager/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace ProjectManager 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new ProjectManager()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ProjectManager/ProjectDetails.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProjectManager 2 | { 3 | partial class ProjectDetails 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.treeViewDetails = new System.Windows.Forms.TreeView(); 32 | this.SuspendLayout(); 33 | // 34 | // treeViewDetails 35 | // 36 | this.treeViewDetails.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.treeViewDetails.Location = new System.Drawing.Point(0, 0); 38 | this.treeViewDetails.Name = "treeViewDetails"; 39 | this.treeViewDetails.Size = new System.Drawing.Size(447, 413); 40 | this.treeViewDetails.TabIndex = 0; 41 | // 42 | // ProjectDetails 43 | // 44 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 45 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 46 | this.ClientSize = new System.Drawing.Size(447, 413); 47 | this.Controls.Add(this.treeViewDetails); 48 | this.Name = "ProjectDetails"; 49 | this.ShowIcon = false; 50 | this.Text = "Project Details"; 51 | this.ResumeLayout(false); 52 | 53 | } 54 | 55 | #endregion 56 | 57 | private System.Windows.Forms.TreeView treeViewDetails; 58 | } 59 | } -------------------------------------------------------------------------------- /ProjectManager/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ProjectManager")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProjectManager")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("31059c16-0ffe-41cb-ba3d-a2da559d6103")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ProjectManager/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ProjectManager.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectManager.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ProjectManager/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ProjectManager.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ProjectManager/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ProjectManager/logicoma_basic_CoA_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/ProjectManager/logicoma_basic_CoA_icon.ico -------------------------------------------------------------------------------- /Tests/PlayerTest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(PlayerTest main.cpp) 2 | target_link_libraries(PlayerTest WaveSabrePlayerLib) 3 | 4 | if(MSVC) 5 | target_link_libraries(PlayerTest $<$:msvcrt>) 6 | set_property(TARGET PlayerTest APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL 7 | " /NODEFAULTLIB /SAFESEH:NO /MANIFEST:NO /LTCG /OPT:REF /OPT:ICF /DYNAMICBASE:NO") 8 | 9 | if(MSVC_VERSION GREATER 1900) 10 | target_compile_definitions(PlayerTest PRIVATE 11 | $<$:_NO_CRT_STDIO_INLINE>) 12 | endif() 13 | endif() 14 | -------------------------------------------------------------------------------- /Tests/PlayerTest/Song.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | WaveSabreCore::Device *SongFactory(SongRenderer::DeviceId id) 5 | { 6 | switch (id) 7 | { 8 | case SongRenderer::DeviceId::Slaughter: return new WaveSabreCore::Slaughter(); 9 | } 10 | return nullptr; 11 | } 12 | 13 | const unsigned char SongBlob[] = 14 | { 15 | 0x8c, 0x00, 0x00, 0x00, 0x44, 0xac, 0x00, 0x00, 0x25, 0x49, 16 | 0x92, 0x24, 0x49, 0x92, 0x24, 0x40, 0x01, 0x00, 0x00, 0x00, 17 | 0x01, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 18 | 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 | 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x31, 0xdf, 0x7f, 0x3f, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x69, 26 | 0xb4, 0xe7, 0x3c, 0x00, 0x00, 0x00, 0x3f, 0x0a, 0xd7, 0x23, 27 | 0x3c, 0x00, 0x00, 0x00, 0x00, 0x69, 0xb4, 0xe7, 0x3c, 0x00, 28 | 0x00, 0x80, 0x3f, 0x0a, 0xd7, 0x23, 0x3c, 0x00, 0x00, 0x00, 29 | 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 32 | 0xb4, 0xe7, 0x3c, 0x00, 0x00, 0x00, 0x3f, 0x0a, 0xd7, 0x23, 33 | 0x3c, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 35 | 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 36 | 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 0x00, 37 | 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 38 | 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 39 | 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 40 | 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 41 | 0xea, 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 42 | 0xbc, 0xea, 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 43 | 0x00, 0xbc, 0xea, 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 44 | 0x00, 0x00, 0xbc, 0x8a, 0x73, 0x02, 0x00, 0x3c, 0x64, 0xea, 45 | 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 0x00, 0x3c, 0x64, 46 | 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 0x00, 0x3c, 47 | 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 0x00, 48 | 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 0x00, 49 | 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 0x24, 50 | 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 0xea, 51 | 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 0xbc, 52 | 0xea, 0x24, 0x00, 0x00, 0x3c, 0x64, 0xea, 0x24, 0x00, 0x00, 53 | 0xbc, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc5, 54 | 0x8f, 0x61, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x01, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 58 | 0x8f, 0x61, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x01, 60 | 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | }; 64 | 65 | SongRenderer::Song Song = { 66 | SongFactory, 67 | SongBlob 68 | }; 69 | -------------------------------------------------------------------------------- /Tests/PlayerTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace WaveSabrePlayerLib; 3 | 4 | #include 5 | 6 | #include "Song.h" 7 | 8 | void progressCallback(double progress, void *data) 9 | { 10 | const int barLength = 32; 11 | int filledChars = (int)(progress * (double)(barLength - 1)); 12 | printf("\r["); 13 | for (int j = 0; j < barLength; j++) putchar(filledChars >= j ? '*' : '-'); 14 | printf("]"); 15 | } 16 | 17 | int main(int argc, char **argv) 18 | { 19 | bool writeWav = argc >= 2 && !strcmp(argv[1], "-w"); 20 | bool preRender = argc == 2 && !strcmp(argv[1], "-p"); 21 | 22 | const int numRenderThreads = 3; 23 | 24 | if (writeWav) 25 | { 26 | WavWriter wavWriter(&Song, numRenderThreads); 27 | 28 | printf("WAV writer activated.\n"); 29 | 30 | auto fileName = argc >= 3 ? argv[2] : "out.wav"; 31 | printf("Rendering...\n"); 32 | wavWriter.Write(fileName, progressCallback, nullptr); 33 | 34 | printf("\n\nWAV file written to \"%s\". Enjoy.\n", fileName); 35 | } 36 | else 37 | { 38 | IPlayer *player; 39 | 40 | if (preRender) 41 | { 42 | printf("Prerender activated.\n"); 43 | printf("Rendering...\n"); 44 | 45 | player = new PreRenderPlayer(&Song, numRenderThreads, progressCallback, nullptr); 46 | 47 | printf("\n\n"); 48 | } 49 | else 50 | { 51 | player = new RealtimePlayer(&Song, numRenderThreads); 52 | } 53 | 54 | printf("Realtime player activated. Press ESC to quit.\n"); 55 | player->Play(); 56 | while (!GetAsyncKeyState(VK_ESCAPE)) 57 | { 58 | auto songPos = player->GetSongPos(); 59 | if (songPos >= player->GetLength()) break; 60 | int minutes = (int)songPos / 60; 61 | int seconds = (int)songPos % 60; 62 | int hundredths = (int)(songPos * 100.0) % 100; 63 | printf("\r %.1i:%.2i.%.2i", minutes, seconds, hundredths); 64 | 65 | Sleep(10); 66 | } 67 | printf("\n"); 68 | 69 | delete player; 70 | } 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(WAVESABRE_CONVERT_TESTS_SOURCES 2 | Diff.cs 3 | packages.config 4 | Printer.cs 5 | Program.cs 6 | Test.cs 7 | 8 | Properties/AssemblyInfo.cs 9 | ) 10 | 11 | add_executable(WaveSabreConvertTests 12 | App.config 13 | 14 | ${WAVESABRE_CONVERT_TESTS_SOURCES} 15 | ) 16 | 17 | target_link_libraries(WaveSabreConvertTests WaveSabreConvert) 18 | 19 | csharp_set_designer_cs_properties(${WAVESABRE_CONVERT_TESTS_SOURCES}) 20 | csharp_set_windows_forms_properties(${WAVESABRE_CONVERT_TESTS_SOURCES}) 21 | set_property(TARGET WaveSabreConvertTests PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") 22 | set_property(TARGET WaveSabreConvertTests PROPERTY VS_DOTNET_REFERENCES 23 | "System" 24 | "System.Core" 25 | "System.Xml.Linq" 26 | "System.Data.DataSetExtensions" 27 | "Microsoft.CSharp" 28 | "System.Data" 29 | "System.Xml" 30 | "Newtonsoft" 31 | "Newtonsoft.json" 32 | ) 33 | set_property(TARGET WaveSabreConvertTests PROPERTY VS_PACKAGE_REFERENCES "Newtonsoft.Json_6.0.8") 34 | set_target_properties(WaveSabreConvertTests PROPERTIES VS_GLOBAL_ROOTNAMESPACE WaveSabreConvertTests) 35 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Printer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WaveSabreConvertTests 4 | { 5 | class Printer 6 | { 7 | internal int Indent; 8 | 9 | public Printer() 10 | { 11 | Reset(); 12 | } 13 | 14 | public void Reset() 15 | { 16 | Indent = 0; 17 | } 18 | 19 | public PrinterScope Scope() 20 | { 21 | return new PrinterScope(this); 22 | } 23 | 24 | public void PrintLine(string line) 25 | { 26 | for (int i = 0; i < Indent; i++) 27 | line = " " + line; 28 | Console.WriteLine(line); 29 | } 30 | } 31 | 32 | class PrinterScope : IDisposable 33 | { 34 | readonly Printer _p; 35 | 36 | public PrinterScope(Printer p) 37 | { 38 | _p = p; 39 | 40 | _p.Indent++; 41 | } 42 | 43 | public void Dispose() 44 | { 45 | _p.Indent--; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | 8 | namespace WaveSabreConvertTests 9 | { 10 | class Program 11 | { 12 | static int Main(string[] args) 13 | { 14 | var testsDir = new DirectoryInfo("Tests"); 15 | var refsDir = new DirectoryInfo("Refs"); 16 | 17 | var interactive = args.Length == 1 ? args[0] == "-i" : false; 18 | 19 | bool success = true; 20 | 21 | foreach (var testFileInfo in testsDir.EnumerateFiles()) 22 | { 23 | var testFileName = testFileInfo.Name; 24 | var refFileName = testFileName + ".ref"; 25 | 26 | success |= new Test().Run(testsDir.FullName + "\\" + testFileName, refsDir.FullName + "\\" + refFileName, interactive); 27 | } 28 | 29 | return success ? 0 : 1; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WaveSabreConvertTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("WaveSabreConvertTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5d1fbc24-7023-41c9-8c20-4d0d637a34d1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Arps9.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Arps9.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Arps9_compoedit.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Arps9_compoedit.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Arps9_looppoints.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Arps9_looppoints.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Backscatter.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Backscatter.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Bare Faced Cheek.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Bare Faced Cheek.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Effects Automation Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Effects Automation Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Effects Muted Send Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Effects Muted Send Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Effects Send Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Effects Send Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Elysian.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Elysian.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Engage.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Engage.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/FLSingle.flp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/FLSingle.flp -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Global Groove.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Global Groove.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Group Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Group Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/GroupTest.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/GroupTest.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/GroupTest2.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/GroupTest2.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Instrument Automation Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Instrument Automation Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Migraine.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Migraine.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Nested Group Test.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Nested Group Test.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Punqtured's Tune.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Punqtured's Tune.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Renoise 2.8 File.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Renoise 2.8 File.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/Reverence.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/Reverence.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 02.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 02.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 03.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 03.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 04.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 04.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 05.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 05.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 06.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 06.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 07.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 07.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 08.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 08.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 08_cputest.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 08_cputest.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 09.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 09.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 09_cputest.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 09_cputest.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 09_cputest2.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 09_cputest2.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 10.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 10.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 11.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 11.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 12.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 12.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 13.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 13.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 14.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 14.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 15.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 15.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 16.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 16.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 17.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 17.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 18.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 18.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 19.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 19.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 20.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 20.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf 21.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf 21.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SabreWulf.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SabreWulf.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SideChainTest.flp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SideChainTest.flp -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SomeNotesAndAutoTests.flp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SomeNotesAndAutoTests.flp -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/SpecimenTest.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/SpecimenTest.xrns -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/almostblanktest01.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/almostblanktest01.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/almostblanktest02.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/almostblanktest02.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/eladamri-Try_Stopping_abl11_triplet_issue.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/eladamri-Try_Stopping_abl11_triplet_issue.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/Tests/nhersierhtest01.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/Tests/WaveSabreConvertTests/Tests/nhersierhtest01.als -------------------------------------------------------------------------------- /Tests/WaveSabreConvertTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Vst3.x/README: -------------------------------------------------------------------------------- 1 | You can download the last version of the VST3 SDK that includes the full VST2 2 | SDK [here][1]. 3 | 4 | Unpack the contents of the "VST3 SDK" subfolder from that archive into this 5 | folder. This means that folders like "plugininterface" and "public.sdk" should 6 | be located next to this file. 7 | 8 | [1]: https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip 9 | -------------------------------------------------------------------------------- /Vsts/Adultery/AdulteryEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADULTERYEDITOR_H__ 2 | #define __ADULTERYEDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | class AdulteryEditor : public VstEditor 11 | { 12 | public: 13 | AdulteryEditor(AudioEffect *audioEffect, Adultery *adultery); 14 | virtual ~AdulteryEditor(); 15 | 16 | virtual void Open(); 17 | 18 | virtual void setParameter(VstInt32 index, float value); 19 | 20 | private: 21 | void updateCaption(); 22 | void uncheckMenuItems(); 23 | 24 | Adultery *adultery; 25 | 26 | COptionMenu *menu; 27 | CTextLabel *caption; 28 | 29 | std::map optionNames; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Vsts/Adultery/AdulteryVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADULTERYVST_H__ 2 | #define __ADULTERYVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | 11 | class AdulteryVst : public VstPlug 12 | { 13 | public: 14 | AdulteryVst(audioMasterCallback audioMaster); 15 | 16 | virtual void getParameterName(VstInt32 index, char *text); 17 | 18 | virtual bool getEffectName(char *name); 19 | virtual bool getProductString(char *text); 20 | 21 | Adultery *GetAdultery() const; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Vsts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(VSTDIR "" CACHE PATH "VST system directory") 2 | 3 | file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*) 4 | foreach(child ${children}) 5 | if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child}) 6 | file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/${child}/*.h) 7 | aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/${child} sources) 8 | file(WRITE "${CMAKE_BINARY_DIR}/${child}.def" 9 | "LIBRARY ${child}\nEXPORTS\nVSTPluginMain\nmain=VSTPluginMain") 10 | add_library(${child} SHARED 11 | ${sources} ../Data/data.rc ${CMAKE_BINARY_DIR}/${child}.def) 12 | target_link_libraries(${child} WaveSabreCore WaveSabreVstLib) 13 | set_property(TARGET ${child} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL 14 | " /LTCG") 15 | set_property(TARGET ${child} PROPERTY FOLDER VSTs) 16 | 17 | if(VSTDIR) 18 | add_custom_command(TARGET ${child} POST_BUILD 19 | COMMAND ${CMAKE_COMMAND} -E copy $ ${VSTDIR}) 20 | endif() 21 | endif() 22 | endforeach() 23 | -------------------------------------------------------------------------------- /Vsts/Cathedral/CathedralEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "CathedralEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | CathedralEditor::CathedralEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 560, 100, "CATHEDRAL") 8 | { 9 | } 10 | 11 | CathedralEditor::~CathedralEditor() 12 | { 13 | } 14 | 15 | void CathedralEditor::Open() 16 | { 17 | addKnob((VstInt32)Cathedral::ParamIndices::Freeze, "FREEZE"); 18 | addKnob((VstInt32)Cathedral::ParamIndices::RoomSize, "ROOM SIZE"); 19 | addKnob((VstInt32)Cathedral::ParamIndices::Damp, "DAMP"); 20 | addKnob((VstInt32)Cathedral::ParamIndices::Width, "WIDTH"); 21 | addKnob((VstInt32)Cathedral::ParamIndices::PreDelay, "PRE DLY"); 22 | addSpacer(); 23 | addKnob((VstInt32)Cathedral::ParamIndices::LowCutFreq, "LC FREQ"); 24 | addKnob((VstInt32)Cathedral::ParamIndices::HighCutFreq, "HC FREQ"); 25 | addSpacer(); 26 | addKnob((VstInt32)Cathedral::ParamIndices::DryWet, "DRY/WET"); 27 | 28 | VstEditor::Open(); 29 | } 30 | -------------------------------------------------------------------------------- /Vsts/Cathedral/CathedralEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __CATHEDRALEDITOR_H__ 2 | #define __CATHEDRALEDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class CathedralEditor : public VstEditor 8 | { 9 | public: 10 | CathedralEditor(AudioEffect *audioEffect); 11 | virtual ~CathedralEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Cathedral/CathedralVst.cpp: -------------------------------------------------------------------------------- 1 | #include "CathedralVst.h" 2 | #include "CathedralEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new CathedralVst(audioMaster); 11 | } 12 | 13 | CathedralVst::CathedralVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Cathedral::ParamIndices::NumParams, 2, 2, 'Cath', new Cathedral()) 15 | { 16 | setEditor(new CathedralEditor(this)); 17 | } 18 | 19 | void CathedralVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Cathedral::ParamIndices)index) 22 | { 23 | case Cathedral::ParamIndices::Freeze: vst_strncpy(text, "Freeze", kVstMaxParamStrLen); break; 24 | case Cathedral::ParamIndices::RoomSize: vst_strncpy(text, "Roomsize", kVstMaxParamStrLen); break; 25 | case Cathedral::ParamIndices::Damp: vst_strncpy(text, "Damp", kVstMaxParamStrLen); break; 26 | case Cathedral::ParamIndices::Width: vst_strncpy(text, "Width", kVstMaxParamStrLen); break; 27 | case Cathedral::ParamIndices::LowCutFreq: vst_strncpy(text, "LC Freq", kVstMaxParamStrLen); break; 28 | case Cathedral::ParamIndices::HighCutFreq: vst_strncpy(text, "HC Freq", kVstMaxParamStrLen); break; 29 | case Cathedral::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 30 | case Cathedral::ParamIndices::PreDelay: vst_strncpy(text, "Pre Dly", kVstMaxParamStrLen); break; 31 | } 32 | } 33 | 34 | bool CathedralVst::getEffectName(char *name) 35 | { 36 | vst_strncpy(name, "WaveSabre - Cathedral", kVstMaxEffectNameLen); 37 | return true; 38 | } 39 | 40 | bool CathedralVst::getProductString(char *text) 41 | { 42 | vst_strncpy(text, "WaveSabre - Cathedral", kVstMaxProductStrLen); 43 | return true; 44 | } 45 | -------------------------------------------------------------------------------- /Vsts/Cathedral/CathedralVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __CATHEDRALVST_H__ 2 | #define __CATHEDRALVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class CathedralVst : public VstPlug 8 | { 9 | public: 10 | CathedralVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Chamber/ChamberEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "ChamberEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | ChamberEditor::ChamberEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 460, 100, "CHAMBER") 8 | { 9 | } 10 | 11 | ChamberEditor::~ChamberEditor() 12 | { 13 | } 14 | 15 | void ChamberEditor::Open() 16 | { 17 | addKnob((VstInt32)Chamber::ParamIndices::Mode, "MODE"); 18 | addSpacer(); 19 | addKnob((VstInt32)Chamber::ParamIndices::Feedback, "FEEDBACK"); 20 | addSpacer(); 21 | addKnob((VstInt32)Chamber::ParamIndices::PreDelay, "PRE DELAY"); 22 | addSpacer(); 23 | addKnob((VstInt32)Chamber::ParamIndices::LowCutFreq, "LC FREQ"); 24 | addSpacer(); 25 | addKnob((VstInt32)Chamber::ParamIndices::HighCutFreq, "HC FREQ"); 26 | addSpacer(); 27 | addKnob((VstInt32)Chamber::ParamIndices::DryWet, "DRY/WET"); 28 | 29 | VstEditor::Open(); 30 | } 31 | -------------------------------------------------------------------------------- /Vsts/Chamber/ChamberEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __CHAMBEREDITOR_H__ 2 | #define __CHAMBEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class ChamberEditor : public VstEditor 8 | { 9 | public: 10 | ChamberEditor(AudioEffect *audioEffect); 11 | virtual ~ChamberEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Chamber/ChamberVst.cpp: -------------------------------------------------------------------------------- 1 | #include "ChamberVst.h" 2 | #include "ChamberEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new ChamberVst(audioMaster); 11 | } 12 | 13 | ChamberVst::ChamberVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Chamber::ParamIndices::NumParams, 2, 2, 'Chmb', new Chamber()) 15 | { 16 | setEditor(new ChamberEditor(this)); 17 | } 18 | 19 | void ChamberVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Chamber::ParamIndices)index) 22 | { 23 | case Chamber::ParamIndices::Mode: vst_strncpy(text, "Mode", kVstMaxParamStrLen); break; 24 | case Chamber::ParamIndices::Feedback: vst_strncpy(text, "Feedback", kVstMaxParamStrLen); break; 25 | case Chamber::ParamIndices::LowCutFreq: vst_strncpy(text, "LC Freq", kVstMaxParamStrLen); break; 26 | case Chamber::ParamIndices::HighCutFreq: vst_strncpy(text, "HC Freq", kVstMaxParamStrLen); break; 27 | case Chamber::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 28 | case Chamber::ParamIndices::PreDelay: vst_strncpy(text, "Pre Dly", kVstMaxParamStrLen); break; 29 | } 30 | } 31 | 32 | bool ChamberVst::getEffectName(char *name) 33 | { 34 | vst_strncpy(name, "WaveSabre - Chamber", kVstMaxEffectNameLen); 35 | return true; 36 | } 37 | 38 | bool ChamberVst::getProductString(char *text) 39 | { 40 | vst_strncpy(text, "WaveSabre - Chamber", kVstMaxProductStrLen); 41 | return true; 42 | } 43 | -------------------------------------------------------------------------------- /Vsts/Chamber/ChamberVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __CHAMBERVST_H__ 2 | #define __CHAMBERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class ChamberVst : public VstPlug 8 | { 9 | public: 10 | ChamberVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Crusher/CrusherEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "CrusherEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | CrusherEditor::CrusherEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 250, 100, "CRUSHER") 8 | { 9 | } 10 | 11 | CrusherEditor::~CrusherEditor() 12 | { 13 | } 14 | 15 | void CrusherEditor::Open() 16 | { 17 | addKnob((VstInt32)Crusher::ParamIndices::Vertical, "VERTICAL"); 18 | addSpacer(); 19 | addKnob((VstInt32)Crusher::ParamIndices::Horizontal, "HORIZONTAL"); 20 | addSpacer(); 21 | addKnob((VstInt32)Crusher::ParamIndices::DryWet, "DRY/WET"); 22 | 23 | VstEditor::Open(); 24 | } 25 | -------------------------------------------------------------------------------- /Vsts/Crusher/CrusherEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRUSHEREDITOR_H__ 2 | #define __CRUSHEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class CrusherEditor : public VstEditor 8 | { 9 | public: 10 | CrusherEditor(AudioEffect *audioEffect); 11 | virtual ~CrusherEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Crusher/CrusherVst.cpp: -------------------------------------------------------------------------------- 1 | #include "CrusherVst.h" 2 | #include "CrusherEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new CrusherVst(audioMaster); 11 | } 12 | 13 | CrusherVst::CrusherVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Crusher::ParamIndices::NumParams, 2, 2, 'Crsh', new Crusher()) 15 | { 16 | setEditor(new CrusherEditor(this)); 17 | } 18 | 19 | void CrusherVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Crusher::ParamIndices)index) 22 | { 23 | case Crusher::ParamIndices::Vertical: vst_strncpy(text, "Vert", kVstMaxParamStrLen); break; 24 | case Crusher::ParamIndices::Horizontal: vst_strncpy(text, "Hori", kVstMaxParamStrLen); break; 25 | case Crusher::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 26 | } 27 | } 28 | 29 | bool CrusherVst::getEffectName(char *name) 30 | { 31 | vst_strncpy(name, "WaveSabre - Crusher", kVstMaxEffectNameLen); 32 | return true; 33 | } 34 | 35 | bool CrusherVst::getProductString(char *text) 36 | { 37 | vst_strncpy(text, "WaveSabre - Crusher", kVstMaxProductStrLen); 38 | return true; 39 | } 40 | -------------------------------------------------------------------------------- /Vsts/Crusher/CrusherVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRUSHERVST_H__ 2 | #define __CRUSHERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class CrusherVst : public VstPlug 8 | { 9 | public: 10 | CrusherVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Echo/EchoEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "EchoEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | EchoEditor::EchoEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 400, 160, "ECHO") 8 | { 9 | } 10 | 11 | EchoEditor::~EchoEditor() 12 | { 13 | } 14 | 15 | void EchoEditor::Open() 16 | { 17 | addKnob((VstInt32)Echo::ParamIndices::LeftDelayCoarse, "LEFT COARSE"); 18 | addSpacer(); 19 | addKnob((VstInt32)Echo::ParamIndices::LeftDelayFine, "LEFT FINE"); 20 | addSpacer(); 21 | addKnob((VstInt32)Echo::ParamIndices::Feedback, "FEEDBACK"); 22 | addSpacer(); 23 | addKnob((VstInt32)Echo::ParamIndices::Cross, "CROSS"); 24 | addSpacer(); 25 | addKnob((VstInt32)Echo::ParamIndices::DryWet, "DRY/WET"); 26 | 27 | startNextRow(); 28 | addKnob((VstInt32)Echo::ParamIndices::RightDelayCoarse, "RIGHT COARSE"); 29 | addSpacer(); 30 | addKnob((VstInt32)Echo::ParamIndices::RightDelayFine, "RIGHT FINE"); 31 | addSpacer(); 32 | addKnob((VstInt32)Echo::ParamIndices::LowCutFreq, "LC FREQ"); 33 | addSpacer(); 34 | addKnob((VstInt32)Echo::ParamIndices::HighCutFreq, "HC FREQ"); 35 | 36 | VstEditor::Open(); 37 | } 38 | -------------------------------------------------------------------------------- /Vsts/Echo/EchoEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __ECHOEDITOR_H__ 2 | #define __ECHOEDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class EchoEditor : public VstEditor 8 | { 9 | public: 10 | EchoEditor(AudioEffect *audioEffect); 11 | virtual ~EchoEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Echo/EchoVst.cpp: -------------------------------------------------------------------------------- 1 | #include "EchoVst.h" 2 | #include "EchoEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new EchoVst(audioMaster); 11 | } 12 | 13 | EchoVst::EchoVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Echo::ParamIndices::NumParams, 2, 2, 'Echo', new Echo()) 15 | { 16 | setEditor(new EchoEditor(this)); 17 | } 18 | 19 | void EchoVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Echo::ParamIndices)index) 22 | { 23 | case Echo::ParamIndices::LeftDelayCoarse: vst_strncpy(text, "LDly Crs", kVstMaxParamStrLen); break; 24 | case Echo::ParamIndices::LeftDelayFine: vst_strncpy(text, "LDly Fin", kVstMaxParamStrLen); break; 25 | case Echo::ParamIndices::RightDelayCoarse: vst_strncpy(text, "RDly Crs", kVstMaxParamStrLen); break; 26 | case Echo::ParamIndices::RightDelayFine: vst_strncpy(text, "RDly Fin", kVstMaxParamStrLen); break; 27 | case Echo::ParamIndices::LowCutFreq: vst_strncpy(text, "LC Freq", kVstMaxParamStrLen); break; 28 | case Echo::ParamIndices::HighCutFreq: vst_strncpy(text, "HC Freq", kVstMaxParamStrLen); break; 29 | case Echo::ParamIndices::Feedback: vst_strncpy(text, "Feedback", kVstMaxParamStrLen); break; 30 | case Echo::ParamIndices::Cross: vst_strncpy(text, "Cross", kVstMaxParamStrLen); break; 31 | case Echo::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 32 | } 33 | } 34 | 35 | bool EchoVst::getEffectName(char *name) 36 | { 37 | vst_strncpy(name, "WaveSabre - Echo", kVstMaxEffectNameLen); 38 | return true; 39 | } 40 | 41 | bool EchoVst::getProductString(char *text) 42 | { 43 | vst_strncpy(text, "WaveSabre - Echo", kVstMaxProductStrLen); 44 | return true; 45 | } 46 | -------------------------------------------------------------------------------- /Vsts/Echo/EchoVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __ECHOVST_H__ 2 | #define __ECHOVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class EchoVst : public VstPlug 8 | { 9 | public: 10 | EchoVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Falcon/FalconEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "FalconEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | FalconEditor::FalconEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 820, 220, "FALCON") 8 | { 9 | } 10 | 11 | FalconEditor::~FalconEditor() 12 | { 13 | } 14 | 15 | void FalconEditor::Open() 16 | { 17 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Waveform, "WAVEFORM"); 18 | addSpacer(); 19 | addKnob((VstInt32)Falcon::ParamIndices::Osc1RatioCoarse, "RATIO COARSE"); 20 | addSpacer(); 21 | addKnob((VstInt32)Falcon::ParamIndices::Osc1RatioFine, "RATIO SEMI"); 22 | addSpacer(); 23 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Feedback, "FEEDBACK"); 24 | addSpacer(); 25 | addKnob((VstInt32)Falcon::ParamIndices::Osc1FeedForward, "FEEDFORWARD"); 26 | 27 | addSpacer(); 28 | addSpacer(); 29 | addSpacer(); 30 | addSpacer(); 31 | addSpacer(); 32 | 33 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Attack, "ATTACK"); 34 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Decay, "DECAY"); 35 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Sustain, "SUSTAIN"); 36 | addKnob((VstInt32)Falcon::ParamIndices::Osc1Release, "RELEASE"); 37 | 38 | addSpacer(); 39 | addSpacer(); 40 | addSpacer(); 41 | 42 | addKnob((VstInt32)Falcon::ParamIndices::MasterLevel, "MASTER"); 43 | 44 | startNextRow(); 45 | addSpacer(); 46 | addSpacer(); 47 | 48 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Waveform, "WAVEFORM"); 49 | addSpacer(); 50 | addKnob((VstInt32)Falcon::ParamIndices::Osc2RatioCoarse, "RATIO COARSE"); 51 | addSpacer(); 52 | addKnob((VstInt32)Falcon::ParamIndices::Osc2RatioFine, "RATIO SEMI"); 53 | addSpacer(); 54 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Feedback, "FEEDBACK"); 55 | 56 | addSpacer(); 57 | addSpacer(); 58 | addSpacer(); 59 | addSpacer(); 60 | addSpacer(); 61 | addSpacer(); 62 | addSpacer(); 63 | addSpacer(); 64 | 65 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Attack, "ATTACK"); 66 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Decay, "DECAY"); 67 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Sustain, "SUSTAIN"); 68 | addKnob((VstInt32)Falcon::ParamIndices::Osc2Release, "RELEASE"); 69 | 70 | startNextRow(); 71 | 72 | addKnob((VstInt32)Falcon::ParamIndices::VoicesUnisono, "UNISONO"); 73 | addKnob((VstInt32)Falcon::ParamIndices::VoicesDetune, "DETUNE"); 74 | addKnob((VstInt32)Falcon::ParamIndices::VoicesPan, "PAN"); 75 | 76 | addKnob((VstInt32)Falcon::ParamIndices::VibratoFreq, "VIB FREQ"); 77 | addKnob((VstInt32)Falcon::ParamIndices::VibratoAmount, "VIB AMT"); 78 | 79 | addKnob((VstInt32)Falcon::ParamIndices::VoiceMode, "MODE"); 80 | addKnob((VstInt32)Falcon::ParamIndices::SlideTime, "SLIDE"); 81 | 82 | addKnob((VstInt32)Falcon::ParamIndices::Rise, "RISE"); 83 | 84 | addSpacer(); 85 | addKnob((VstInt32)Falcon::ParamIndices::PitchAttack, "P ATTACK"); 86 | addKnob((VstInt32)Falcon::ParamIndices::PitchDecay, "P DECAY"); 87 | addKnob((VstInt32)Falcon::ParamIndices::PitchSustain, "P SUSTAIN"); 88 | addKnob((VstInt32)Falcon::ParamIndices::PitchRelease, "P RELEASE"); 89 | addKnob((VstInt32)Falcon::ParamIndices::PitchEnvAmt1, "P AMT 1"); 90 | addKnob((VstInt32)Falcon::ParamIndices::PitchEnvAmt2, "P AMT 2"); 91 | 92 | VstEditor::Open(); 93 | } 94 | -------------------------------------------------------------------------------- /Vsts/Falcon/FalconEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __FALCONEDITOR_H__ 2 | #define __FALCONEDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class FalconEditor : public VstEditor 8 | { 9 | public: 10 | FalconEditor(AudioEffect *audioEffect); 11 | virtual ~FalconEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Falcon/FalconVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __FALCONVST_H__ 2 | #define __FALCONVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class FalconVst : public VstPlug 8 | { 9 | public: 10 | FalconVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Vsts/Leveller/LevellerEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "LevellerEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | LevellerEditor::LevellerEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 210, 340, "LEVELLER") 8 | { 9 | } 10 | 11 | LevellerEditor::~LevellerEditor() 12 | { 13 | } 14 | 15 | void LevellerEditor::Open() 16 | { 17 | addKnob((VstInt32)Leveller::ParamIndices::LowCutFreq, "LC FREQ"); 18 | addKnob((VstInt32)Leveller::ParamIndices::LowCutQ, "LC Q"); 19 | 20 | startNextRow(); 21 | 22 | addKnob((VstInt32)Leveller::ParamIndices::Peak1Freq, "P1 FREQ"); 23 | addKnob((VstInt32)Leveller::ParamIndices::Peak1Gain, "P1 GAIN"); 24 | addKnob((VstInt32)Leveller::ParamIndices::Peak1Q, "P1 Q"); 25 | 26 | startNextRow(); 27 | 28 | addKnob((VstInt32)Leveller::ParamIndices::Peak2Freq, "P2 FREQ"); 29 | addKnob((VstInt32)Leveller::ParamIndices::Peak2Gain, "P2 GAIN"); 30 | addKnob((VstInt32)Leveller::ParamIndices::Peak2Q, "P2 Q"); 31 | 32 | startNextRow(); 33 | 34 | addKnob((VstInt32)Leveller::ParamIndices::Peak3Freq, "P3 FREQ"); 35 | addKnob((VstInt32)Leveller::ParamIndices::Peak3Gain, "P3 GAIN"); 36 | addKnob((VstInt32)Leveller::ParamIndices::Peak3Q, "P3 Q"); 37 | 38 | startNextRow(); 39 | 40 | addKnob((VstInt32)Leveller::ParamIndices::HighCutFreq, "HC FREQ"); 41 | addKnob((VstInt32)Leveller::ParamIndices::HighCutQ, "HC Q"); 42 | addKnob((VstInt32)Leveller::ParamIndices::Master, "MASTER"); 43 | 44 | VstEditor::Open(); 45 | } 46 | -------------------------------------------------------------------------------- /Vsts/Leveller/LevellerEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __LEVELLEREDITOR_H__ 2 | #define __LEVELLEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class LevellerEditor : public VstEditor 8 | { 9 | public: 10 | LevellerEditor(AudioEffect *audioEffect); 11 | virtual ~LevellerEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Leveller/LevellerVst.cpp: -------------------------------------------------------------------------------- 1 | #include "LevellerVst.h" 2 | #include "LevellerEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new LevellerVst(audioMaster); 11 | } 12 | 13 | LevellerVst::LevellerVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Leveller::ParamIndices::NumParams, 2, 2, 'Lvlr', new Leveller()) 15 | { 16 | setEditor(new LevellerEditor(this)); 17 | } 18 | 19 | void LevellerVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Leveller::ParamIndices)index) 22 | { 23 | case Leveller::ParamIndices::LowCutFreq: vst_strncpy(text, "LC Freq", kVstMaxParamStrLen); break; 24 | case Leveller::ParamIndices::LowCutQ: vst_strncpy(text, "LC Q", kVstMaxParamStrLen); break; 25 | 26 | case Leveller::ParamIndices::Peak1Freq: vst_strncpy(text, "Pk1 Freq", kVstMaxParamStrLen); break; 27 | case Leveller::ParamIndices::Peak1Gain: vst_strncpy(text, "Pk1 Gain", kVstMaxParamStrLen); break; 28 | case Leveller::ParamIndices::Peak1Q: vst_strncpy(text, "Pk1 Q", kVstMaxParamStrLen); break; 29 | 30 | case Leveller::ParamIndices::Peak2Freq: vst_strncpy(text, "Pk2 Freq", kVstMaxParamStrLen); break; 31 | case Leveller::ParamIndices::Peak2Gain: vst_strncpy(text, "Pk2 Gain", kVstMaxParamStrLen); break; 32 | case Leveller::ParamIndices::Peak2Q: vst_strncpy(text, "Pk2 Q", kVstMaxParamStrLen); break; 33 | 34 | case Leveller::ParamIndices::Peak3Freq: vst_strncpy(text, "Pk3 Freq", kVstMaxParamStrLen); break; 35 | case Leveller::ParamIndices::Peak3Gain: vst_strncpy(text, "Pk3 Gain", kVstMaxParamStrLen); break; 36 | case Leveller::ParamIndices::Peak3Q: vst_strncpy(text, "Pk3 Q", kVstMaxParamStrLen); break; 37 | 38 | case Leveller::ParamIndices::HighCutFreq: vst_strncpy(text, "HC Freq", kVstMaxParamStrLen); break; 39 | case Leveller::ParamIndices::HighCutQ: vst_strncpy(text, "HC Q", kVstMaxParamStrLen); break; 40 | 41 | case Leveller::ParamIndices::Master: vst_strncpy(text, "Master", kVstMaxParamStrLen); break; 42 | } 43 | } 44 | 45 | bool LevellerVst::getEffectName(char *name) 46 | { 47 | vst_strncpy(name, "WaveSabre - Leveller", kVstMaxEffectNameLen); 48 | return true; 49 | } 50 | 51 | bool LevellerVst::getProductString(char *text) 52 | { 53 | vst_strncpy(text, "WaveSabre - Leveller", kVstMaxProductStrLen); 54 | return true; 55 | } 56 | -------------------------------------------------------------------------------- /Vsts/Leveller/LevellerVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __LEVELLERVST_H__ 2 | #define __LEVELLERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class LevellerVst : public VstPlug 8 | { 9 | public: 10 | LevellerVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Scissor/ScissorEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "ScissorEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | ScissorEditor::ScissorEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 480, 100, "SCISSOR") 8 | { 9 | } 10 | 11 | ScissorEditor::~ScissorEditor() 12 | { 13 | } 14 | 15 | void ScissorEditor::Open() 16 | { 17 | addKnob((VstInt32)Scissor::ParamIndices::Type, "TYPE"); 18 | addSpacer(); 19 | addKnob((VstInt32)Scissor::ParamIndices::Drive, "DRIVE"); 20 | addSpacer(); 21 | addKnob((VstInt32)Scissor::ParamIndices::Threshold, "THRESHOLD"); 22 | addSpacer(); 23 | addKnob((VstInt32)Scissor::ParamIndices::Foldover, "FOLDOVER"); 24 | addSpacer(); 25 | addKnob((VstInt32)Scissor::ParamIndices::DryWet, "DRY/WET"); 26 | addSpacer(); 27 | addKnob((VstInt32)Scissor::ParamIndices::Oversampling, "OVERSAMPLING"); 28 | 29 | VstEditor::Open(); 30 | } 31 | -------------------------------------------------------------------------------- /Vsts/Scissor/ScissorEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCISSOREDITOR_H__ 2 | #define __SCISSOREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class ScissorEditor : public VstEditor 8 | { 9 | public: 10 | ScissorEditor(AudioEffect *audioEffect); 11 | virtual ~ScissorEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Scissor/ScissorVst.cpp: -------------------------------------------------------------------------------- 1 | #include "ScissorVst.h" 2 | #include "ScissorEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new ScissorVst(audioMaster); 11 | } 12 | 13 | ScissorVst::ScissorVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Scissor::ParamIndices::NumParams, 2, 2, 'Scsr', new Scissor()) 15 | { 16 | setEditor(new ScissorEditor(this)); 17 | } 18 | 19 | void ScissorVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Scissor::ParamIndices)index) 22 | { 23 | case Scissor::ParamIndices::Drive: vst_strncpy(text, "Drive", kVstMaxParamStrLen); break; 24 | case Scissor::ParamIndices::Threshold: vst_strncpy(text, "Threshld", kVstMaxParamStrLen); break; 25 | case Scissor::ParamIndices::Foldover: vst_strncpy(text, "Foldover", kVstMaxParamStrLen); break; 26 | case Scissor::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 27 | case Scissor::ParamIndices::Type: vst_strncpy(text, "Type", kVstMaxParamStrLen); break; 28 | case Scissor::ParamIndices::Oversampling: vst_strncpy(text, "Oversmpl", kVstMaxParamStrLen); break; 29 | } 30 | } 31 | 32 | bool ScissorVst::getEffectName(char *name) 33 | { 34 | vst_strncpy(name, "WaveSabre - Scissor", kVstMaxEffectNameLen); 35 | return true; 36 | } 37 | 38 | bool ScissorVst::getProductString(char *text) 39 | { 40 | vst_strncpy(text, "WaveSabre - Scissor", kVstMaxProductStrLen); 41 | return true; 42 | } 43 | -------------------------------------------------------------------------------- /Vsts/Scissor/ScissorVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCISSORVST_H__ 2 | #define __SCISSORVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class ScissorVst : public VstPlug 8 | { 9 | public: 10 | ScissorVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Vsts/Slaughter/SlaughterEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __SLAUGHTEREDITOR_H__ 2 | #define __SLAUGHTEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class SlaughterEditor : public VstEditor 8 | { 9 | public: 10 | SlaughterEditor(AudioEffect *audioEffect); 11 | virtual ~SlaughterEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Slaughter/SlaughterVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __SLAUGHTERVST_H__ 2 | #define __SLAUGHTERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class SlaughterVst : public VstPlug 8 | { 9 | public: 10 | SlaughterVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Vsts/Smasher/SmasherEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "SmasherEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | SmasherEditor::SmasherEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 330, 160, "SMASHER") 8 | { 9 | } 10 | 11 | SmasherEditor::~SmasherEditor() 12 | { 13 | } 14 | 15 | void SmasherEditor::Open() 16 | { 17 | addKnob((VstInt32)Smasher::ParamIndices::InputGain, "INPUT GAIN"); 18 | addSpacer(); 19 | addKnob((VstInt32)Smasher::ParamIndices::Threshold, "THRESHOLD"); 20 | addSpacer(); 21 | addKnob((VstInt32)Smasher::ParamIndices::Attack, "ATTACK"); 22 | addSpacer(); 23 | addKnob((VstInt32)Smasher::ParamIndices::OutputGain, "OUTPUT GAIN"); 24 | 25 | startNextRow(); 26 | 27 | addKnob((VstInt32)Smasher::ParamIndices::Sidechain, "SIDECHAIN"); 28 | addSpacer(); 29 | addKnob((VstInt32)Smasher::ParamIndices::Ratio, "RATIO"); 30 | addSpacer(); 31 | addKnob((VstInt32)Smasher::ParamIndices::Release, "RELEASE"); 32 | 33 | VstEditor::Open(); 34 | } 35 | -------------------------------------------------------------------------------- /Vsts/Smasher/SmasherEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMASHEREDITOR_H__ 2 | #define __SMASHEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class SmasherEditor : public VstEditor 8 | { 9 | public: 10 | SmasherEditor(AudioEffect *audioEffect); 11 | virtual ~SmasherEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Smasher/SmasherVst.cpp: -------------------------------------------------------------------------------- 1 | #include "SmasherVst.h" 2 | #include "SmasherEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new SmasherVst(audioMaster); 11 | } 12 | 13 | SmasherVst::SmasherVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Smasher::ParamIndices::NumParams, 4, 2, 'Smsh', new Smasher()) 15 | { 16 | setEditor(new SmasherEditor(this)); 17 | } 18 | 19 | void SmasherVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Smasher::ParamIndices)index) 22 | { 23 | case Smasher::ParamIndices::Sidechain: vst_strncpy(text, "Sidchain", kVstMaxParamStrLen); break; 24 | case Smasher::ParamIndices::InputGain: vst_strncpy(text, "In Gain", kVstMaxParamStrLen); break; 25 | case Smasher::ParamIndices::Threshold: vst_strncpy(text, "Thres", kVstMaxParamStrLen); break; 26 | case Smasher::ParamIndices::Ratio: vst_strncpy(text, "Ratio", kVstMaxParamStrLen); break; 27 | case Smasher::ParamIndices::Attack: vst_strncpy(text, "Attack", kVstMaxParamStrLen); break; 28 | case Smasher::ParamIndices::Release: vst_strncpy(text, "Release", kVstMaxParamStrLen); break; 29 | case Smasher::ParamIndices::OutputGain: vst_strncpy(text, "Out Gain", kVstMaxParamStrLen); break; 30 | } 31 | } 32 | 33 | bool SmasherVst::getEffectName(char *name) 34 | { 35 | vst_strncpy(name, "WaveSabre - Smasher", kVstMaxEffectNameLen); 36 | return true; 37 | } 38 | 39 | bool SmasherVst::getProductString(char *text) 40 | { 41 | vst_strncpy(text, "WaveSabre - Smasher", kVstMaxProductStrLen); 42 | return true; 43 | } 44 | -------------------------------------------------------------------------------- /Vsts/Smasher/SmasherVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMASHERVST_H__ 2 | #define __SMASHERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class SmasherVst : public VstPlug 8 | { 9 | public: 10 | SmasherVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /Vsts/Specimen/SpecimenEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPECIMENEDITOR_H__ 2 | #define __SPECIMENEDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | class SpecimenEditor : public VstEditor 11 | { 12 | public: 13 | SpecimenEditor(AudioEffect *audioEffect); 14 | virtual ~SpecimenEditor(); 15 | 16 | virtual void Open(); 17 | 18 | virtual void setParameter(VstInt32 index, float value); 19 | 20 | private: 21 | static BOOL __stdcall driverEnumCallback(HACMDRIVERID driverId, DWORD_PTR dwInstance, DWORD fdwSupport); 22 | static BOOL __stdcall formatEnumCallback(HACMDRIVERID driverId, LPACMFORMATDETAILS formatDetails, DWORD_PTR dwInstance, DWORD fdwSupport); 23 | 24 | static HACMDRIVERID driverId; 25 | static WAVEFORMATEX *foundWaveFormat; 26 | 27 | bool pressedTheFuck; 28 | 29 | CFileSelector *fileSelector; 30 | 31 | Specimen *specimen; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Vsts/Specimen/SpecimenVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPECIMENVST_H__ 2 | #define __SPECIMENVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | 11 | class SpecimenVst : public VstPlug 12 | { 13 | public: 14 | SpecimenVst(audioMasterCallback audioMaster); 15 | 16 | virtual void getParameterName(VstInt32 index, char *text); 17 | 18 | virtual bool getEffectName(char *name); 19 | virtual bool getProductString(char *text); 20 | 21 | Specimen *GetSpecimen() const; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Vsts/Thunder/ThunderEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __THUNDEREDITOR_H__ 2 | #define __THUNDEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | 11 | class ThunderEditor : public VstEditor 12 | { 13 | public: 14 | ThunderEditor(AudioEffect *audioEffect); 15 | virtual ~ThunderEditor(); 16 | 17 | virtual void Open(); 18 | 19 | virtual void setParameter(VstInt32 index, float value); 20 | 21 | private: 22 | static BOOL __stdcall driverEnumCallback(HACMDRIVERID driverId, DWORD_PTR dwInstance, DWORD fdwSupport); 23 | static BOOL __stdcall formatEnumCallback(HACMDRIVERID driverId, LPACMFORMATDETAILS formatDetails, DWORD_PTR dwInstance, DWORD fdwSupport); 24 | 25 | static HACMDRIVERID driverId; 26 | static WAVEFORMATEX *foundWaveFormat; 27 | 28 | bool pressedTheFuck; 29 | 30 | CFileSelector *fileSelector; 31 | 32 | Thunder *thunder; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Vsts/Thunder/ThunderVst.cpp: -------------------------------------------------------------------------------- 1 | #include "ThunderVst.h" 2 | #include "ThunderEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new ThunderVst(audioMaster); 11 | } 12 | 13 | ThunderVst::ThunderVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, 0, 0, 2, 'Tndr', new Thunder(), true) 15 | { 16 | setEditor(new ThunderEditor(this)); 17 | } 18 | 19 | bool ThunderVst::getEffectName(char *name) 20 | { 21 | vst_strncpy(name, "WaveSabre - Thunder", kVstMaxEffectNameLen); 22 | return true; 23 | } 24 | 25 | bool ThunderVst::getProductString(char *text) 26 | { 27 | vst_strncpy(text, "WaveSabre - Thunder", kVstMaxProductStrLen); 28 | return true; 29 | } 30 | 31 | Thunder *ThunderVst::GetThunder() const 32 | { 33 | return (Thunder *)getDevice(); 34 | } 35 | -------------------------------------------------------------------------------- /Vsts/Thunder/ThunderVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __THUNDERVST_H__ 2 | #define __THUNDERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | #include 8 | using namespace WaveSabreCore; 9 | 10 | class ThunderVst : public VstPlug 11 | { 12 | public: 13 | ThunderVst(audioMasterCallback audioMaster); 14 | 15 | virtual bool getEffectName(char *name); 16 | virtual bool getProductString(char *text); 17 | 18 | Thunder *GetThunder() const; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Vsts/Twister/TwisterEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "TwisterEditor.h" 2 | 3 | #include 4 | using namespace WaveSabreCore; 5 | 6 | TwisterEditor::TwisterEditor(AudioEffect *audioEffect) 7 | : VstEditor(audioEffect, 400, 160, "TWISTER") 8 | { 9 | } 10 | 11 | TwisterEditor::~TwisterEditor() 12 | { 13 | } 14 | 15 | void TwisterEditor::Open() 16 | { 17 | addKnob((VstInt32)Twister::ParamIndices::Type, "TYPE"); 18 | addKnob((VstInt32)Twister::ParamIndices::Amount, "AMOUNT"); 19 | addKnob((VstInt32)Twister::ParamIndices::Feedback, "FEEDBACK"); 20 | addKnob((VstInt32)Twister::ParamIndices::Spread, "SPREAD"); 21 | addSpacer(); 22 | addKnob((VstInt32)Twister::ParamIndices::VibratoFreq, "VIB FREQ"); 23 | addKnob((VstInt32)Twister::ParamIndices::VibratoAmount, "VIB AMT"); 24 | 25 | startNextRow(); 26 | addKnob((VstInt32)Twister::ParamIndices::LowCutFreq, "LC FREQ"); 27 | addKnob((VstInt32)Twister::ParamIndices::HighCutFreq, "HC FREQ"); 28 | addSpacer(); 29 | addKnob((VstInt32)Twister::ParamIndices::DryWet, "DRY/WET"); 30 | 31 | VstEditor::Open(); 32 | } 33 | -------------------------------------------------------------------------------- /Vsts/Twister/TwisterEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __TWISTEREDITOR_H__ 2 | #define __TWISTEREDITOR_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class TwisterEditor : public VstEditor 8 | { 9 | public: 10 | TwisterEditor(AudioEffect *audioEffect); 11 | virtual ~TwisterEditor(); 12 | 13 | virtual void Open(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Vsts/Twister/TwisterVst.cpp: -------------------------------------------------------------------------------- 1 | #include "TwisterVst.h" 2 | #include "TwisterEditor.h" 3 | 4 | #include 5 | using namespace WaveSabreCore; 6 | 7 | AudioEffect *createEffectInstance(audioMasterCallback audioMaster) 8 | { 9 | Helpers::Init(); 10 | return new TwisterVst(audioMaster); 11 | } 12 | 13 | TwisterVst::TwisterVst(audioMasterCallback audioMaster) 14 | : VstPlug(audioMaster, (int)Twister::ParamIndices::NumParams, 2, 2, 'Twst', new Twister()) 15 | { 16 | setEditor(new TwisterEditor(this)); 17 | } 18 | 19 | void TwisterVst::getParameterName(VstInt32 index, char *text) 20 | { 21 | switch ((Twister::ParamIndices)index) 22 | { 23 | case Twister::ParamIndices::Type: vst_strncpy(text, "Type", kVstMaxParamStrLen); break; 24 | case Twister::ParamIndices::Amount: vst_strncpy(text, "Amount", kVstMaxParamStrLen); break; 25 | case Twister::ParamIndices::Feedback: vst_strncpy(text, "Feedback", kVstMaxParamStrLen); break; 26 | case Twister::ParamIndices::Spread: vst_strncpy(text, "Spread", kVstMaxParamStrLen); break; 27 | case Twister::ParamIndices::VibratoFreq: vst_strncpy(text, "Vib Frq", kVstMaxParamStrLen); break; 28 | case Twister::ParamIndices::VibratoAmount: vst_strncpy(text, "Vib Amt", kVstMaxParamStrLen); break; 29 | case Twister::ParamIndices::LowCutFreq: vst_strncpy(text, "LC Freq", kVstMaxParamStrLen); break; 30 | case Twister::ParamIndices::HighCutFreq: vst_strncpy(text, "HC Freq", kVstMaxParamStrLen); break; 31 | case Twister::ParamIndices::DryWet: vst_strncpy(text, "Dry/Wet", kVstMaxParamStrLen); break; 32 | } 33 | } 34 | 35 | bool TwisterVst::getEffectName(char *name) 36 | { 37 | vst_strncpy(name, "WaveSabre - Twister", kVstMaxEffectNameLen); 38 | return true; 39 | } 40 | 41 | bool TwisterVst::getProductString(char *text) 42 | { 43 | vst_strncpy(text, "WaveSabre - Twister", kVstMaxProductStrLen); 44 | return true; 45 | } 46 | -------------------------------------------------------------------------------- /Vsts/Twister/TwisterVst.h: -------------------------------------------------------------------------------- 1 | #ifndef __TWISTERVST_H__ 2 | #define __TWISTERVST_H__ 3 | 4 | #include 5 | using namespace WaveSabreVstLib; 6 | 7 | class TwisterVst : public VstPlug 8 | { 9 | public: 10 | TwisterVst(audioMasterCallback audioMaster); 11 | 12 | virtual void getParameterName(VstInt32 index, char *text); 13 | 14 | virtual bool getEffectName(char *name); 15 | virtual bool getProductString(char *text); 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /WaveSabreConvert/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(WAVESABRE_CONVERT_SOURCES 2 | FLConverter.cs 3 | ILog.cs 4 | LiveConverter.cs 5 | LiveParser.cs 6 | LiveProject.cs 7 | MetaPlugin.cs 8 | ProjectConverter.cs 9 | ReaperConverter.cs 10 | ReaperParser.cs 11 | RenoiseConverter.cs 12 | RenoiseInject.cs 13 | RenoiseParser.cs 14 | RenoiseSong63.cs 15 | SendItConfig.cs 16 | Serializer.cs 17 | Song.cs 18 | Utils.cs 19 | 20 | ReaperElements/ReaperElement.cs 21 | ReaperElements/ReaperProject.cs 22 | ReaperElements/ReaperTag.cs 23 | ReaperElements/ReaperTrack.cs 24 | 25 | Properties/AssemblyInfo.cs 26 | Properties/Resources.Designer.cs 27 | Properties/Resources.resx 28 | 29 | Resources/Song.xml 30 | Resources/template.xrns 31 | ) 32 | 33 | add_library(WaveSabreConvert SHARED ${WAVESABRE_CONVERT_SOURCES}) 34 | 35 | csharp_set_designer_cs_properties(${WAVESABRE_CONVERT_SOURCES}) 36 | csharp_set_windows_forms_properties(${WAVESABRE_CONVERT_SOURCES}) 37 | set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${CMAKE_CURRENT_SOURCE_DIR}/FLParser/Monad.FLParser.dll") 38 | set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1") 39 | set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCES 40 | "System" 41 | "System.Core" 42 | "System.IO.Compression" 43 | "System.IO.Compression.FileSystem" 44 | "System.Xml.Linq" 45 | "System.Data.DataSetExtensions" 46 | "Microsoft.CSharp" 47 | "System.Data" 48 | "System.Xml" 49 | "System.ComponentModel" 50 | ) 51 | set_target_properties(WaveSabreConvert PROPERTIES VS_GLOBAL_ROOTNAMESPACE WaveSabreConvert) 52 | -------------------------------------------------------------------------------- /WaveSabreConvert/FLParser/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017 MONAD Demogroup 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /WaveSabreConvert/FLParser/Monad.FLParser.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/WaveSabreConvert/FLParser/Monad.FLParser.dll -------------------------------------------------------------------------------- /WaveSabreConvert/ILog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace WaveSabreConvert 8 | { 9 | public interface ILog 10 | { 11 | void Write(string value); 12 | void WriteLine(string value); 13 | void WriteLine(string format, object arg0); 14 | void WriteLine(string format, params object[] arg); 15 | } 16 | 17 | public class ConsoleLogger : ILog 18 | { 19 | public void Write(string value) 20 | { 21 | Console.Write(value); 22 | } 23 | public void WriteLine(string value) 24 | { 25 | Console.WriteLine(value); 26 | } 27 | public void WriteLine(string format, object arg0) 28 | { 29 | Console.WriteLine(format, arg0); 30 | } 31 | public void WriteLine(string format, params object[] arg) 32 | { 33 | Console.WriteLine(format, arg); 34 | } 35 | } 36 | 37 | public class LogEvent : EventArgs 38 | { 39 | public string Output { get; set; } 40 | } 41 | 42 | public class EventLogger : ILog 43 | { 44 | public event EventHandler OnLog; 45 | 46 | protected virtual void LogOutput(EventArgs e) 47 | { 48 | EventHandler handler = OnLog; 49 | if (handler != null) 50 | { 51 | handler(this, e); 52 | } 53 | } 54 | 55 | public void Write(string value) 56 | { 57 | var e = new LogEvent(); 58 | e.Output = value; 59 | LogOutput(e); 60 | } 61 | public void WriteLine(string value) 62 | { 63 | var e = new LogEvent(); 64 | e.Output = value + Environment.NewLine; 65 | LogOutput(e); 66 | } 67 | public void WriteLine(string format, object arg0) 68 | { 69 | var e = new LogEvent(); 70 | e.Output = string.Format(format, arg0) + Environment.NewLine; 71 | LogOutput(e); 72 | } 73 | public void WriteLine(string format, params object[] arg) 74 | { 75 | var e = new LogEvent(); 76 | e.Output = string.Format(format, arg) + Environment.NewLine; 77 | LogOutput(e); 78 | } 79 | } 80 | 81 | public class NullLogger : ILog 82 | { 83 | public void Write(string value) { } 84 | public void WriteLine(string value) { } 85 | public void WriteLine(string format, object arg0) { } 86 | public void WriteLine(string format, params object[] arg) { } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /WaveSabreConvert/LiveProject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace WaveSabreConvert 4 | { 5 | public class LiveProject 6 | { 7 | public class Send 8 | { 9 | public Track ReceivingTrack; 10 | public int ReceivingChannelIndex; 11 | public double Volume; 12 | public bool IsActive; 13 | public Send(Track receivingTrack, int receivingChannelIndex, double volume, bool isActive) 14 | { 15 | ReceivingTrack = receivingTrack; 16 | ReceivingChannelIndex = receivingChannelIndex; 17 | Volume = volume; 18 | IsActive = isActive; 19 | } 20 | } 21 | 22 | public class Event 23 | { 24 | public double Time; 25 | public float Value; 26 | } 27 | 28 | public class AutomationEnvelope 29 | { 30 | public int PointeeId; 31 | public List Events = new List(); 32 | } 33 | 34 | public class FloatParameter 35 | { 36 | public int Id; 37 | public int AutomationTarget = -1; 38 | public List Events = new List(); 39 | } 40 | 41 | public class Device 42 | { 43 | public string Id; 44 | public string PluginDll; 45 | public bool Bypass; 46 | public byte[] RawData; 47 | public List FloatParameters = new List(); 48 | } 49 | 50 | public class Note 51 | { 52 | public double Time; 53 | public double Duration; 54 | public int Velocity; 55 | public bool IsEnabled; 56 | } 57 | 58 | public class KeyTrack 59 | { 60 | public int MidiKey; 61 | public List Notes = new List(); 62 | } 63 | 64 | public class MidiClip 65 | { 66 | public double CurrentStart, CurrentEnd; 67 | public double LoopStart, LoopEnd, LoopStartRelative; 68 | public bool IsDisabled; 69 | public List KeyTracks = new List(); 70 | } 71 | 72 | public class Track 73 | { 74 | public string Id; 75 | public string Name; 76 | public double Volume; 77 | public bool IsSpeakerOn; 78 | public List Sends = new List(); 79 | public List Devices = new List(); 80 | public List MidiClips = new List(); 81 | public string TrackGroupId; 82 | public List AutomationEnvelopes = new List(); 83 | } 84 | 85 | public List Tracks = new List(); 86 | public List ReturnTracks = new List(); 87 | public Track MasterTrack; 88 | 89 | public double Tempo; 90 | 91 | public bool IsLoopOn; 92 | public double LoopStart, LoopLength; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /WaveSabreConvert/ProjectConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace WaveSabreConvert 5 | { 6 | public class ProjectConverter 7 | { 8 | public Song Convert(string inputFileName, ILog logger) 9 | { 10 | Song song; 11 | 12 | if (!File.Exists(inputFileName)) 13 | { 14 | throw new Exception("Project file not found."); 15 | } 16 | 17 | var extension = Path.GetExtension(inputFileName).ToLower(); 18 | switch (extension) 19 | { 20 | case ".als": 21 | var liveProject = new LiveParser().Process(inputFileName); 22 | song = new LiveConverter().Process(liveProject, logger); 23 | break; 24 | case ".xrns": 25 | var renoiseProject = new RenoiseParser().Process(inputFileName); 26 | song = new RenoiseConverter().Process(renoiseProject, logger); 27 | break; 28 | case ".flp": 29 | var flProject = Monad.FLParser.Project.Load(inputFileName, false); 30 | song = new FLConverter().Process(flProject, logger); 31 | break; 32 | case ".rpp": 33 | var reaperProject = new ReaperParser.ReaperParser().ParseProject(inputFileName); 34 | song = new ReaperConverter().Process(reaperProject, logger); 35 | break; 36 | default: 37 | throw new Exception("Invalid file format."); 38 | } 39 | 40 | song.DetectWarnings(logger); 41 | 42 | song.DeltaEncode(); 43 | 44 | song.Restructure(logger); 45 | 46 | return song; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WaveSabreConvert/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WaveSabreConvert")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("WaveSabreConvert")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cb486e3c-ac33-41ae-a2e0-dac07982bb82")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /WaveSabreConvert/ReaperElements/ReaperProject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ReaperParser.ReaperElements 7 | { 8 | [ReaperTag("REAPER_PROJECT")] 9 | public class ReaperProject : ReaperElement 10 | { 11 | public float SomeVersion { get; set; } 12 | public string Version { get; set; } 13 | public int ProjectId { get; set; } 14 | 15 | [ReaperTag("RIPPLE")] 16 | public int Ripple { get; set; } 17 | [ReaperTag("AUTOXFADE")] 18 | public int AuroCrossFade { get; set; } 19 | [ReaperTag("PANLAW")] 20 | public int PanLaw { get; set; } 21 | [ReaperTag("SAMPLERATE")] 22 | public int SampleRate { get; set; } 23 | [ReaperTag("LOOP")] 24 | public bool Loop { get; set; } 25 | 26 | public ReaperMasterVolumePan MasterVolume { get; set; } 27 | public ReaperTempo Tempo { get; set; } 28 | public ReaperSelection Selection { get; set; } 29 | public ReaperZoom Zoom { get; set; } 30 | public List Tracks { get; set; } 31 | public List MasterEffectsChain { get; set; } 32 | 33 | public ReaperProject() 34 | { 35 | Tracks = new List(); 36 | MasterEffectsChain = new List(); 37 | } 38 | } 39 | 40 | [ReaperTag("SELECTION")] 41 | public class ReaperSelection : ReaperElement 42 | { 43 | public double Start { get; set; } 44 | public double End { get; set; } 45 | } 46 | 47 | [ReaperTag("TEMPO")] 48 | public class ReaperTempo : ReaperElement 49 | { 50 | public float BPM { get; set; } 51 | public int Beats { get; set; } 52 | public int Bars { get; set; } 53 | } 54 | 55 | [ReaperTag("ZOOM")] 56 | public class ReaperZoom : ReaperElement 57 | { 58 | public float ZoomSize { get; set; } 59 | public float ZoomA { get; set; } 60 | public float ZoomB { get; set; } 61 | } 62 | 63 | [ReaperTag("MASTER_VOLUME")] 64 | public class ReaperMasterVolumePan : ReaperElement 65 | { 66 | public float Volume { get; set; } 67 | public float Pan { get; set; } 68 | public float VolumeX { get; set; } 69 | public float VolumeY { get; set; } 70 | } 71 | 72 | [ReaperTag("MASTERFXLIST")] 73 | public class ReaperMasterFxChain : ReaperElement 74 | { 75 | [ReaperTag("FXID")] 76 | public string Fxid { get; set; } 77 | [ReaperTag("WET")] 78 | public float Wet { get; set; } 79 | public ReaperVst Vst { get; set; } 80 | public List Automations { get; set; } 81 | 82 | public ReaperMasterFxChain() 83 | { 84 | Automations = new List(); 85 | } 86 | 87 | // override for customer parse of data 88 | public override void CompleteParse() 89 | { 90 | // clean up empty reaper effect chains 91 | // wanted to do this a better way, but the file format is lame 92 | if (this.Fxid == null) 93 | { 94 | var project = (ReaperProject)this.ParentElement; 95 | project.MasterEffectsChain.Remove(this); 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /WaveSabreConvert/ReaperElements/ReaperTag.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ReaperParser 4 | { 5 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] 6 | internal class ReaperTag : Attribute 7 | { 8 | public string Tag { get; set; } 9 | public ReaperTag(string tag) 10 | { 11 | Tag = tag; 12 | } 13 | public override string ToString() 14 | { 15 | return Tag; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /WaveSabreConvert/RenoiseParser.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.IO.Compression; 3 | using System.Xml.Serialization; 4 | using Renoise; 5 | 6 | namespace WaveSabreConvert 7 | { 8 | public class RenoiseParser 9 | { 10 | public RenoiseSong Process(string fileName) 11 | { 12 | var song = new RenoiseSong(); 13 | 14 | return Process(File.ReadAllBytes(fileName)); 15 | } 16 | 17 | public RenoiseSong Process(byte[] data) 18 | { 19 | var song = new RenoiseSong(); 20 | using (var zipFile = new MemoryStream(data)) 21 | { 22 | using (ZipArchive archive = new ZipArchive(zipFile, ZipArchiveMode.Read)) 23 | { 24 | foreach (var zipEntry in archive.Entries) 25 | { 26 | if (zipEntry.Name == "Song.xml") 27 | { 28 | var serializer = new XmlSerializer(typeof(RenoiseSong)); 29 | song = (RenoiseSong)serializer.Deserialize(zipEntry.Open()); 30 | break; 31 | } 32 | } 33 | } 34 | } 35 | 36 | return song; 37 | } 38 | 39 | public void Save(RenoiseSong song, string fileName) 40 | { 41 | var songData = Utils.Serializer(song); 42 | 43 | using (var fileStream = new FileStream(fileName, FileMode.Create)) 44 | { 45 | using (ZipArchive archive = new ZipArchive(fileStream, ZipArchiveMode.Create)) 46 | { 47 | var entry = archive.CreateEntry("Song.xml"); 48 | using (StreamWriter writer = new StreamWriter(entry.Open())) 49 | { 50 | writer.Write(songData); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /WaveSabreConvert/RenoiseSchema/Readme.txt: -------------------------------------------------------------------------------- 1 | This Renoise schema has been modified from the original that comes with the program. 2 | 3 | Mods by Hoffman / Logicoma 4 | 5 | - 2017-05-16 6 | 7 | Added in some track mixer devices from previous schema RenoiseSong37.xsd as these changed in newer versions to a standard TrackMixerDevice. 8 | Added PluginProperties from RenoiseSong37.xsd, another type which was seamingly renamed between versions. 9 | 10 | - 2017-05-05 11 | 12 | The original when deserialized loses the indexed order, which is vital when trying to reference some things. I've simply wrapped these collections in so when deserialized come out as an array of generic objects but in the right order. 13 | 14 | -------------------------------------------------------------------------------- /WaveSabreConvert/Resources/template.xrns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logicomacorp/WaveSabre/3739be9d5ecf1313114d6277205a359c4dc32c15/WaveSabreConvert/Resources/template.xrns -------------------------------------------------------------------------------- /WaveSabreConvert/SendItConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace WaveSabreConvert 8 | { 9 | 10 | /// 11 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] 12 | [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)] 13 | public partial class MYPLUGINSETTINGS 14 | { 15 | 16 | private int modeField; 17 | 18 | private int channelField; 19 | 20 | private int passThruField; 21 | 22 | /// 23 | [System.Xml.Serialization.XmlAttributeAttribute()] 24 | public int Mode 25 | { 26 | get 27 | { 28 | return this.modeField; 29 | } 30 | set 31 | { 32 | this.modeField = value; 33 | } 34 | } 35 | 36 | /// 37 | [System.Xml.Serialization.XmlAttributeAttribute()] 38 | public int Channel 39 | { 40 | get 41 | { 42 | return this.channelField; 43 | } 44 | set 45 | { 46 | this.channelField = value; 47 | } 48 | } 49 | 50 | /// 51 | [System.Xml.Serialization.XmlAttributeAttribute()] 52 | public int PassThru 53 | { 54 | get 55 | { 56 | return this.passThruField; 57 | } 58 | set 59 | { 60 | this.passThruField = value; 61 | } 62 | } 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /WaveSabreCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(WaveSabreCore 2 | include/WaveSabreCore/Adultery.h 3 | include/WaveSabreCore/AllPass.h 4 | include/WaveSabreCore/AllPassDelay.h 5 | include/WaveSabreCore/BiquadFilter.h 6 | include/WaveSabreCore/Cathedral.h 7 | include/WaveSabreCore/Chamber.h 8 | include/WaveSabreCore/Comb.h 9 | include/WaveSabreCore/Crusher.h 10 | include/WaveSabreCore/DelayBuffer.h 11 | include/WaveSabreCore/Device.h 12 | include/WaveSabreCore/Devices.h 13 | include/WaveSabreCore/Echo.h 14 | include/WaveSabreCore/Envelope.h 15 | include/WaveSabreCore/Falcon.h 16 | include/WaveSabreCore/GmDls.h 17 | include/WaveSabreCore/GsmSample.h 18 | include/WaveSabreCore/Helpers.h 19 | include/WaveSabreCore/Leveller.h 20 | include/WaveSabreCore/MxcsrFlagGuard.h 21 | include/WaveSabreCore/ResampleBuffer.h 22 | include/WaveSabreCore/SamplePlayer.h 23 | include/WaveSabreCore/Scissor.h 24 | include/WaveSabreCore/Slaughter.h 25 | include/WaveSabreCore/Smasher.h 26 | include/WaveSabreCore/Specimen.h 27 | include/WaveSabreCore/StateVariableFilter.h 28 | include/WaveSabreCore/SynthDevice.h 29 | include/WaveSabreCore/Twister.h 30 | include/WaveSabreCore/Deprecated/Thunder.h 31 | src/Adultery.cpp 32 | src/AllPass.cpp 33 | src/AllPassDelay.cpp 34 | src/BiquadFilter.cpp 35 | src/Cathedral.cpp 36 | src/Chamber.cpp 37 | src/Comb.cpp 38 | src/Crusher.cpp 39 | src/DelayBuffer.cpp 40 | src/Device.cpp 41 | src/Echo.cpp 42 | src/Envelope.cpp 43 | src/Falcon.cpp 44 | src/GmDls.cpp 45 | src/GsmSample.cpp 46 | src/Helpers.cpp 47 | src/Leveller.cpp 48 | src/MxcsrFlagGuard.cpp 49 | src/ResampleBuffer.cpp 50 | src/SamplePlayer.cpp 51 | src/Scissor.cpp 52 | src/Slaughter.cpp 53 | src/Smasher.cpp 54 | src/Specimen.cpp 55 | src/StateVariableFilter.cpp 56 | src/SynthDevice.cpp 57 | src/Twister.cpp 58 | src/Deprecated/Thunder.cpp) 59 | 60 | target_link_libraries(WaveSabreCore Msacm32.lib) 61 | target_include_directories(WaveSabreCore PUBLIC include) 62 | 63 | if(MSVC) 64 | target_compile_options(WaveSabreCore 65 | PUBLIC $<$:/GS- /Gy /Zi /GL /GR-> 66 | PRIVATE $<$:/Oi /fp:fast>) 67 | 68 | set_property(TARGET WaveSabreCore APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS_MINSIZEREL 69 | " /LTCG") 70 | 71 | if(MSVC_VERSION GREATER 1900) 72 | target_compile_options(WaveSabreCore PUBLIC 73 | $<$:/Zc:sizedDealloc->) 74 | endif() 75 | endif() 76 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_H__ 2 | #define __WAVESABRECORE_H__ 3 | 4 | #include "WaveSabreCore/Device.h" 5 | #include "WaveSabreCore/SynthDevice.h" 6 | 7 | #include "WaveSabreCore/Helpers.h" 8 | #include "WaveSabreCore/Envelope.h" 9 | #include "WaveSabreCore/BiquadFilter.h" 10 | #include "WaveSabreCore/StateVariableFilter.h" 11 | #include "WaveSabreCore/DelayBuffer.h" 12 | #include "WaveSabreCore/AllPassDelay.h" 13 | #include "WaveSabreCore/Comb.h" 14 | #include "WaveSabreCore/ResampleBuffer.h" 15 | #include "WaveSabreCore/GmDls.h" 16 | #include "WaveSabreCore/MxcsrFlagGuard.h" 17 | 18 | #include "WaveSabreCore/Devices.h" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Adultery.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_ADULTERY_H__ 2 | #define __WAVESABRECORE_ADULTERY_H__ 3 | 4 | #include "SynthDevice.h" 5 | #include "Envelope.h" 6 | #include "StateVariableFilter.h" 7 | #include "SamplePlayer.h" 8 | 9 | namespace WaveSabreCore 10 | { 11 | class Adultery : public SynthDevice 12 | { 13 | public: 14 | enum class ParamIndices 15 | { 16 | SampleIndex, 17 | 18 | AmpAttack, 19 | AmpDecay, 20 | AmpSustain, 21 | AmpRelease, 22 | 23 | SampleStart, 24 | LoopMode, 25 | LoopBoundaryMode, 26 | LoopStart, 27 | LoopLength, 28 | Reverse, 29 | 30 | InterpolationMode, 31 | 32 | CoarseTune, 33 | FineTune, 34 | 35 | FilterType, 36 | FilterFreq, 37 | FilterResonance, 38 | FilterModAmt, 39 | 40 | ModAttack, 41 | ModDecay, 42 | ModSustain, 43 | ModRelease, 44 | 45 | VoicesUnisono, 46 | VoicesDetune, 47 | VoicesPan, 48 | 49 | Master, 50 | 51 | VoiceMode, 52 | SlideTime, 53 | 54 | NumParams, 55 | }; 56 | 57 | Adultery(); 58 | virtual ~Adultery(); 59 | 60 | virtual void SetParam(int index, float value); 61 | virtual float GetParam(int index) const; 62 | 63 | private: 64 | class AdulteryVoice : public Voice 65 | { 66 | public: 67 | AdulteryVoice(Adultery *adultery); 68 | virtual WaveSabreCore::SynthDevice *GetSynthDevice() const; 69 | 70 | virtual void Run(double songPosition, float **outputs, int numSamples); 71 | 72 | virtual void NoteOn(int note, int velocity, float detune, float pan); 73 | virtual void NoteOff(); 74 | 75 | private: 76 | double coarseDetune(float detune); 77 | void calcPitch(); 78 | 79 | Adultery *adultery; 80 | 81 | Envelope ampEnv, modEnv; 82 | 83 | SamplePlayer samplePlayer; 84 | 85 | StateVariableFilter filter; 86 | 87 | float velocity; 88 | }; 89 | 90 | int sampleIndex; 91 | 92 | float ampAttack, ampDecay, ampSustain, ampRelease; 93 | float sampleStart; 94 | bool reverse; 95 | LoopMode loopMode; 96 | LoopBoundaryMode loopBoundaryMode; 97 | float loopStart, loopLength; 98 | 99 | InterpolationMode interpolationMode; 100 | 101 | float *sampleData; 102 | int sampleLength; 103 | int sampleLoopStart, sampleLoopLength; 104 | float coarseTune, fineTune; 105 | float masterLevel; 106 | StateVariableFilterType filterType; 107 | float filterFreq, filterResonance, filterModAmt; 108 | float modAttack, modDecay, modSustain, modRelease; 109 | }; 110 | } 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/AllPass.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_ALLPASS_H__ 2 | #define __WAVESABRECORE_ALLPASS_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class AllPass 7 | { 8 | public: 9 | AllPass(); 10 | virtual ~AllPass(); 11 | 12 | void SetBufferSize(int size); 13 | float Process(float inp); 14 | void SetFeedback(float val); 15 | float GetFeedback(); 16 | 17 | private: 18 | float feedback; 19 | float *buffer; 20 | int bufferSize; 21 | int bufferIndex; 22 | }; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/AllPassDelay.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_ALLPASSDELAY_H__ 2 | #define __WAVESABRECORE_ALLPASSDELAY_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class AllPassDelay 7 | { 8 | public: 9 | AllPassDelay(); 10 | 11 | void Delay(float delay); 12 | float Update(float inSamp); 13 | 14 | private: 15 | float a1, zm1; 16 | }; 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/BiquadFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_BIQUADFILTER_H__ 2 | #define __WAVESABRECORE_BIQUADFILTER_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | enum class BiquadFilterType 7 | { 8 | Lowpass, 9 | Highpass, 10 | Peak, 11 | }; 12 | 13 | class BiquadFilter 14 | { 15 | public: 16 | BiquadFilter(); 17 | 18 | float Next(float input); 19 | 20 | void SetType(BiquadFilterType type); 21 | void SetFreq(float freq); 22 | void SetQ(float q); 23 | void SetGain(float gain); 24 | 25 | private: 26 | bool recalculate; 27 | 28 | BiquadFilterType type; 29 | float freq; 30 | float q; 31 | float gain; 32 | 33 | float c1, c2, c3, c4, c5; 34 | 35 | float lastInput, lastLastInput; 36 | float lastOutput, lastLastOutput; 37 | }; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Cathedral.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_CATHEDRAL_H__ 2 | #define __WAVESABRECORE_CATHEDRAL_H__ 3 | 4 | #include "Device.h" 5 | #include "DelayBuffer.h" 6 | #include "StateVariableFilter.h" 7 | #include "Comb.h" 8 | #include "AllPass.h" 9 | 10 | namespace WaveSabreCore 11 | { 12 | class Cathedral : public Device 13 | { 14 | public: 15 | enum class ParamIndices 16 | { 17 | Freeze, 18 | RoomSize, 19 | Damp, 20 | Width, 21 | 22 | LowCutFreq, 23 | HighCutFreq, 24 | 25 | DryWet, 26 | 27 | PreDelay, 28 | 29 | NumParams, 30 | }; 31 | 32 | Cathedral(); 33 | virtual ~Cathedral(); 34 | 35 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 36 | 37 | virtual void SetParam(int index, float value); 38 | virtual float GetParam(int index) const; 39 | 40 | private: 41 | static const int numCombs = 8; 42 | static const int numAllPasses = 4; 43 | float gain; 44 | float roomSize, roomSize1; 45 | float damp, damp1; 46 | float width; 47 | float lowCutFreq, highCutFreq; 48 | float dryWet; 49 | float wet1, wet2; 50 | bool freeze; 51 | float preDelay; 52 | 53 | void UpdateParams(); 54 | 55 | StateVariableFilter lowCutFilter[2], highCutFilter[2]; 56 | 57 | Comb combLeft[numCombs]; 58 | Comb combRight[numCombs]; 59 | 60 | AllPass allPassLeft[numAllPasses]; 61 | AllPass allPassRight[numAllPasses]; 62 | 63 | DelayBuffer preDelayBuffer; 64 | }; 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Chamber.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_CHAMBER_H__ 2 | #define __WAVESABRECORE_CHAMBER_H__ 3 | 4 | #include "Device.h" 5 | #include "DelayBuffer.h" 6 | #include "StateVariableFilter.h" 7 | 8 | namespace WaveSabreCore 9 | { 10 | class Chamber : public Device 11 | { 12 | public: 13 | enum class ParamIndices 14 | { 15 | Mode, 16 | 17 | Feedback, 18 | 19 | LowCutFreq, 20 | HighCutFreq, 21 | 22 | DryWet, 23 | 24 | PreDelay, 25 | 26 | NumParams, 27 | }; 28 | 29 | Chamber(); 30 | virtual ~Chamber(); 31 | 32 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 33 | 34 | virtual void SetParam(int index, float value); 35 | virtual float GetParam(int index) const; 36 | 37 | private: 38 | static const int numBuffers = 8; 39 | 40 | int mode; 41 | float lowCutFreq, highCutFreq; 42 | float feedback; 43 | float dryWet; 44 | float preDelay; 45 | 46 | DelayBuffer *delayBuffers[numBuffers]; 47 | 48 | DelayBuffer preDelayBuffers[2]; 49 | 50 | StateVariableFilter lowCutFilter[2], highCutFilter[2]; 51 | }; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Comb.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_COMB_H__ 2 | #define __WAVESABRECORE_COMB_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class Comb 7 | { 8 | public: 9 | Comb(); 10 | virtual ~Comb(); 11 | 12 | void SetBufferSize(int size); 13 | float Process(float inp); 14 | void SetDamp(float val); 15 | float GetDamp(); 16 | void SetFeedback(float val); 17 | float GetFeedback(); 18 | 19 | private: 20 | float feedback, filterStore; 21 | float damp1, damp2; 22 | float *buffer; 23 | int bufferSize, bufferIndex; 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Crusher.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_CRUSHER_H__ 2 | #define __WAVESABRECORE_CRUSHER_H__ 3 | 4 | #include "Device.h" 5 | 6 | namespace WaveSabreCore 7 | { 8 | class Crusher : public Device 9 | { 10 | public: 11 | enum class ParamIndices 12 | { 13 | Vertical, 14 | Horizontal, 15 | 16 | DryWet, 17 | 18 | NumParams, 19 | }; 20 | 21 | Crusher(); 22 | 23 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 24 | 25 | virtual void SetParam(int index, float value); 26 | virtual float GetParam(int index) const; 27 | 28 | private: 29 | float vertical, horizontal; 30 | float dryWet; 31 | 32 | float phase[2]; 33 | float hold[2]; 34 | }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/DelayBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_DELAYBUFFER_H__ 2 | #define __WAVESABRECORE_DELAYBUFFER_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class DelayBuffer 7 | { 8 | public: 9 | DelayBuffer(float lengthMs = 0.0f); 10 | ~DelayBuffer(); 11 | 12 | void SetLength(float lengthMs); 13 | 14 | void WriteSample(float sample); 15 | float ReadSample() const; 16 | 17 | private: 18 | int length; 19 | float *buffer; 20 | int currentPosition; 21 | }; 22 | } 23 | 24 | #endif -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Deprecated/Thunder.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_THUNDER_H__ 2 | #define __WAVESABRECORE_THUNDER_H__ 3 | 4 | #include "../SynthDevice.h" 5 | #include "../GsmSample.h" 6 | 7 | namespace WaveSabreCore 8 | { 9 | class Thunder : public SynthDevice 10 | { 11 | public: 12 | static const int SampleRate = 44100; 13 | 14 | Thunder(); 15 | virtual ~Thunder(); 16 | 17 | virtual void SetChunk(void *data, int size); 18 | virtual int GetChunk(void **data); 19 | 20 | void LoadSample(char *compressedDataPtr, int compressedSize, int uncompressedSize, WAVEFORMATEX *waveFormatPtr); 21 | 22 | private: 23 | class ThunderVoice : public Voice 24 | { 25 | public: 26 | ThunderVoice(Thunder *thunder); 27 | virtual WaveSabreCore::SynthDevice *GetSynthDevice() const; 28 | 29 | virtual void Run(double songPosition, float **outputs, int numSamples); 30 | 31 | virtual void NoteOn(int note, int velocity, float detune, float pan); 32 | 33 | private: 34 | Thunder *thunder; 35 | 36 | int samplePos; 37 | }; 38 | 39 | char *chunkData; 40 | 41 | GsmSample *sample; 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Device.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_DEVICE_H__ 2 | #define __WAVESABRECORE_DEVICE_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class Device 7 | { 8 | public: 9 | Device(int numParams); 10 | virtual ~Device(); 11 | 12 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples) = 0; 13 | 14 | virtual void AllNotesOff(); 15 | virtual void NoteOn(int note, int velocity, int deltaSamples); 16 | virtual void NoteOff(int note, int deltaSamples); 17 | 18 | virtual void SetSampleRate(float sampleRate); 19 | virtual void SetTempo(int tempo); 20 | 21 | virtual void SetParam(int index, float value); 22 | virtual float GetParam(int index) const; 23 | 24 | virtual void SetChunk(void *data, int size); 25 | virtual int GetChunk(void **data); 26 | 27 | protected: 28 | virtual void clearOutputs(float **outputs, int numSamples); 29 | 30 | int numParams; 31 | void *chunkData; 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Devices.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_DEVICES_H__ 2 | #define __WAVESABRECORE_DEVICES_H__ 3 | 4 | #include "Falcon.h" 5 | #include "Slaughter.h" 6 | #include "Adultery.h" 7 | #include "Specimen.h" 8 | 9 | #include "Scissor.h" 10 | #include "Leveller.h" 11 | #include "Crusher.h" 12 | #include "Echo.h" 13 | #include "Smasher.h" 14 | #include "Chamber.h" 15 | #include "Twister.h" 16 | #include "Cathedral.h" 17 | 18 | #include "Deprecated/Thunder.h" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Echo.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_ECHO_H__ 2 | #define __WAVESABRECORE_ECHO_H__ 3 | 4 | #include "Device.h" 5 | #include "DelayBuffer.h" 6 | #include "StateVariableFilter.h" 7 | 8 | namespace WaveSabreCore 9 | { 10 | class Echo : public Device 11 | { 12 | public: 13 | enum class ParamIndices 14 | { 15 | LeftDelayCoarse, 16 | LeftDelayFine, 17 | 18 | RightDelayCoarse, 19 | RightDelayFine, 20 | 21 | LowCutFreq, 22 | HighCutFreq, 23 | 24 | Feedback, 25 | Cross, 26 | 27 | DryWet, 28 | 29 | NumParams, 30 | }; 31 | 32 | Echo(); 33 | virtual ~Echo(); 34 | 35 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 36 | 37 | virtual void SetParam(int index, float value); 38 | virtual float GetParam(int index) const; 39 | 40 | private: 41 | int leftDelayCoarse, leftDelayFine; 42 | int rightDelayCoarse, rightDelayFine; 43 | float lowCutFreq, highCutFreq; 44 | float feedback, cross; 45 | float dryWet; 46 | 47 | DelayBuffer leftBuffer; 48 | DelayBuffer rightBuffer; 49 | 50 | StateVariableFilter lowCutFilter[2], highCutFilter[2]; 51 | }; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Envelope.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_ENVELOPE_H__ 2 | #define __WAVESABRECORE_ENVELOPE_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | enum class EnvelopeState 7 | { 8 | Attack, 9 | Decay, 10 | Sustain, 11 | Release, 12 | Finished, 13 | }; 14 | 15 | class Envelope 16 | { 17 | public: 18 | Envelope(); 19 | 20 | void Trigger(); 21 | void Off(); 22 | 23 | float GetValue() const; 24 | void Next(); 25 | 26 | EnvelopeState State; 27 | 28 | float Attack, Decay, Sustain, Release; 29 | 30 | private: 31 | float pos; 32 | float releaseValue; 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Falcon.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_FALCON_H__ 2 | #define __WAVESABRECORE_FALCON_H__ 3 | 4 | #include "SynthDevice.h" 5 | #include "Envelope.h" 6 | 7 | namespace WaveSabreCore 8 | { 9 | class Falcon : public SynthDevice 10 | { 11 | public: 12 | enum class ParamIndices 13 | { 14 | Osc1Waveform, 15 | Osc1RatioCoarse, 16 | Osc1RatioFine, 17 | Osc1Feedback, 18 | Osc1FeedForward, 19 | 20 | Osc1Attack, 21 | Osc1Decay, 22 | Osc1Sustain, 23 | Osc1Release, 24 | 25 | Osc2Waveform, 26 | Osc2RatioCoarse, 27 | Osc2RatioFine, 28 | Osc2Feedback, 29 | 30 | Osc2Attack, 31 | Osc2Decay, 32 | Osc2Sustain, 33 | Osc2Release, 34 | 35 | MasterLevel, 36 | 37 | VoicesUnisono, 38 | VoicesDetune, 39 | VoicesPan, 40 | 41 | VibratoFreq, 42 | VibratoAmount, 43 | 44 | Rise, 45 | 46 | PitchAttack, 47 | PitchDecay, 48 | PitchSustain, 49 | PitchRelease, 50 | PitchEnvAmt1, 51 | PitchEnvAmt2, 52 | 53 | VoiceMode, 54 | SlideTime, 55 | 56 | NumParams, 57 | }; 58 | 59 | Falcon(); 60 | 61 | virtual void SetParam(int index, float value); 62 | virtual float GetParam(int index) const; 63 | 64 | protected: 65 | class FalconVoice : public Voice 66 | { 67 | public: 68 | FalconVoice(Falcon *falcon); 69 | virtual WaveSabreCore::SynthDevice *GetSynthDevice() const; 70 | 71 | virtual void Run(double songPosition, float **outputs, int numSamples); 72 | 73 | virtual void NoteOn(int note, int velocity, float detune, float pan); 74 | virtual void NoteOff(); 75 | 76 | private: 77 | Falcon *falcon; 78 | 79 | Envelope osc1Env, osc2Env, pitchEnv; 80 | 81 | double osc1Phase, osc2Phase; 82 | double osc1Output, osc2Output; 83 | }; 84 | 85 | static double ratioScalar(double coarse, double fine); 86 | 87 | float osc1Waveform, osc1RatioCoarse, osc1RatioFine, osc1Feedback, osc1FeedForward; 88 | float osc1Attack, osc1Decay, osc1Sustain, osc1Release; 89 | float osc2Waveform, osc2RatioCoarse, osc2RatioFine, osc2Feedback; 90 | float osc2Attack, osc2Decay, osc2Sustain, osc2Release; 91 | float masterLevel; 92 | float pitchAttack, pitchDecay, pitchSustain, pitchRelease, pitchEnvAmt1, pitchEnvAmt2; 93 | }; 94 | } 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/GmDls.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_GMDLS_H__ 2 | #define __WAVESABRECORE_GMDLS_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class GmDls 7 | { 8 | public: 9 | static const int WaveListOffset = 0x00044602; 10 | static const int NumSamples = 495; 11 | 12 | static unsigned char *Load(); 13 | }; 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/GsmSample.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_GSMSAMPLE_H__ 2 | #define __WAVESABRECORE_GSMSAMPLE_H__ 3 | 4 | #include "Helpers.h" 5 | 6 | #include 7 | 8 | #ifdef UNICODE 9 | #define _UNICODE 10 | #endif 11 | 12 | #include 13 | #include 14 | 15 | namespace WaveSabreCore 16 | { 17 | class GsmSample 18 | { 19 | public: 20 | GsmSample(char *data, int compressedSize, int uncompressedSize, WAVEFORMATEX *waveFormat); 21 | ~GsmSample(); 22 | 23 | char *WaveFormatData; 24 | int CompressedSize, UncompressedSize; 25 | 26 | char *CompressedData; 27 | float *SampleData; 28 | 29 | int SampleLength; 30 | 31 | private: 32 | static BOOL __stdcall driverEnumCallback(HACMDRIVERID driverId, DWORD_PTR dwInstance, DWORD fdwSupport); 33 | static BOOL __stdcall formatEnumCallback(HACMDRIVERID driverId, LPACMFORMATDETAILS formatDetails, DWORD_PTR dwInstance, DWORD fdwSupport); 34 | 35 | static HACMDRIVERID driverId; 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_HELPERS_H__ 2 | #define __WAVESABRECORE_HELPERS_H__ 3 | 4 | #include "StateVariableFilter.h" 5 | #include "Twister.h" 6 | #include "SynthDevice.h" 7 | 8 | #define _USE_MATH_DEFINES 9 | #include 10 | 11 | namespace WaveSabreCore 12 | { 13 | class Helpers 14 | { 15 | public: 16 | static double CurrentSampleRate; 17 | static int CurrentTempo; 18 | static int RandomSeed; 19 | 20 | static void Init(); 21 | 22 | static float RandFloat(); 23 | 24 | static double Exp2(double x); 25 | static float Exp2F(float x); 26 | 27 | static inline float Exp10F(float x) 28 | { 29 | const float scale = (float)(M_LN10 / M_LN2); 30 | return Exp2F(x * scale); 31 | } 32 | 33 | static inline double Pow2(double x) 34 | { 35 | return x * x; 36 | } 37 | 38 | static inline double Pow4(double x) 39 | { 40 | return Pow2(Pow2(x)); 41 | } 42 | 43 | static inline float Pow2F(float x) 44 | { 45 | return x * x; 46 | } 47 | 48 | static double FastCos(double x); 49 | static double FastSin(double x); 50 | 51 | static double NoteToFreq(double note); 52 | 53 | static double Square135(double phase); 54 | static double Square35(double phase); 55 | 56 | static float Mix(float v1, float v2, float mix); 57 | static float Clamp(float f, float min, float max); 58 | 59 | static float DbToScalar(float db); 60 | 61 | static float EnvValueToScalar(float value); 62 | static float ScalarToEnvValue(float scalar); 63 | 64 | static float VolumeToScalar(float volume); 65 | static float ScalarToVolume(float scalar); 66 | 67 | static bool ParamToBoolean(float value); 68 | static float BooleanToParam(bool b); 69 | 70 | static float ParamToFrequency(float param); 71 | static float FrequencyToParam(float freq); 72 | 73 | static float ParamToQ(float param); 74 | static float QToParam(float q); 75 | 76 | static float ParamToDb(float param, float range = 24.0f); 77 | static float DbToParam(float db, float range = 24.0f); 78 | 79 | static float ParamToResonance(float param); 80 | static float ResonanceToParam(float resonance); 81 | 82 | static StateVariableFilterType ParamToStateVariableFilterType(float param); 83 | static float StateVariableFilterTypeToParam(StateVariableFilterType type); 84 | 85 | static int ParamToUnisono(float param); 86 | static float UnisonoToParam(int unisono); 87 | 88 | static double ParamToVibratoFreq(float param); 89 | static float VibratoFreqToParam(double vf); 90 | 91 | static float PanToScalarLeft(float pan); 92 | static float PanToScalarRight(float pan); 93 | 94 | static Spread ParamToSpread(float param); 95 | static float SpreadToParam(Spread spread); 96 | 97 | static VoiceMode ParamToVoiceMode(float param); 98 | static float VoiceModeToParam(VoiceMode type); 99 | private: 100 | static const int fastSinTabLog2Size = 9; // size = 512 101 | static const int fastSinTabSize = (1 << fastSinTabLog2Size); 102 | static const int adjustedFastSinTabSize = fastSinTabSize + 1; 103 | static double fastSinTab[adjustedFastSinTabSize]; 104 | }; 105 | } 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Leveller.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_LEVELLER_H__ 2 | #define __WAVESABRECORE_LEVELLER_H__ 3 | 4 | #include "Device.h" 5 | #include "BiquadFilter.h" 6 | 7 | namespace WaveSabreCore 8 | { 9 | class Leveller : public Device 10 | { 11 | public: 12 | enum class ParamIndices 13 | { 14 | LowCutFreq, 15 | LowCutQ, 16 | 17 | Peak1Freq, 18 | Peak1Gain, 19 | Peak1Q, 20 | 21 | Peak2Freq, 22 | Peak2Gain, 23 | Peak2Q, 24 | 25 | Peak3Freq, 26 | Peak3Gain, 27 | Peak3Q, 28 | 29 | HighCutFreq, 30 | HighCutQ, 31 | 32 | Master, 33 | 34 | NumParams, 35 | }; 36 | 37 | Leveller(); 38 | 39 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 40 | 41 | virtual void SetParam(int index, float value); 42 | virtual float GetParam(int index) const; 43 | 44 | private: 45 | float lowCutFreq, lowCutQ; 46 | float peak1Freq, peak1Gain, peak1Q; 47 | float peak2Freq, peak2Gain, peak2Q; 48 | float peak3Freq, peak3Gain, peak3Q; 49 | float highCutFreq, highCutQ; 50 | float master; 51 | 52 | BiquadFilter highpass[2]; 53 | BiquadFilter peak1[2]; 54 | BiquadFilter peak2[2]; 55 | BiquadFilter peak3[2]; 56 | BiquadFilter lowpass[2]; 57 | }; 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/MxcsrFlagGuard.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_MXCSR_FLAG_GUARD_H__ 2 | #define __WAVESABRECORE_MXCSR_FLAG_GUARD_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class MxcsrFlagGuard 7 | { 8 | public: 9 | MxcsrFlagGuard(); 10 | ~MxcsrFlagGuard(); 11 | 12 | private: 13 | unsigned int mxcsrRestore; 14 | }; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/ResampleBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_RESAMPLEBUFFER_H__ 2 | #define __WAVESABRECORE_RESAMPLEBUFFER_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | class ResampleBuffer 7 | { 8 | public: 9 | ResampleBuffer(float lengthMs = 0.0f); 10 | ~ResampleBuffer(); 11 | 12 | void SetLength(float lengthMs); 13 | void SetLengthSamples(int samples); 14 | 15 | void WriteSample(float sample); 16 | float ReadPosition(float position) const; 17 | 18 | private: 19 | int length; 20 | float *buffer; 21 | int currentPosition; 22 | }; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/SamplePlayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SAMPLEPLAYER_H__ 2 | #define __WAVESABRECORE_SAMPLEPLAYER_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | enum class InterpolationMode 7 | { 8 | Nearest, 9 | Linear, 10 | 11 | NumInterpolationModes, 12 | }; 13 | 14 | enum class LoopMode 15 | { 16 | Disabled, 17 | Repeat, 18 | PingPong, 19 | 20 | NumLoopModes, 21 | }; 22 | 23 | enum class LoopBoundaryMode 24 | { 25 | FromSample, 26 | Manual, 27 | 28 | NumLoopBoundaryModes, 29 | }; 30 | 31 | class SamplePlayer 32 | { 33 | public: 34 | SamplePlayer(); 35 | 36 | void CalcPitch(double note); 37 | void InitPos(); 38 | void RunPrep(); 39 | float Next(); 40 | 41 | bool IsActive; 42 | 43 | float SampleStart; 44 | bool Reverse; 45 | WaveSabreCore::LoopMode LoopMode; 46 | WaveSabreCore::LoopBoundaryMode LoopBoundaryMode; 47 | float LoopStart, LoopLength; 48 | 49 | WaveSabreCore::InterpolationMode InterpolationMode; 50 | 51 | float *SampleData; 52 | int SampleLength; 53 | int SampleLoopStart, SampleLoopLength; 54 | 55 | private: 56 | double samplePos, sampleDelta; 57 | int roundedLoopStart, roundedLoopLength, roundedLoopEnd; 58 | bool reverse; 59 | }; 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Scissor.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SCISSOR_H__ 2 | #define __WAVESABRECORE_SCISSOR_H__ 3 | 4 | #include "Device.h" 5 | 6 | namespace WaveSabreCore 7 | { 8 | class Scissor : public Device 9 | { 10 | public: 11 | enum class ParamIndices 12 | { 13 | Drive, 14 | Threshold, 15 | Foldover, 16 | 17 | DryWet, 18 | 19 | Type, 20 | 21 | Oversampling, 22 | 23 | NumParams, 24 | }; 25 | 26 | Scissor(); 27 | 28 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 29 | 30 | virtual void SetParam(int index, float value); 31 | virtual float GetParam(int index) const; 32 | 33 | private: 34 | enum class ShaperType 35 | { 36 | Clipper, 37 | Sine, 38 | Parabola, 39 | }; 40 | 41 | enum class Oversampling 42 | { 43 | X1, 44 | X2, 45 | X4, 46 | }; 47 | 48 | float distort(float v, float driveScalar); 49 | 50 | ShaperType type; 51 | float drive, threshold, foldover, dryWet; 52 | Oversampling oversampling; 53 | 54 | float lastSample[2]; 55 | }; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Slaughter.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SLAUGHTER_H__ 2 | #define __WAVESABRECORE_SLAUGHTER_H__ 3 | 4 | #include "SynthDevice.h" 5 | #include "Envelope.h" 6 | #include "StateVariableFilter.h" 7 | 8 | namespace WaveSabreCore 9 | { 10 | class Slaughter : public SynthDevice 11 | { 12 | public: 13 | enum class ParamIndices 14 | { 15 | Osc1Waveform, 16 | Osc1PulseWidth, 17 | Osc1Volume, 18 | Osc1DetuneCoarse, 19 | Osc1DetuneFine, 20 | 21 | Osc2Waveform, 22 | Osc2PulseWidth, 23 | Osc2Volume, 24 | Osc2DetuneCoarse, 25 | Osc2DetuneFine, 26 | 27 | Osc3Waveform, 28 | Osc3PulseWidth, 29 | Osc3Volume, 30 | Osc3DetuneCoarse, 31 | Osc3DetuneFine, 32 | 33 | NoiseVolume, 34 | 35 | FilterType, 36 | FilterFreq, 37 | FilterResonance, 38 | FilterModAmt, 39 | 40 | AmpAttack, 41 | AmpDecay, 42 | AmpSustain, 43 | AmpRelease, 44 | 45 | ModAttack, 46 | ModDecay, 47 | ModSustain, 48 | ModRelease, 49 | 50 | MasterLevel, 51 | 52 | VoicesUnisono, 53 | VoicesDetune, 54 | VoicesPan, 55 | 56 | VibratoFreq, 57 | VibratoAmount, 58 | 59 | Rise, 60 | 61 | PitchAttack, 62 | PitchDecay, 63 | PitchSustain, 64 | PitchRelease, 65 | PitchEnvAmt, 66 | 67 | VoiceMode, 68 | SlideTime, 69 | 70 | NumParams, 71 | }; 72 | 73 | Slaughter(); 74 | 75 | virtual void SetParam(int index, float value); 76 | virtual float GetParam(int index) const; 77 | 78 | protected: 79 | class SlaughterVoice : public Voice 80 | { 81 | public: 82 | SlaughterVoice(Slaughter *slaughter); 83 | virtual WaveSabreCore::SynthDevice *GetSynthDevice() const; 84 | 85 | virtual void Run(double songPosition, float **outputs, int numSamples); 86 | 87 | virtual void NoteOn(int note, int velocity, float detune, float pan); 88 | virtual void NoteOff(); 89 | 90 | private: 91 | class Oscillator 92 | { 93 | public: 94 | float Next(double note, float waveform, float pulseWidth); 95 | 96 | double Phase; 97 | double Integral; 98 | }; 99 | 100 | double coarseDetune(float detune); 101 | 102 | Slaughter *slaughter; 103 | 104 | Envelope ampEnv, modEnv, pitchEnv; 105 | 106 | Oscillator osc1, osc2, osc3; 107 | StateVariableFilter filter; 108 | }; 109 | 110 | float osc1Waveform, osc1PulseWidth, osc1Volume, osc1DetuneCoarse, osc1DetuneFine; 111 | float osc2Waveform, osc2PulseWidth, osc2Volume, osc2DetuneCoarse, osc2DetuneFine; 112 | float osc3Waveform, osc3PulseWidth, osc3Volume, osc3DetuneCoarse, osc3DetuneFine; 113 | float noiseVolume; 114 | StateVariableFilterType filterType; 115 | float filterFreq, filterResonance, filterModAmt; 116 | float ampAttack, ampDecay, ampSustain, ampRelease; 117 | float modAttack, modDecay, modSustain, modRelease; 118 | float pitchAttack, pitchDecay, pitchSustain, pitchRelease, pitchEnvAmt; 119 | float masterLevel; 120 | }; 121 | } 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Smasher.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SMASHER_H__ 2 | #define __WAVESABRECORE_SMASHER_H__ 3 | 4 | #include "Device.h" 5 | #include "DelayBuffer.h" 6 | 7 | namespace WaveSabreCore 8 | { 9 | class Smasher : public Device 10 | { 11 | public: 12 | enum class ParamIndices 13 | { 14 | Sidechain, 15 | InputGain, 16 | Threshold, 17 | Ratio, 18 | Attack, 19 | Release, 20 | OutputGain, 21 | 22 | NumParams, 23 | }; 24 | 25 | Smasher(); 26 | virtual ~Smasher(); 27 | 28 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 29 | 30 | virtual void SetParam(int index, float value); 31 | virtual float GetParam(int index) const; 32 | 33 | private: 34 | const static float lookaheadMs; 35 | 36 | bool sidechain; 37 | float inputGain; 38 | float threshold, ratio; 39 | float attack, release; 40 | float outputGain; 41 | 42 | DelayBuffer leftBuffer; 43 | DelayBuffer rightBuffer; 44 | float peak; 45 | }; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Specimen.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SPECIMEN_H__ 2 | #define __WAVESABRECORE_SPECIMEN_H__ 3 | 4 | #include "SynthDevice.h" 5 | #include "Envelope.h" 6 | #include "StateVariableFilter.h" 7 | #include "SamplePlayer.h" 8 | #include "GsmSample.h" 9 | 10 | namespace WaveSabreCore 11 | { 12 | class Specimen : public SynthDevice 13 | { 14 | public: 15 | enum class ParamIndices 16 | { 17 | AmpAttack, 18 | AmpDecay, 19 | AmpSustain, 20 | AmpRelease, 21 | 22 | SampleStart, 23 | LoopMode, 24 | LoopStart, 25 | LoopLength, 26 | Reverse, 27 | 28 | InterpolationMode, 29 | 30 | CoarseTune, 31 | FineTune, 32 | 33 | FilterType, 34 | FilterFreq, 35 | FilterResonance, 36 | FilterModAmt, 37 | 38 | ModAttack, 39 | ModDecay, 40 | ModSustain, 41 | ModRelease, 42 | 43 | VoicesUnisono, 44 | VoicesDetune, 45 | VoicesPan, 46 | 47 | Master, 48 | 49 | VoiceMode, 50 | SlideTime, 51 | 52 | NumParams, 53 | }; 54 | 55 | static const int SampleRate = 44100; 56 | 57 | Specimen(); 58 | virtual ~Specimen(); 59 | 60 | virtual void SetParam(int index, float value); 61 | virtual float GetParam(int index) const; 62 | 63 | virtual void SetChunk(void *data, int size); 64 | virtual int GetChunk(void **data); 65 | 66 | void LoadSample(char *compressedDataPtr, int compressedSize, int uncompressedSize, WAVEFORMATEX *waveFormatPtr); 67 | 68 | private: 69 | class SpecimenVoice : public Voice 70 | { 71 | public: 72 | SpecimenVoice(Specimen *thunder); 73 | virtual WaveSabreCore::SynthDevice *GetSynthDevice() const; 74 | 75 | virtual void Run(double songPosition, float **outputs, int numSamples); 76 | 77 | virtual void NoteOn(int note, int velocity, float detune, float pan); 78 | virtual void NoteOff(); 79 | 80 | private: 81 | double coarseDetune(float detune); 82 | void calcPitch(); 83 | 84 | Specimen *specimen; 85 | 86 | Envelope ampEnv, modEnv; 87 | 88 | SamplePlayer samplePlayer; 89 | 90 | StateVariableFilter filter; 91 | 92 | float velocity; 93 | }; 94 | 95 | char *chunkData; 96 | 97 | GsmSample* sample; 98 | 99 | float ampAttack, ampDecay, ampSustain, ampRelease; 100 | float sampleStart; 101 | bool reverse; 102 | LoopMode loopMode; 103 | LoopBoundaryMode loopBoundaryMode; 104 | float loopStart, loopLength; 105 | 106 | InterpolationMode interpolationMode; 107 | 108 | int sampleLoopStart, sampleLoopLength; 109 | float coarseTune, fineTune; 110 | float masterLevel; 111 | StateVariableFilterType filterType; 112 | float filterFreq, filterResonance, filterModAmt; 113 | float modAttack, modDecay, modSustain, modRelease; 114 | }; 115 | } 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/StateVariableFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_STATEVARIABLEFILTER_H__ 2 | #define __WAVESABRECORE_STATEVARIABLEFILTER_H__ 3 | 4 | namespace WaveSabreCore 5 | { 6 | enum class StateVariableFilterType 7 | { 8 | Lowpass, 9 | Highpass, 10 | Bandpass, 11 | Notch, 12 | }; 13 | 14 | class StateVariableFilter 15 | { 16 | public: 17 | StateVariableFilter(); 18 | 19 | float Next(float input); 20 | 21 | void SetType(StateVariableFilterType type); 22 | void SetFreq(float freq); 23 | void SetQ(float q); 24 | 25 | private: 26 | float run(float input); 27 | 28 | bool recalculate; 29 | 30 | StateVariableFilterType type; 31 | float freq; 32 | float q; 33 | 34 | float lastInput; 35 | float low, band; 36 | 37 | float f; 38 | }; 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/SynthDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_SYNTHDEVICE_H__ 2 | #define __WAVESABRECORE_SYNTHDEVICE_H__ 3 | 4 | #include "Device.h" 5 | 6 | namespace WaveSabreCore 7 | { 8 | enum class VoiceMode 9 | { 10 | Polyphonic, 11 | MonoLegatoTrill, 12 | }; 13 | 14 | class SynthDevice : public Device 15 | { 16 | public: 17 | SynthDevice(int numParams); 18 | virtual ~SynthDevice(); 19 | 20 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 21 | 22 | virtual void AllNotesOff(); 23 | virtual void NoteOn(int note, int velocity, int deltaSamples); 24 | virtual void NoteOff(int note, int deltaSamples); 25 | 26 | void SetVoiceMode(VoiceMode voiceMode); 27 | VoiceMode GetVoiceMode() const; 28 | 29 | int VoicesUnisono; 30 | float VoicesDetune; 31 | float VoicesPan; 32 | 33 | double VibratoFreq; 34 | float VibratoAmount; 35 | 36 | float Rise; 37 | 38 | float Slide; 39 | 40 | protected: 41 | static const int maxVoices = 256; 42 | static const int maxEvents = 256; 43 | static const int maxActiveNotes = 128; 44 | 45 | class Voice 46 | { 47 | public: 48 | Voice(); 49 | virtual ~Voice(); 50 | 51 | virtual SynthDevice *GetSynthDevice() const = 0; 52 | 53 | virtual void Run(double songPosition, float **outputs, int numSamples) = 0; 54 | 55 | virtual void NoteOn(int note, int velocity, float detune, float pan); 56 | virtual void NoteOff(); 57 | virtual void NoteSlide(int note); 58 | virtual double GetNote(); 59 | 60 | bool IsOn; 61 | int Note; 62 | 63 | float Detune; 64 | float Pan; 65 | 66 | double vibratoPhase; 67 | 68 | private: 69 | bool slideActive; 70 | double slideDelta; 71 | int slideSamples; 72 | int destinationNote; 73 | double currentNote; 74 | }; 75 | 76 | enum class EventType 77 | { 78 | None, 79 | NoteOn, 80 | NoteOff, 81 | }; 82 | 83 | struct Event 84 | { 85 | EventType Type; 86 | int DeltaSamples; 87 | 88 | int Note, Velocity; 89 | }; 90 | 91 | bool monoActive; 92 | int noteLog[maxActiveNotes]; 93 | int noteCount; 94 | bool activeNotes[maxActiveNotes]; 95 | 96 | void clearEvents(); 97 | 98 | Voice *voices[maxVoices]; 99 | VoiceMode voiceMode; 100 | Event events[maxEvents]; 101 | }; 102 | } 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /WaveSabreCore/include/WaveSabreCore/Twister.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABRECORE_TWISTER_H__ 2 | #define __WAVESABRECORE_TWISTER_H__ 3 | 4 | #include "Device.h" 5 | #include "ResampleBuffer.h" 6 | #include "AllPassDelay.h" 7 | #include "StateVariableFilter.h" 8 | 9 | namespace WaveSabreCore 10 | { 11 | enum class Spread 12 | { 13 | Mono, 14 | FullInvert, 15 | ModInvert 16 | }; 17 | 18 | class Twister : public Device 19 | { 20 | public: 21 | enum class ParamIndices 22 | { 23 | Type, 24 | 25 | Amount, 26 | Feedback, 27 | 28 | Spread, 29 | 30 | VibratoFreq, 31 | VibratoAmount, 32 | 33 | LowCutFreq, 34 | HighCutFreq, 35 | 36 | DryWet, 37 | 38 | NumParams, 39 | }; 40 | 41 | 42 | Twister(); 43 | virtual ~Twister(); 44 | 45 | virtual void Run(double songPosition, float **inputs, float **outputs, int numSamples); 46 | 47 | virtual void SetParam(int index, float value); 48 | virtual float GetParam(int index) const; 49 | 50 | private: 51 | int type; 52 | float amount, feedback; 53 | Spread spread; 54 | double vibratoFreq; 55 | float vibratoAmount; 56 | double vibratoPhase; 57 | float lowCutFreq, highCutFreq; 58 | float dryWet; 59 | float lastLeft, lastRight; 60 | 61 | AllPassDelay allPassLeft[6]; 62 | AllPassDelay allPassRight[6]; 63 | float AllPassUpdateLeft(float input); 64 | float AllPassUpdateRight(float input); 65 | 66 | ResampleBuffer leftBuffer; 67 | ResampleBuffer rightBuffer; 68 | 69 | StateVariableFilter lowCutFilter[2], highCutFilter[2]; 70 | }; 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /WaveSabreCore/src/AllPass.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | AllPass::AllPass() 9 | { 10 | buffer = nullptr; 11 | bufferIndex = 0; 12 | } 13 | 14 | AllPass::~AllPass() 15 | { 16 | if (buffer) delete[] buffer; 17 | } 18 | 19 | void AllPass::SetBufferSize(int size) 20 | { 21 | if (size < 1) size = 1; 22 | bufferSize = size; 23 | auto newBuffer = new float[size]; 24 | for (int i = 0; i < size; i++) newBuffer[i] = 0.0f; 25 | bufferIndex = 0; 26 | auto oldBuffer = buffer; 27 | buffer = newBuffer; 28 | if (oldBuffer) delete[] oldBuffer; 29 | } 30 | 31 | void AllPass::SetFeedback(float value) 32 | { 33 | feedback = value; 34 | } 35 | 36 | float AllPass::GetFeedback() 37 | { 38 | return feedback; 39 | } 40 | 41 | float AllPass::Process(float input) 42 | { 43 | float output; 44 | float bufferOut; 45 | 46 | bufferOut = buffer[bufferIndex]; 47 | 48 | output = -input + bufferOut; 49 | buffer[bufferIndex] = input + (bufferOut * feedback); 50 | 51 | bufferIndex = (bufferIndex + 1) % bufferSize; 52 | 53 | return output; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /WaveSabreCore/src/AllPassDelay.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | AllPassDelay::AllPassDelay() 9 | { 10 | a1 = 0.0f; 11 | zm1 = 0.0f; 12 | } 13 | 14 | void AllPassDelay::Delay(float delay) 15 | { 16 | a1 = (1.f - delay) / (1.f + delay); 17 | } 18 | 19 | float AllPassDelay::Update(float inSamp) 20 | { 21 | float y = inSamp * -a1 + zm1; 22 | zm1 = y * a1 + inSamp; 23 | 24 | return y; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WaveSabreCore/src/BiquadFilter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | BiquadFilter::BiquadFilter() 9 | { 10 | recalculate = true; 11 | 12 | type = BiquadFilterType::Lowpass; 13 | 14 | freq = 1000.0f; 15 | q = 1.0f; 16 | gain = 0.0f; 17 | 18 | lastInput = lastLastInput = 0.0f; 19 | lastOutput = lastLastOutput = 0.0f; 20 | } 21 | 22 | float BiquadFilter::Next(float input) 23 | { 24 | if (recalculate) 25 | { 26 | float w0 = 2.0f * 3.141592f * freq / (float)Helpers::CurrentSampleRate; 27 | 28 | float alpha = (float)Helpers::FastSin(w0) / (2.0f * q); 29 | 30 | float a0, a1, a2; 31 | float b0, b1, b2; 32 | switch (type) 33 | { 34 | case BiquadFilterType::Lowpass: 35 | a0 = 1.0f + alpha; 36 | a1 = -2.0f * (float)Helpers::FastCos(w0); 37 | a2 = 1.0f - alpha; 38 | b0 = (1.0f - (float)Helpers::FastCos(w0)) / 2.0f; 39 | b1 = 1.0f - (float)Helpers::FastCos(w0); 40 | b2 = (1.0f - (float)Helpers::FastCos(w0)) / 2.0f; 41 | break; 42 | 43 | case BiquadFilterType::Highpass: 44 | a0 = 1.0f + alpha; 45 | a1 = -2.0f * (float)Helpers::FastCos(w0); 46 | a2 = 1.0f - alpha; 47 | b0 = (1.0f + (float)Helpers::FastCos(w0)) / 2.0f; 48 | b1 = -(1.0f + (float)Helpers::FastCos(w0)); 49 | b2 = (1.0f + (float)Helpers::FastCos(w0)) / 2.0f; 50 | break; 51 | 52 | case BiquadFilterType::Peak: 53 | { 54 | float A = Helpers::Exp10F(gain / 40.0f); 55 | a0 = 1.0f + alpha / A; 56 | a1 = -2.0f * (float)Helpers::FastCos(w0); 57 | a2 = 1.0f - alpha / A; 58 | b0 = 1.0f + alpha * A; 59 | b1 = -2.0f * (float)Helpers::FastCos(w0); 60 | b2 = 1.0f - alpha * A; 61 | } 62 | break; 63 | } 64 | 65 | c1 = b0 / a0; 66 | c2 = b1 / a0; 67 | c3 = b2 / a0; 68 | c4 = a1 / a0; 69 | c5 = a2 / a0; 70 | 71 | recalculate = false; 72 | } 73 | 74 | float output = c1 * input + c2 * lastInput + c3 * lastLastInput - c4 * lastOutput - c5 * lastLastOutput; 75 | 76 | lastLastInput = lastInput; 77 | lastInput = input; 78 | lastLastOutput = lastOutput; 79 | lastOutput = output; 80 | 81 | return output; 82 | } 83 | 84 | void BiquadFilter::SetType(BiquadFilterType type) 85 | { 86 | if (type == this->type) 87 | return; 88 | 89 | this->type = type; 90 | recalculate = true; 91 | } 92 | 93 | void BiquadFilter::SetFreq(float freq) 94 | { 95 | if (freq == this->freq) 96 | return; 97 | 98 | this->freq = freq; 99 | recalculate = true; 100 | } 101 | 102 | void BiquadFilter::SetQ(float q) 103 | { 104 | if (q == this->q) 105 | return; 106 | 107 | this->q = q; 108 | recalculate = true; 109 | } 110 | 111 | void BiquadFilter::SetGain(float gain) 112 | { 113 | if (gain == this->gain) 114 | return; 115 | 116 | this->gain = gain; 117 | recalculate = true; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /WaveSabreCore/src/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | ### Changed 9 | - Marked Thunder as "DEPRECATED" in its UI. 10 | 11 | ## [0.1.0] - 2021-06-07 12 | - Initial release. 13 | 14 | [Unreleased]: https://github.com/logicomacorp/pulsejet/compare/v0.1.0...HEAD 15 | [0.1.0]: https://github.com/logicomacorp/pulsejet/releases/tag/v0.1.0 16 | -------------------------------------------------------------------------------- /WaveSabreCore/src/Comb.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | Comb::Comb() 9 | { 10 | buffer = nullptr; 11 | filterStore = 0; 12 | bufferIndex = 0; 13 | } 14 | 15 | Comb::~Comb() 16 | { 17 | if (buffer) delete[] buffer; 18 | } 19 | 20 | void Comb::SetBufferSize(int size) 21 | { 22 | if (size < 1) size = 1; 23 | bufferSize = size; 24 | auto newBuffer = new float[size]; 25 | for (int i = 0; i < size; i++) newBuffer[i] = 0.0f; 26 | bufferIndex = 0; 27 | auto oldBuffer = buffer; 28 | buffer = newBuffer; 29 | if (oldBuffer) delete[] oldBuffer; 30 | } 31 | 32 | void Comb::SetDamp(float val) 33 | { 34 | damp1 = val; 35 | damp2 = 1 - val; 36 | } 37 | 38 | float Comb::GetDamp() 39 | { 40 | return damp1; 41 | } 42 | 43 | void Comb::SetFeedback(float val) 44 | { 45 | feedback = val; 46 | } 47 | 48 | float Comb::GetFeedback() 49 | { 50 | return feedback; 51 | } 52 | 53 | float Comb::Process(float input) 54 | { 55 | float output; 56 | 57 | output = buffer[bufferIndex]; 58 | 59 | filterStore = (output * damp2) + (filterStore * damp1); 60 | 61 | buffer[bufferIndex] = input + (filterStore * feedback); 62 | 63 | bufferIndex = (bufferIndex + 1) % bufferSize; 64 | 65 | return output; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /WaveSabreCore/src/Crusher.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | Crusher::Crusher() 9 | : Device((int)ParamIndices::NumParams) 10 | { 11 | vertical = 0.0f; 12 | horizontal = 0.0f; 13 | dryWet = 1.0f; 14 | 15 | for (int i = 0; i < 2; i++) 16 | { 17 | phase[i] = 0.0f; 18 | hold[i] = 0.0f; 19 | } 20 | } 21 | 22 | void Crusher::Run(double songPosition, float **inputs, float **outputs, int numSamples) 23 | { 24 | float step = 1.0f / Helpers::Exp2F((1.0f - vertical) * 15.0f + 1.0f); 25 | float freq = Helpers::Pow2F(1.0f - horizontal); 26 | for (int i = 0; i < 2; i++) 27 | { 28 | for (int j = 0; j < numSamples; j++) 29 | { 30 | float input = inputs[i][j]; 31 | 32 | phase[i] += freq; 33 | if (phase[i] >= 1.0f) 34 | { 35 | phase[i] -= 1.0f; 36 | hold[i] = floorf(input / step + .5f) * step; 37 | } 38 | 39 | outputs[i][j] = Helpers::Mix(input, hold[i], dryWet); 40 | } 41 | } 42 | } 43 | 44 | void Crusher::SetParam(int index, float value) 45 | { 46 | switch ((ParamIndices)index) 47 | { 48 | case ParamIndices::Vertical: vertical = value; break; 49 | case ParamIndices::Horizontal: horizontal = value; break; 50 | case ParamIndices::DryWet: dryWet = value; break; 51 | } 52 | } 53 | 54 | float Crusher::GetParam(int index) const 55 | { 56 | switch ((ParamIndices)index) 57 | { 58 | case ParamIndices::Vertical: 59 | default: 60 | return vertical; 61 | 62 | case ParamIndices::Horizontal: return horizontal; 63 | case ParamIndices::DryWet: return dryWet; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /WaveSabreCore/src/DelayBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace WaveSabreCore 5 | { 6 | DelayBuffer::DelayBuffer(float lengthMs) 7 | { 8 | buffer = nullptr; 9 | SetLength(lengthMs); 10 | } 11 | 12 | DelayBuffer::~DelayBuffer() 13 | { 14 | if (buffer) delete[] buffer; 15 | } 16 | 17 | void DelayBuffer::SetLength(float lengthMs) 18 | { 19 | int newLength = (int)((double)lengthMs * Helpers::CurrentSampleRate / 1000.0); 20 | if (newLength < 1) newLength = 1; 21 | if (newLength != length || !buffer) 22 | { 23 | auto newBuffer = new float[newLength]; 24 | for (int i = 0; i < newLength; i++) newBuffer[i] = 0.0f; 25 | currentPosition = 0; 26 | auto oldBuffer = buffer; 27 | buffer = newBuffer; 28 | length = newLength; 29 | if (oldBuffer) delete[] oldBuffer; 30 | } 31 | } 32 | 33 | void DelayBuffer::WriteSample(float sample) 34 | { 35 | buffer[currentPosition] = sample; 36 | currentPosition = (currentPosition + 1) % length; 37 | } 38 | 39 | float DelayBuffer::ReadSample() const 40 | { 41 | return buffer[currentPosition]; 42 | } 43 | } -------------------------------------------------------------------------------- /WaveSabreCore/src/Deprecated/Thunder.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace WaveSabreCore 5 | { 6 | Thunder::Thunder() 7 | : SynthDevice(0) 8 | , sample(nullptr) 9 | { 10 | for (int i = 0; i < maxVoices; i++) voices[i] = new ThunderVoice(this); 11 | 12 | chunkData = nullptr; 13 | } 14 | 15 | Thunder::~Thunder() 16 | { 17 | if (chunkData) delete [] chunkData; 18 | if (sample) delete sample; 19 | } 20 | 21 | typedef struct 22 | { 23 | int CompressedSize; 24 | int UncompressedSize; 25 | } ChunkHeader; 26 | 27 | void Thunder::SetChunk(void *data, int size) 28 | { 29 | if (!size) return; 30 | auto h = (ChunkHeader *)data; 31 | auto waveFormat = (WAVEFORMATEX *)((char *)data + sizeof(ChunkHeader)); 32 | auto compressedData = (char *)waveFormat + sizeof(WAVEFORMATEX) + waveFormat->cbSize; 33 | LoadSample(compressedData, h->CompressedSize, h->UncompressedSize, waveFormat); 34 | } 35 | 36 | int Thunder::GetChunk(void **data) 37 | { 38 | if (!sample) return 0; 39 | ChunkHeader h; 40 | h.CompressedSize = sample->CompressedSize; 41 | h.UncompressedSize = sample->UncompressedSize; 42 | if (chunkData) delete [] chunkData; 43 | int chunkSize = sizeof(ChunkHeader) + sizeof(WAVEFORMATEX) + ((WAVEFORMATEX *)sample->WaveFormatData)->cbSize + sample->CompressedSize + sizeof(int); 44 | chunkData = new char[chunkSize]; 45 | memcpy(chunkData, &h, sizeof(ChunkHeader)); 46 | memcpy(chunkData + sizeof(ChunkHeader), sample->WaveFormatData, sizeof(WAVEFORMATEX) + ((WAVEFORMATEX *)sample->WaveFormatData)->cbSize); 47 | memcpy(chunkData + sizeof(ChunkHeader) + sizeof(WAVEFORMATEX) + ((WAVEFORMATEX *)sample->WaveFormatData)->cbSize, sample->CompressedData, sample->CompressedSize); 48 | *(int *)(chunkData + chunkSize - sizeof(int)) = chunkSize; 49 | *data = chunkData; 50 | return chunkSize; 51 | } 52 | 53 | void Thunder::LoadSample(char *compressedDataPtr, int compressedSize, int uncompressedSize, WAVEFORMATEX *waveFormatPtr) 54 | { 55 | if (sample) delete sample; 56 | 57 | sample = new GsmSample(compressedDataPtr, compressedSize, uncompressedSize, waveFormatPtr); 58 | } 59 | 60 | Thunder::ThunderVoice::ThunderVoice(Thunder *thunder) 61 | { 62 | this->thunder = thunder; 63 | } 64 | 65 | SynthDevice *Thunder::ThunderVoice::GetSynthDevice() const 66 | { 67 | return thunder; 68 | } 69 | 70 | void Thunder::ThunderVoice::Run(double songPosition, float **outputs, int numSamples) 71 | { 72 | for (int i = 0; i < numSamples; i++) 73 | { 74 | if (samplePos >= thunder->sample->SampleLength) 75 | { 76 | IsOn = false; 77 | break; 78 | } 79 | float sample = thunder->sample->SampleData[samplePos]; 80 | outputs[0][i] += sample; 81 | outputs[1][i] += sample; 82 | samplePos++; 83 | } 84 | } 85 | 86 | void Thunder::ThunderVoice::NoteOn(int note, int velocity, float detune, float pan) 87 | { 88 | Voice::NoteOn(note, velocity, detune, pan); 89 | samplePos = 0; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /WaveSabreCore/src/Device.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace WaveSabreCore 5 | { 6 | Device::Device(int numParams) 7 | { 8 | this->numParams = numParams; 9 | chunkData = nullptr; 10 | } 11 | 12 | Device::~Device() 13 | { 14 | if (chunkData) delete (char *)chunkData; 15 | } 16 | 17 | void Device::AllNotesOff() { } 18 | void Device::NoteOn(int note, int velocity, int deltaSamples) { } 19 | void Device::NoteOff(int note, int deltaSamples) { } 20 | 21 | void Device::SetSampleRate(float sampleRate) 22 | { 23 | Helpers::CurrentSampleRate = (double)sampleRate; 24 | } 25 | 26 | void Device::SetTempo(int tempo) 27 | { 28 | Helpers::CurrentTempo = tempo; 29 | } 30 | 31 | void Device::SetParam(int index, float value) { } 32 | 33 | float Device::GetParam(int index) const 34 | { 35 | return 0.0f; 36 | } 37 | 38 | void Device::SetChunk(void *data, int size) 39 | { 40 | auto params = (float *)data; 41 | // This may be different than our internal numParams value if this chunk was 42 | // saved with an earlier version of the plug for example. It's important we 43 | // don't read past the chunk data, so we set as many parameters as the 44 | // chunk contains, not the amount of parameters we have available. The 45 | // remaining parameters will retain their default values in that case, which 46 | // if we've done our job right, shouldn't change the sound with respect to 47 | // the parameters we read here. 48 | auto numChunkParams = (int)((size - sizeof(int)) / sizeof(float)); 49 | for (int i = 0; i < numChunkParams; i++) 50 | SetParam(i, params[i]); 51 | } 52 | 53 | int Device::GetChunk(void **data) 54 | { 55 | int chunkSize = numParams * sizeof(float) + sizeof(int); 56 | if (!chunkData) chunkData = new char[chunkSize]; 57 | 58 | for (int i = 0; i < numParams; i++) 59 | ((float *)chunkData)[i] = GetParam(i); 60 | *(int *)((char *)chunkData + chunkSize - sizeof(int)) = chunkSize; 61 | 62 | *data = chunkData; 63 | return chunkSize; 64 | } 65 | 66 | void Device::clearOutputs(float **outputs, int numSamples) 67 | { 68 | for (int i = 0; i < 2; i++) 69 | { 70 | for (int j = 0; j < numSamples; j++) outputs[i][j] = 0.0f; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /WaveSabreCore/src/Envelope.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | Envelope::Envelope() 9 | { 10 | State = EnvelopeState::Finished; 11 | Attack = 1.0f; 12 | Decay = 5.0f; 13 | Sustain = .5f; 14 | Release = 1.5f; 15 | } 16 | 17 | void Envelope::Trigger() 18 | { 19 | State = EnvelopeState::Attack; 20 | pos = 0.0f; 21 | } 22 | 23 | void Envelope::Off() 24 | { 25 | releaseValue = GetValue(); 26 | State = EnvelopeState::Release; 27 | pos = 0.0f; 28 | } 29 | 30 | float Envelope::GetValue() const 31 | { 32 | switch (State) 33 | { 34 | case EnvelopeState::Attack: 35 | return pos / Attack; 36 | 37 | case EnvelopeState::Decay: 38 | { 39 | float f = 1.0f - pos / Decay; 40 | f *= f; 41 | return 1.0f * f + Sustain * (1.0f - f); 42 | } 43 | 44 | case EnvelopeState::Sustain: 45 | return Sustain; 46 | 47 | case EnvelopeState::Release: 48 | { 49 | float f = 1.0f - pos / Release; 50 | f *= f; 51 | return releaseValue * f; 52 | } 53 | 54 | default: 55 | return 0.0f; 56 | } 57 | } 58 | 59 | void Envelope::Next() 60 | { 61 | if (State == EnvelopeState::Finished) return; 62 | float posDelta = (float)(1000.0 / Helpers::CurrentSampleRate); 63 | switch (State) 64 | { 65 | case EnvelopeState::Attack: 66 | pos += posDelta; 67 | if (pos >= Attack) 68 | { 69 | State = EnvelopeState::Decay; 70 | pos -= Attack; 71 | } 72 | break; 73 | 74 | case EnvelopeState::Decay: 75 | pos += posDelta; 76 | if (pos >= Decay) State = EnvelopeState::Sustain; 77 | break; 78 | 79 | case EnvelopeState::Release: 80 | pos += posDelta; 81 | if (pos >= Release) State = EnvelopeState::Finished; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /WaveSabreCore/src/GmDls.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | static char *gmDlsPaths[2] = 6 | { 7 | "drivers/gm.dls", 8 | "drivers/etc/gm.dls" 9 | }; 10 | 11 | namespace WaveSabreCore 12 | { 13 | unsigned char *GmDls::Load() 14 | { 15 | HANDLE gmDlsFile = INVALID_HANDLE_VALUE; 16 | for (int i = 0; gmDlsFile == INVALID_HANDLE_VALUE; i++) 17 | { 18 | OFSTRUCT reOpenBuff; 19 | gmDlsFile = (HANDLE)(UINT_PTR)OpenFile(gmDlsPaths[i], &reOpenBuff, OF_READ); 20 | } 21 | 22 | auto gmDlsFileSize = GetFileSize(gmDlsFile, NULL); 23 | auto gmDls = new unsigned char[gmDlsFileSize]; 24 | unsigned int bytesRead; 25 | ReadFile(gmDlsFile, gmDls, gmDlsFileSize, (LPDWORD)&bytesRead, NULL); 26 | CloseHandle(gmDlsFile); 27 | 28 | return gmDls; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WaveSabreCore/src/MxcsrFlagGuard.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | namespace WaveSabreCore 7 | { 8 | MxcsrFlagGuard::MxcsrFlagGuard() 9 | { 10 | mxcsrRestore = _mm_getcsr(); 11 | 12 | // Set SSE FTZ and DAZ flags 13 | _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); 14 | _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); 15 | } 16 | 17 | MxcsrFlagGuard::~MxcsrFlagGuard() 18 | { 19 | _mm_setcsr(mxcsrRestore); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /WaveSabreCore/src/ResampleBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace WaveSabreCore 6 | { 7 | ResampleBuffer::ResampleBuffer(float lengthMs) 8 | { 9 | buffer = nullptr; 10 | SetLength(lengthMs); 11 | } 12 | 13 | ResampleBuffer::~ResampleBuffer() 14 | { 15 | if (buffer) delete [] buffer; 16 | } 17 | 18 | void ResampleBuffer::SetLength(float lengthMs) 19 | { 20 | int newLength = (int)((double)lengthMs * Helpers::CurrentSampleRate / 1000.0); 21 | SetLengthSamples(newLength); 22 | } 23 | 24 | void ResampleBuffer::SetLengthSamples(int samples) 25 | { 26 | if (samples < 1) samples = 1; 27 | if (samples != length || !buffer) 28 | { 29 | auto newBuffer = new float[samples]; 30 | for (int i = 0; i < samples; i++) newBuffer[i] = 0.0f; 31 | currentPosition = 0; 32 | auto oldBuffer = buffer; 33 | buffer = newBuffer; 34 | length = samples; 35 | if (oldBuffer) delete[] oldBuffer; 36 | } 37 | } 38 | 39 | void ResampleBuffer::WriteSample(float sample) 40 | { 41 | buffer[currentPosition] = sample; 42 | currentPosition = currentPosition - 1; 43 | if (currentPosition < 0) 44 | { 45 | currentPosition = length - 1; 46 | } 47 | } 48 | 49 | float ResampleBuffer::ReadPosition(float position) const 50 | { 51 | int samplePos = (currentPosition + (int)position) % length; // actual sample position determined 52 | float fraction = position - floorf(position); // fractional 53 | 54 | float s0 = buffer[samplePos]; 55 | float s1 = (samplePos > 0) ? buffer[samplePos - 1] : buffer[length - 1]; 56 | return s0 + fraction * (s1 - s0); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /WaveSabreCore/src/StateVariableFilter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace WaveSabreCore 8 | { 9 | StateVariableFilter::StateVariableFilter() 10 | { 11 | recalculate = true; 12 | 13 | type = StateVariableFilterType::Lowpass; 14 | freq = 20.0f; 15 | q = 1.0f; 16 | 17 | lastInput = 0.0f; 18 | low = band = 0.0f; 19 | } 20 | 21 | float StateVariableFilter::Next(float input) 22 | { 23 | if (recalculate) 24 | { 25 | f = (float)(1.5 * Helpers::FastSin(3.141592 * (double)freq / 2.0 / Helpers::CurrentSampleRate)); 26 | 27 | recalculate = false; 28 | } 29 | 30 | float ret = (run((lastInput + input) / 2.0f) + run(input)) / 2.0f; 31 | lastInput = input; 32 | return ret; 33 | } 34 | 35 | void StateVariableFilter::SetType(StateVariableFilterType type) 36 | { 37 | if (type == this->type) 38 | return; 39 | 40 | this->type = type; 41 | recalculate = true; 42 | } 43 | 44 | void StateVariableFilter::SetFreq(float freq) 45 | { 46 | if (freq == this->freq) 47 | return; 48 | 49 | this->freq = freq; 50 | recalculate = true; 51 | } 52 | 53 | void StateVariableFilter::SetQ(float q) 54 | { 55 | if (q == this->q) 56 | return; 57 | 58 | this->q = q; 59 | recalculate = true; 60 | } 61 | 62 | float StateVariableFilter::run(float input) 63 | { 64 | low = low + f * band; 65 | float high = q * (input - band) - low; 66 | band = band + f * high; 67 | switch (type) 68 | { 69 | case StateVariableFilterType::Lowpass: 70 | default: 71 | return low; 72 | 73 | case StateVariableFilterType::Highpass: return high; 74 | case StateVariableFilterType::Bandpass: return band; 75 | case StateVariableFilterType::Notch: return low + high; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(WaveSabrePlayerLib 2 | include/WaveSabrePlayerLib/CriticalSection.h 3 | include/WaveSabrePlayerLib/PreRenderPlayer.h 4 | include/WaveSabrePlayerLib/WavWriter.h 5 | include/WaveSabrePlayerLib/DirectSoundRenderThread.h 6 | include/WaveSabrePlayerLib/RealtimePlayer.h 7 | include/WaveSabrePlayerLib/IPlayer.h 8 | include/WaveSabrePlayerLib/SongRenderer.h 9 | src/CriticalSection.cpp 10 | src/DirectSoundRenderThread.cpp 11 | src/IPlayer.cpp 12 | src/PreRenderPlayer.cpp 13 | src/RealtimePlayer.cpp 14 | src/SongRenderer.cpp 15 | src/SongRenderer.Track.cpp 16 | src/WavWriter.cpp) 17 | 18 | target_link_libraries(WaveSabrePlayerLib 19 | WaveSabreCore 20 | winmm.lib 21 | dsound.lib) 22 | 23 | target_include_directories(WaveSabrePlayerLib PUBLIC include) 24 | 25 | if(MSVC) 26 | target_compile_definitions(WaveSabrePlayerLib PRIVATE _CRT_SECURE_NO_WARNINGS) 27 | target_compile_options(WaveSabrePlayerLib PUBLIC 28 | $<$:/EHs-c->) 29 | set_property(TARGET WaveSabrePlayerLib APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS_MINSIZEREL 30 | " /LTCG") 31 | endif() 32 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_H__ 2 | #define __WAVESABREPLAYERLIB_H__ 3 | 4 | #include "WaveSabrePlayerLib/IPlayer.h" 5 | #include "WaveSabrePlayerLib/RealtimePlayer.h" 6 | #include "WaveSabrePlayerLib/PreRenderPlayer.h" 7 | #include "WaveSabrePlayerLib/WavWriter.h" 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/CriticalSection.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_CRITICALSECTION__ 2 | #define __WAVESABREPLAYERLIB_CRITICALSECTION__ 3 | 4 | #include 5 | 6 | namespace WaveSabrePlayerLib 7 | { 8 | class CriticalSection 9 | { 10 | public: 11 | class CriticalSectionGuard 12 | { 13 | public: 14 | CriticalSectionGuard(CriticalSection *criticalSection); 15 | ~CriticalSectionGuard(); 16 | 17 | private: 18 | CriticalSection *criticalSection; 19 | }; 20 | 21 | CriticalSection(); 22 | ~CriticalSection(); 23 | 24 | CriticalSectionGuard Enter(); 25 | 26 | private: 27 | CRITICAL_SECTION criticalSection; 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/DirectSoundRenderThread.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_DIRECTSOUNDRENDERTHREAD_H__ 2 | #define __WAVESABREPLAYERLIB_DIRECTSOUNDRENDERTHREAD_H__ 3 | 4 | #include "SongRenderer.h" 5 | #include "CriticalSection.h" 6 | 7 | #include 8 | #include 9 | 10 | namespace WaveSabrePlayerLib 11 | { 12 | class DirectSoundRenderThread 13 | { 14 | public: 15 | typedef void (*RenderCallback)(SongRenderer::Sample *buffer, int numSamples, void *data); 16 | 17 | DirectSoundRenderThread(RenderCallback callback, void *callbackData, int sampleRate, int bufferSizeMs = 1000); 18 | ~DirectSoundRenderThread(); 19 | 20 | double GetPlayPositionMs(); 21 | 22 | private: 23 | static DWORD WINAPI threadProc(LPVOID lpParameter); 24 | 25 | RenderCallback callback; 26 | void *callbackData; 27 | int sampleRate; 28 | int bufferSizeMs; 29 | int bufferSizeBytes; 30 | 31 | HANDLE thread; 32 | CriticalSection criticalSection; 33 | CriticalSection playPositionCriticalSection; 34 | bool shutdown; 35 | 36 | int oldPlayCursorPos; 37 | double bytesRendered; 38 | LPDIRECTSOUNDBUFFER buffer; 39 | }; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/IPlayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_IPLAYER_H__ 2 | #define __WAVESABREPLAYERLIB_IPLAYER_H__ 3 | 4 | namespace WaveSabrePlayerLib 5 | { 6 | class IPlayer 7 | { 8 | public: 9 | virtual ~IPlayer(); 10 | 11 | virtual void Play() = 0; 12 | 13 | virtual int GetTempo() const = 0; 14 | virtual int GetSampleRate() const = 0; 15 | virtual double GetLength() const = 0; 16 | virtual double GetSongPos() const = 0; 17 | }; 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/PreRenderPlayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_PRERENDERPLAYER_H__ 2 | #define __WAVESABREPLAYERLIB_PRERENDERPLAYER_H__ 3 | 4 | #include "IPlayer.h" 5 | #include "SongRenderer.h" 6 | #include "DirectSoundRenderThread.h" 7 | 8 | namespace WaveSabrePlayerLib 9 | { 10 | class PreRenderPlayer : public IPlayer 11 | { 12 | public: 13 | typedef void (*ProgressCallback)(double progress, void *data); 14 | 15 | PreRenderPlayer(const SongRenderer::Song *song, int numRenderThreads, ProgressCallback callback, void *data, int playbackBufferSizeMs = 100); 16 | virtual ~PreRenderPlayer(); 17 | 18 | virtual void Play(); 19 | 20 | virtual int GetTempo() const; 21 | virtual int GetSampleRate() const; 22 | virtual double GetLength() const; 23 | virtual double GetSongPos() const; 24 | 25 | private: 26 | static void renderCallback(SongRenderer::Sample *buffer, int numSamples, void *data); 27 | 28 | int tempo; 29 | int sampleRate; 30 | double length; 31 | 32 | int renderBufferSize; 33 | SongRenderer::Sample *renderBuffer; 34 | 35 | int playbackBufferSizeMs; 36 | int playbackBufferIndex; 37 | 38 | DirectSoundRenderThread *renderThread; 39 | }; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/RealtimePlayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_REALTIMEPLAYER_H__ 2 | #define __WAVESABREPLAYERLIB_REALTIMEPLAYER_H__ 3 | 4 | #include "IPlayer.h" 5 | #include "SongRenderer.h" 6 | #include "DirectSoundRenderThread.h" 7 | 8 | namespace WaveSabrePlayerLib 9 | { 10 | class RealtimePlayer : public IPlayer 11 | { 12 | public: 13 | RealtimePlayer(const SongRenderer::Song *song, int numRenderThreads, int bufferSizeMs = 1000); 14 | virtual ~RealtimePlayer(); 15 | 16 | virtual void Play(); 17 | 18 | virtual int GetTempo() const; 19 | virtual int GetSampleRate() const; 20 | virtual double GetLength() const; 21 | virtual double GetSongPos() const; 22 | 23 | private: 24 | static void renderCallback(SongRenderer::Sample *buffer, int numSamples, void *data); 25 | 26 | const SongRenderer::Song *song; 27 | int numRenderThreads; 28 | int bufferSizeMs; 29 | 30 | SongRenderer *songRenderer; 31 | DirectSoundRenderThread *renderThread; 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/include/WaveSabrePlayerLib/WavWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREPLAYERLIB_WAVWRITER_H__ 2 | #define __WAVESABREPLAYERLIB_WAVWRITER_H__ 3 | 4 | #include 5 | 6 | #include "SongRenderer.h" 7 | 8 | namespace WaveSabrePlayerLib 9 | { 10 | class WavWriter 11 | { 12 | public: 13 | typedef void (*ProgressCallback)(double progress, void *data); 14 | 15 | WavWriter(const SongRenderer::Song *song, int numRenderThreads); 16 | ~WavWriter(); 17 | 18 | void Write(const char *fileName, ProgressCallback callback, void *data); 19 | 20 | private: 21 | static void writeInt(int i, FILE *file); 22 | static void writeShort(short s, FILE *file); 23 | 24 | SongRenderer *songRenderer; 25 | }; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/src/CriticalSection.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace WaveSabrePlayerLib 4 | { 5 | CriticalSection::CriticalSectionGuard::CriticalSectionGuard(CriticalSection *criticalSection) 6 | : criticalSection(criticalSection) 7 | { 8 | EnterCriticalSection(&criticalSection->criticalSection); 9 | } 10 | 11 | CriticalSection::CriticalSectionGuard::~CriticalSectionGuard() 12 | { 13 | LeaveCriticalSection(&criticalSection->criticalSection); 14 | } 15 | 16 | CriticalSection::CriticalSection() 17 | { 18 | InitializeCriticalSection(&criticalSection); 19 | } 20 | 21 | CriticalSection::~CriticalSection() 22 | { 23 | DeleteCriticalSection(&criticalSection); 24 | } 25 | 26 | CriticalSection::CriticalSectionGuard CriticalSection::Enter() 27 | { 28 | return CriticalSectionGuard(this); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/src/IPlayer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace WaveSabrePlayerLib 4 | { 5 | IPlayer::~IPlayer() 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/src/PreRenderPlayer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace WaveSabrePlayerLib 4 | { 5 | PreRenderPlayer::PreRenderPlayer(const SongRenderer::Song *song, int numRenderThreads, ProgressCallback callback, void *data, int playbackBufferSizeMs) 6 | { 7 | SongRenderer songRenderer(song, numRenderThreads); 8 | 9 | tempo = songRenderer.GetTempo(); 10 | sampleRate = songRenderer.GetSampleRate(); 11 | length = songRenderer.GetLength(); 12 | 13 | const int stepSize = 100 * SongRenderer::NumChannels; 14 | renderBufferSize = (int)((double)(sampleRate * SongRenderer::NumChannels) * songRenderer.GetLength()) / stepSize * stepSize; 15 | renderBuffer = new SongRenderer::Sample[renderBufferSize]; 16 | 17 | int stepCounter = 0; 18 | 19 | for (int i = 0; i < renderBufferSize; i += stepSize) 20 | { 21 | songRenderer.RenderSamples(renderBuffer + i, stepSize); 22 | 23 | stepCounter--; 24 | if (stepCounter <= 0) 25 | { 26 | if (callback) 27 | { 28 | double progress = (double)i / (double)renderBufferSize; 29 | callback(progress, data); 30 | } 31 | stepCounter = 200; 32 | } 33 | } 34 | 35 | if (callback) 36 | callback(1.0, data); 37 | 38 | this->playbackBufferSizeMs = playbackBufferSizeMs; 39 | 40 | renderThread = nullptr; 41 | } 42 | 43 | PreRenderPlayer::~PreRenderPlayer() 44 | { 45 | if (renderThread) 46 | delete renderThread; 47 | 48 | delete [] renderBuffer; 49 | } 50 | 51 | void PreRenderPlayer::Play() 52 | { 53 | if (renderThread) 54 | delete renderThread; 55 | 56 | playbackBufferIndex = 0; 57 | 58 | renderThread = new DirectSoundRenderThread(renderCallback, this, sampleRate, playbackBufferSizeMs); 59 | } 60 | 61 | int PreRenderPlayer::GetTempo() const 62 | { 63 | return tempo; 64 | } 65 | 66 | int PreRenderPlayer::GetSampleRate() const 67 | { 68 | return sampleRate; 69 | } 70 | 71 | double PreRenderPlayer::GetLength() const 72 | { 73 | return length; 74 | } 75 | 76 | double PreRenderPlayer::GetSongPos() const 77 | { 78 | if (!renderThread) 79 | return 0.0; 80 | 81 | return max((renderThread->GetPlayPositionMs() - (double)playbackBufferSizeMs) / 1000.0, 0.0); 82 | } 83 | 84 | void PreRenderPlayer::renderCallback(SongRenderer::Sample *buffer, int numSamples, void *data) 85 | { 86 | auto player = (PreRenderPlayer *)data; 87 | 88 | int samplesLeft = player->renderBufferSize - player->playbackBufferIndex; 89 | if (!samplesLeft) 90 | { 91 | memset(buffer, 0, numSamples * sizeof(SongRenderer::Sample)); 92 | return; 93 | } 94 | 95 | int samplesToTake = min(numSamples, samplesLeft); 96 | if (samplesToTake) 97 | { 98 | memcpy(buffer, player->renderBuffer + player->playbackBufferIndex, samplesToTake * sizeof(SongRenderer::Sample)); 99 | player->playbackBufferIndex += samplesToTake; 100 | } 101 | if (samplesToTake < numSamples) 102 | { 103 | int remainingSamples = numSamples - samplesToTake; 104 | memset(buffer + samplesToTake, 0, remainingSamples * sizeof(SongRenderer::Sample)); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/src/RealtimePlayer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace WaveSabrePlayerLib 4 | { 5 | RealtimePlayer::RealtimePlayer(const SongRenderer::Song *song, int numRenderThreads, int bufferSizeMs) 6 | : song(song) 7 | , numRenderThreads(numRenderThreads) 8 | , bufferSizeMs(bufferSizeMs) 9 | , songRenderer(new SongRenderer(song, numRenderThreads)) 10 | , renderThread(nullptr) 11 | { 12 | } 13 | 14 | RealtimePlayer::~RealtimePlayer() 15 | { 16 | if (renderThread) 17 | delete renderThread; 18 | if (songRenderer) 19 | delete songRenderer; 20 | } 21 | 22 | void RealtimePlayer::Play() 23 | { 24 | if (renderThread) 25 | delete renderThread; 26 | if (songRenderer) 27 | delete songRenderer; 28 | 29 | songRenderer = new SongRenderer(song, numRenderThreads); 30 | renderThread = new DirectSoundRenderThread(renderCallback, this, songRenderer->GetSampleRate(), bufferSizeMs); 31 | } 32 | 33 | int RealtimePlayer::GetTempo() const 34 | { 35 | return songRenderer->GetTempo(); 36 | } 37 | 38 | int RealtimePlayer::GetSampleRate() const 39 | { 40 | return songRenderer->GetSampleRate(); 41 | } 42 | 43 | double RealtimePlayer::GetLength() const 44 | { 45 | return songRenderer->GetLength(); 46 | } 47 | 48 | double RealtimePlayer::GetSongPos() const 49 | { 50 | if (!renderThread) 51 | return 0.0; 52 | 53 | return max((renderThread->GetPlayPositionMs() - (double)bufferSizeMs) / 1000.0, 0.0); 54 | } 55 | 56 | void RealtimePlayer::renderCallback(SongRenderer::Sample *buffer, int numSamples, void *data) 57 | { 58 | auto player = (RealtimePlayer *)data; 59 | const int stepSize = 100 * SongRenderer::NumChannels; 60 | for (int i = 0; i < numSamples; i += stepSize) 61 | player->songRenderer->RenderSamples(buffer + i, min(numSamples - i, stepSize)); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /WaveSabrePlayerLib/src/WavWriter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | namespace WaveSabrePlayerLib 6 | { 7 | WavWriter::WavWriter(const SongRenderer::Song *song, int numRenderThreads) 8 | { 9 | songRenderer = new SongRenderer(song, numRenderThreads); 10 | } 11 | 12 | WavWriter::~WavWriter() 13 | { 14 | delete songRenderer; 15 | } 16 | 17 | void WavWriter::Write(const char *fileName, ProgressCallback callback, void *data) 18 | { 19 | int sampleRate = songRenderer->GetSampleRate(); 20 | const int bitsPerSample = sizeof(SongRenderer::Sample) * 8; 21 | 22 | const int stepSize = 100 * SongRenderer::NumChannels; 23 | int numSamples = (int)((double)(sampleRate * SongRenderer::NumChannels) * songRenderer->GetLength()) / stepSize * stepSize; 24 | 25 | auto file = fopen(fileName, "wb"); 26 | 27 | int dataSubChunkSize = numSamples * bitsPerSample / 8; 28 | 29 | // RIFF header 30 | fputs("RIFF", file); 31 | writeInt(36 + dataSubChunkSize, file); 32 | fputs("WAVE", file); 33 | 34 | // format subchunk 35 | fputs("fmt ", file); 36 | writeInt(16, file); 37 | writeShort(WAVE_FORMAT_PCM, file); 38 | writeShort(SongRenderer::NumChannels, file); 39 | writeInt(sampleRate, file); 40 | writeInt(sampleRate * SongRenderer::NumChannels * bitsPerSample / 8, file); 41 | writeShort(SongRenderer::NumChannels * bitsPerSample / 8, file); 42 | writeShort(bitsPerSample, file); 43 | 44 | // data subchunk 45 | fputs("data", file); 46 | writeInt(dataSubChunkSize, file); 47 | 48 | int stepCounter = 0; 49 | 50 | SongRenderer::Sample buf[stepSize]; 51 | for (int i = 0; i < numSamples; i += stepSize) 52 | { 53 | songRenderer->RenderSamples(buf, stepSize); 54 | for (int j = 0; j < stepSize; j++) writeShort(buf[j], file); 55 | 56 | stepCounter--; 57 | if (stepCounter <= 0) 58 | { 59 | if (callback) 60 | { 61 | double progress = (double)i / (double)numSamples; 62 | callback(progress, data); 63 | } 64 | stepCounter = 200; 65 | } 66 | } 67 | 68 | fclose(file); 69 | 70 | if (callback) 71 | callback(1.0, data); 72 | } 73 | 74 | void WavWriter::writeInt(int i, FILE *file) 75 | { 76 | fwrite(&i, sizeof(int), 1, file); 77 | } 78 | 79 | void WavWriter::writeShort(short s, FILE *file) 80 | { 81 | fwrite(&s, sizeof(short), 1, file); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /WaveSabreStandAlonePlayer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(WaveSabreStandAlonePlayer main.cpp) 2 | target_link_libraries(WaveSabreStandAlonePlayer WaveSabrePlayerLib) 3 | 4 | if(MSVC) 5 | target_compile_definitions(WaveSabreStandAlonePlayer PRIVATE _CRT_SECURE_NO_WARNINGS) 6 | 7 | target_link_libraries(WaveSabreStandAlonePlayer $<$:msvcrt>) 8 | set_property(TARGET WaveSabreStandAlonePlayer APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL 9 | " /NODEFAULTLIB /SAFESEH:NO /MANIFEST:NO /LTCG /OPT:REF /OPT:ICF /DYNAMICBASE:NO") 10 | 11 | if(MSVC_VERSION GREATER 1900) 12 | target_compile_definitions(WaveSabreStandAlonePlayer PRIVATE 13 | $<$:_NO_CRT_STDIO_INLINE>) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /WaveSabreVstLib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(WaveSabreVstLib STATIC 2 | ${VSTSDK3_DIR}/public.sdk/source/vst2.x/audioeffect.cpp 3 | ${VSTSDK3_DIR}/public.sdk/source/vst2.x/audioeffectx.cpp 4 | ${VSTSDK3_DIR}/public.sdk/source/vst2.x/vstplugmain.cpp 5 | ${VSTSDK3_DIR}/vstgui.sf/libpng/png.c 6 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngerror.c 7 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pnggccrd.c 8 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngget.c 9 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngmem.c 10 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngpread.c 11 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngread.c 12 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngrio.c 13 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngrtran.c 14 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngrutil.c 15 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngset.c 16 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngtrans.c 17 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngvcrd.c 18 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngwio.c 19 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngwrite.c 20 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngwtran.c 21 | ${VSTSDK3_DIR}/vstgui.sf/libpng/pngwutil.c 22 | ${VSTSDK3_DIR}/vstgui.sf/vstgui/aeffguieditor.cpp 23 | ${VSTSDK3_DIR}/vstgui.sf/vstgui/cfileselector.cpp 24 | ${VSTSDK3_DIR}/vstgui.sf/vstgui/vstcontrols.cpp 25 | ${VSTSDK3_DIR}/vstgui.sf/vstgui/vstgui.cpp 26 | ${VSTSDK3_DIR}/vstgui.sf/vstgui/vstguidebug.cpp 27 | ${VSTSDK3_DIR}/vstgui.sf/zlib/adler32.c 28 | ${VSTSDK3_DIR}/vstgui.sf/zlib/compress.c 29 | ${VSTSDK3_DIR}/vstgui.sf/zlib/crc32.c 30 | ${VSTSDK3_DIR}/vstgui.sf/zlib/deflate.c 31 | ${VSTSDK3_DIR}/vstgui.sf/zlib/gzio.c 32 | ${VSTSDK3_DIR}/vstgui.sf/zlib/infback.c 33 | ${VSTSDK3_DIR}/vstgui.sf/zlib/inffast.c 34 | ${VSTSDK3_DIR}/vstgui.sf/zlib/inflate.c 35 | ${VSTSDK3_DIR}/vstgui.sf/zlib/inftrees.c 36 | ${VSTSDK3_DIR}/vstgui.sf/zlib/minigzip.c 37 | ${VSTSDK3_DIR}/vstgui.sf/zlib/trees.c 38 | ${VSTSDK3_DIR}/vstgui.sf/zlib/uncompr.c 39 | ${VSTSDK3_DIR}/vstgui.sf/zlib/zutil.c 40 | include/WaveSabreVstLib.h 41 | src/ImageManager.cpp 42 | src/NoTextCOptionMenu.cpp 43 | src/VstEditor.cpp 44 | src/VstPlug.cpp) 45 | 46 | target_include_directories(WaveSabreVstLib PUBLIC 47 | include 48 | ../WaveSabreCore/include 49 | ${VSTSDK3_DIR}/vstgui.sf/zlib 50 | ${VSTSDK3_DIR}/vstgui.sf/libpng 51 | ${VSTSDK3_DIR}/public.sdk/source/vst2.x 52 | ${VSTSDK3_DIR}) 53 | 54 | target_compile_definitions(WaveSabreVstLib PUBLIC USE_LIBPNG) 55 | 56 | if(MSVC) 57 | target_compile_definitions(WaveSabreVstLib PUBLIC _CRT_SECURE_NO_WARNINGS) 58 | target_compile_options(WaveSabreVstLib PUBLIC /EHsc) 59 | set_source_files_properties(${VSTSDK3_DIR}/vstgui.sf/vstgui/vstgui.cpp 60 | ${VSTSDK3_DIR}/vstgui.sf/zlib/minigzip.c 61 | PROPERTIES COMPILE_OPTIONS /wd4996) 62 | endif() 63 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREVSTLIB_H__ 2 | #define __WAVESABREVSTLIB_H__ 3 | 4 | #include "WaveSabreVstLib/VstPlug.h" 5 | #include "WaveSabreVstLib/VstEditor.h" 6 | 7 | #include "WaveSabreVstLib/ImageManager.h" 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib/Common.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREVSTLIB_COMMON_H__ 2 | #define __WAVESABREVSTLIB_COMMON_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "public.sdk/source/vst2.x/audioeffectx.h" 9 | #include "vstgui.sf/vstgui/aeffguieditor.h" 10 | #include "vstgui.sf/vstgui/vstgui.h" 11 | #include "vstgui.sf/vstgui/cfileselector.h" 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib/ImageManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREVSTLIB_IMAGEMANAGER_H__ 2 | #define __WAVESABREVSTLIB_IMAGEMANAGER_H__ 3 | 4 | #include "Common.h" 5 | 6 | namespace WaveSabreVstLib 7 | { 8 | class ImageManager 9 | { 10 | public: 11 | enum class ImageIds 12 | { 13 | Background, 14 | Knob1, 15 | TinyButton, 16 | OptionMenuUnpressed, 17 | OptionMenuPressed 18 | }; 19 | 20 | static CBitmap *Get(ImageIds imageId); 21 | 22 | private: 23 | ~ImageManager(); 24 | 25 | static ImageManager *get(); 26 | 27 | std::map bitmaps; 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib/NoTextCOptionMenu.h: -------------------------------------------------------------------------------- 1 | #ifndef __NOTEXTCOPTIONMENU_H__ 2 | #define __NOTEXTCOPTIONMENU_H__ 3 | 4 | #include "Common.h" 5 | 6 | namespace WaveSabreVstLib 7 | { 8 | class NoTextCOptionMenu : public COptionMenu 9 | { 10 | public: 11 | NoTextCOptionMenu(const CRect& size, CControlListener *listener, long tag, CBitmap *background = 0, CBitmap *bgWhenClick = 0, const long style = 0); 12 | NoTextCOptionMenu(const NoTextCOptionMenu& v); 13 | virtual ~NoTextCOptionMenu(); 14 | 15 | virtual void draw(CDrawContext *pContext); 16 | }; 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib/VstEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREVSTLIB_VSTEDITOR_H__ 2 | #define __WAVESABREVSTLIB_VSTEDITOR_H__ 3 | 4 | #include "Common.h" 5 | #include "ImageManager.h" 6 | #include "NoTextCOptionMenu.h" 7 | 8 | namespace WaveSabreVstLib 9 | { 10 | class VstEditor : public AEffGUIEditor, public CControlListener 11 | { 12 | public: 13 | VstEditor(AudioEffect *audioEffect, int width, int height, std::string title); 14 | virtual ~VstEditor(); 15 | 16 | virtual void Open(); 17 | virtual void Close(); 18 | 19 | virtual void setParameter(VstInt32 index, float value); 20 | virtual void valueChanged(CControl *control); 21 | 22 | virtual bool open(void *ptr); 23 | virtual void close(); 24 | 25 | protected: 26 | void startNextRow(); 27 | 28 | CTextLabel *addTextLabel(int x, int y, int w, int h, std::string text, CFontRef fontId = kNormalFontVeryBig, CHoriTxtAlign textAlign = kLeftText); 29 | 30 | CAnimKnob *addKnob(VstInt32 param, std::string caption); 31 | CKickButton *addButton(VstInt32 param, std::string caption); 32 | NoTextCOptionMenu *addOptionMenu(std::string caption); 33 | 34 | void addSpacer(); 35 | 36 | private: 37 | std::string title; 38 | int currentX, currentY, currentRow; 39 | int maxX; 40 | 41 | std::map controls; 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /WaveSabreVstLib/include/WaveSabreVstLib/VstPlug.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVESABREVSTLIB_VSTPLUG_H__ 2 | #define __WAVESABREVSTLIB_VSTPLUG_H__ 3 | 4 | #include "audioeffectx.h" 5 | #include "VstEditor.h" 6 | 7 | #include 8 | 9 | namespace WaveSabreVstLib 10 | { 11 | class VstPlug : public AudioEffectX 12 | { 13 | public: 14 | VstPlug(audioMasterCallback audioMaster, int numParams, int numInputs, int numOutputs, VstInt32 id, WaveSabreCore::Device *device, bool synth = false); 15 | virtual ~VstPlug(); 16 | 17 | virtual void processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames); 18 | virtual VstInt32 processEvents(VstEvents *ev); 19 | 20 | virtual void setProgramName(char *name); 21 | virtual void getProgramName(char *name); 22 | 23 | virtual void setSampleRate(float sampleRate); 24 | virtual void setTempo(int tempo); 25 | 26 | virtual void setParameter(VstInt32 index, float value); 27 | virtual float getParameter(VstInt32 index); 28 | virtual void getParameterLabel(VstInt32 index, char *label); 29 | virtual void getParameterDisplay(VstInt32 index, char *text); 30 | virtual void getParameterName(VstInt32 index, char *text); 31 | 32 | virtual VstInt32 getChunk(void **data, bool isPreset); 33 | virtual VstInt32 setChunk(void *data, VstInt32 byteSize, bool isPreset); 34 | 35 | virtual bool getEffectName(char *name); 36 | virtual bool getVendorString(char *text); 37 | virtual bool getProductString(char *text); 38 | virtual VstInt32 getVendorVersion(); 39 | 40 | virtual VstInt32 canDo(char *text); 41 | virtual VstInt32 getNumMidiInputChannels(); 42 | 43 | protected: 44 | void setEditor(VstEditor *editor); 45 | WaveSabreCore::Device *getDevice() const; 46 | 47 | private: 48 | int numParams, numInputs, numOutputs; 49 | bool synth; 50 | 51 | char programName[kVstMaxProgNameLen + 1]; 52 | 53 | WaveSabreCore::Device *device; 54 | }; 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /WaveSabreVstLib/src/ImageManager.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "../../Data/resource.h" 5 | 6 | using namespace std; 7 | 8 | namespace WaveSabreVstLib 9 | { 10 | CBitmap *ImageManager::Get(ImageIds imageId) 11 | { 12 | ImageManager *im = get(); 13 | 14 | auto ret = im->bitmaps.find(imageId); 15 | if (ret != im->bitmaps.end()) return ret->second; 16 | 17 | CBitmap *b; 18 | switch (imageId) 19 | { 20 | case ImageIds::Background: b = new CBitmap(IDB_PNG1); break; 21 | case ImageIds::Knob1: b = new CBitmap(IDB_PNG2); break; 22 | case ImageIds::TinyButton: b = new CBitmap(IDB_PNG3); break; 23 | case ImageIds::OptionMenuUnpressed: b = new CBitmap(IDB_PNG4); break; 24 | case ImageIds::OptionMenuPressed: b = new CBitmap(IDB_PNG5); break; 25 | } 26 | b->remember(); 27 | im->bitmaps.emplace(imageId, b); 28 | return b; 29 | } 30 | 31 | ImageManager::~ImageManager() 32 | { 33 | for (auto i = bitmaps.begin(); i != bitmaps.end(); i++) 34 | i->second->forget(); 35 | } 36 | 37 | ImageManager *ImageManager::get() 38 | { 39 | static ImageManager im; 40 | 41 | return &im; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /WaveSabreVstLib/src/NoTextCOptionMenu.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace WaveSabreVstLib 4 | { 5 | NoTextCOptionMenu::NoTextCOptionMenu(const CRect& size, CControlListener *listener, long tag, CBitmap *background, CBitmap *bgWhenClick, const long style) 6 | : COptionMenu(size, listener, tag, background, bgWhenClick, style) 7 | { 8 | } 9 | 10 | NoTextCOptionMenu::NoTextCOptionMenu(const NoTextCOptionMenu& v) 11 | : COptionMenu(v) 12 | { 13 | } 14 | 15 | NoTextCOptionMenu::~NoTextCOptionMenu() 16 | { 17 | } 18 | 19 | void NoTextCOptionMenu::draw(CDrawContext *pContext) 20 | { 21 | drawText(pContext, NULL, getFrame()->getFocusView() == this ? bgWhenClick : 0); 22 | } 23 | } 24 | --------------------------------------------------------------------------------