Skip to content

Fix parsing problems with FL Studio 20.9 project files. #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '{build}'
image:
- Visual Studio 2013
- Visual Studio 2017
- Visual Studio 2019
- Visual Studio 2022

platform:
- Win32
Expand All @@ -14,15 +14,15 @@ cache:
install:
- ps: |
if (-Not (Test-Path "C:\tmp\VST3 SDK")) {
Invoke-WebRequest "https://web.archive.org/web/20200502121517/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip"
Invoke-WebRequest "https://web.archive.org/web/20200502121517if_/https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip"
Expand-Archive "vstsdk.zip" "C:\tmp"
}

build_script:
# build native code/tests
- mkdir build
- cd build
- cmake -DCMAKE_GENERATOR_PLATFORM=%PLATFORM% -DVSTSDK3_DIR="C:/tmp/VST3 SDK" ..
- cmake -DCMAKE_GENERATOR_PLATFORM=%PLATFORM% -DVSTSDK3_DIR="C:/tmp/VST3 SDK" -DDOWNLOAD_MONAD_FL_PARSER=ON -DMONAD_FL_PARSER_DIR="C:/tmp/Monad.FLParser" ..
- msbuild /v:minimal /nologo WaveSabre.sln
- msbuild /v:minimal /nologo /property:Configuration="MinSizeRel" WaveSabre.sln
- cd ..
Expand Down
33 changes: 31 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ project("WaveSabre" LANGUAGES C CXX CSharp)
# Enable C# Utilities also for the VS2013 AppVeyor stage.
cmake_policy(SET CMP0057 NEW)
include(CSharpUtilities)
set(CMAKE_CSharp_FLAGS ${CMAKE_CSharp_FLAGS} "/langversion:6")

# Note: The space suffix is required for the flag to work correctly.
set(CMAKE_CSharp_FLAGS "/langversion:latest ")

find_package(Git REQUIRED)
include(ExternalProject)

cmake_minimum_required(VERSION 3.11)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand All @@ -18,7 +23,8 @@ set(BUILD_WAVESABRE_CONVERT ON CACHE BOOL "Do not build WaveSabreConvert.")
set(BUILD_WAVESABRE_CONVERT_TESTS ON CACHE BOOL "Do not build the WaveSabreConvert tests.")
set(BUILD_CONVERT_THE_FUCK ON CACHE BOOL "Do not build ConvertTheFuck.")
set(BUILD_PROJECT_MANAGER ON CACHE BOOL "Do not build the project manager.")
set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location")
set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location.")
set(MONAD_FL_PARSER_DIR "${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser.Source" CACHE PATH "Monad FL parser location.")

# Download and unpack VST3 SDK
set(DOWNLOAD_VST3SDK OFF CACHE BOOL "Download and unpack VST3 SDK automatically.")
Expand All @@ -33,6 +39,29 @@ if(${BUILD_VST_PLUGINS} AND ${DOWNLOAD_VST3SDK})
endif()
endif()

# Download and unpack the Monad FL Parser
set(DOWNLOAD_MONAD_FL_PARSER OFF CACHE BOOL "Download the Monad FL parser binary automatically.")
if(${BUILD_WAVESABRE_CONVERT} AND ${DOWNLOAD_MONAD_FL_PARSER})
set(MONAD_FL_PARSER_BINARY ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser/Release/Monad.FLParser.dll)
find_file(MONAD_FL_PARSER_TEST NAME Project.cs HINTS ${MONAD_FL_PARSER_DIR})
if(${MONAD_FL_PARSER_TEST} MATCHES MONAD_FL_PARSER_TEST-NOTFOUND)
message(STATUS "Monad FL parser not found. Will download.")
ExternalProject_Add(FLParser
SOURCE_DIR ${MONAD_FL_PARSER_DIR}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser
GIT_REPOSITORY https://github.com/Kwarf/FLParser.git
GIT_TAG c9b0bc5
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} ${PROJECT_SOURCE_DIR}/WaveSabreConvert/FLParser -DMONAD_FL_PARSER_DIR=${MONAD_FL_PARSER_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser --config Release -- -m
INSTALL_COMMAND ""
)
endif()
elseif(${BUILD_WAVESABRE_CONVERT})
message(STATUS "Using existent FL parser repo.")
add_subdirectory(WaveSabreConvert/FLParser)
set(MONAD_FL_PARSER_BINARY ${CMAKE_CURRENT_BINARY_DIR}/WaveSabreConvert/FLParser/Release/Monad.FLParser.dll)
endif()

# shared code
add_subdirectory(MSVCRT)
add_subdirectory(WaveSabreCore)
Expand Down
3 changes: 3 additions & 0 deletions Docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- WaveSabre builds have only been tested with Visual Studio 2013/2015/2017/2019 and version 3.6.6 of the VST3 SDK.
- 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).
- For the same reasons, you should [download](https://github.com/Kwarf/FLParser) the Monad FL parser source yourself. You can also let CMake download the Monad FL parser automatically for you; see below for the command line options to use for this.

### CMake

Expand All @@ -15,6 +16,8 @@ WaveSabre has a new [CMake](https://cmake.org/) based build-system that can gene
- Run `cmake -B build` to generate the Visual Studio project files and solution
- Optionally, you can also specify `-DVSTDIR=<some-path>` to copy the VST plugins into your DAW's VST plugin directory upon build.
- Optionally, you can specify `-DDOWNLOAD_VST3SDK=ON` to let CMake download and unpack the VST3 SDK for you.
- Optionally, you can specify `-DDOWNLOAD_MONAD_FL_PARSER=ON` to let CMake download and unpack the Monad FL parser for you.
- It is possible to specify a custom directory for the Monad FL parser using `-DMONAD_FL_PARSER_DIR=<some-path>`.
- You can specify `-DBUILD_VST_PLUGINS=OFF` to avoid building the plugins (useful for projects that only need the synthesizer and not the plugins).
- You can also specify `-DVSTSDK3_DIR=<dir>` to use a VSTSDK from outside of the source-tree.
- 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`.
Expand Down
7 changes: 6 additions & 1 deletion WaveSabreConvert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ set(WAVESABRE_CONVERT_SOURCES
)

add_library(WaveSabreConvert SHARED ${WAVESABRE_CONVERT_SOURCES})
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${MONAD_FL_PARSER_BINARY}")
if(${DOWNLOAD_MONAD_FL_PARSER})
add_dependencies(WaveSabreConvert FLParser)
else()
add_dependencies(WaveSabreConvert Monad.FLParser)
endif()

csharp_set_designer_cs_properties(${WAVESABRE_CONVERT_SOURCES})
csharp_set_windows_forms_properties(${WAVESABRE_CONVERT_SOURCES})
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${CMAKE_CURRENT_SOURCE_DIR}/FLParser/Monad.FLParser.dll")
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCES
"System"
Expand Down
40 changes: 40 additions & 0 deletions WaveSabreConvert/FLParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.11)

project(Monad.FLParser LANGUAGES CSharp)

cmake_policy(SET CMP0057 NEW)
include(CSharpUtilities)

# Note: The space suffix is required for the flag to work correctly.
set(CMAKE_CSharp_FLAGS "/langversion:latest ")

set(MONAD_FL_PARSER_SOURCES
${MONAD_FL_PARSER_DIR}/Properties/AssemblyInfo.cs

${MONAD_FL_PARSER_DIR}/AutomationData.cs
${MONAD_FL_PARSER_DIR}/AutomationKeyframe.cs
${MONAD_FL_PARSER_DIR}/Channel.cs
${MONAD_FL_PARSER_DIR}/ChannelPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Enums.cs
${MONAD_FL_PARSER_DIR}/FlParseException.cs
${MONAD_FL_PARSER_DIR}/GeneratorData.cs
${MONAD_FL_PARSER_DIR}/IChannelData.cs
${MONAD_FL_PARSER_DIR}/Insert.cs
${MONAD_FL_PARSER_DIR}/InsertSlot.cs
${MONAD_FL_PARSER_DIR}/IPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Note.cs
${MONAD_FL_PARSER_DIR}/Pattern.cs
${MONAD_FL_PARSER_DIR}/PatternPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Plugin.cs
${MONAD_FL_PARSER_DIR}/PluginIoInfo.cs
${MONAD_FL_PARSER_DIR}/Project.cs
${MONAD_FL_PARSER_DIR}/ProjectParser.cs
${MONAD_FL_PARSER_DIR}/Track.cs
)

add_library(Monad.FLParser SHARED ${MONAD_FL_PARSER_SOURCES})
set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")
set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_REFERENCES
"System"
"System.Core"
)
7 changes: 0 additions & 7 deletions WaveSabreConvert/FLParser/LICENSE

This file was deleted.

Binary file removed WaveSabreConvert/FLParser/Monad.FLParser.dll
Binary file not shown.