Skip to content
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
18 changes: 18 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fable": {
"version": "4.1.4",
"commands": [
"fable"
]
},
"paket": {
"version": "7.2.1",
"commands": [
"paket"
]
}
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# http://editorconfig.org
root = true

[*.fs]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

23 changes: 22 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Thumbs.db
# local vscode settings
.vscode/

# jetbrains ide's
cmake-build-debug

.idea

# libsamplerate tests
Dependencies/libsamplerate/

Expand All @@ -17,7 +22,23 @@ Dependencies/libsamplerate/

# used by cmake
build/

cmake-build-debug
# private config (see Config.cmake template)
MyConfig.cmake

# dotnet
paket-files
bin
**/obj


# rust
Source/rust/target
Source/fsharp/**.fs.rs
Source/fsharp/**.fs.js
Source/fsharp/fable_modules
target

# generated code
Source/generated
!/Source/generated/foo/Cargo.toml
106 changes: 60 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ execute_process(
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
set(PROJECT_DESCRIPTION "ComposeSiren du ${CURRENT_DATE} sur commit n ${GIT_HASH}")

include(FetchContent)
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git
GIT_TAG origin/master # Optionally specify a version tag or branch here
)
FetchContent_MakeAvailable(Corrosion)

project(ComposeSiren VERSION 1.5.0 DESCRIPTION ${PROJECT_DESCRIPTION})
set(BaseTargetName ${PROJECT_NAME})
set(VendorName "Mecanique Vivante")
Expand All @@ -36,30 +44,30 @@ if (APPLE)
endif()

juce_add_plugin(${BaseTargetName}
PRODUCT_NAME "${BaseTargetName}"
COMPANY_NAME "${VendorName}"
VERSION ${CMAKE_PROJECT_VERSION}
ICON_BIG "${CMAKE_SOURCE_DIR}/Assets/Icon.png"
ICON_SMALL "${CMAKE_SOURCE_DIR}/Assets/Icon.png"
FORMATS ${FORMATS}
# A four-character manufacturer id with at least one upper-case character
PLUGIN_MANUFACTURER_CODE McVv
# A unique four-character plugin id with at least one upper-case character
PLUGIN_CODE MvCs
IS_SYNTH TRUE # Is this a synth or an effect?
NEEDS_MIDI_INPUT TRUE # Does the plugin need midi input?
NEEDS_MIDI_OUTPUT TRUE # Does the plugin need midi output?
IS_MIDI_EFFECT FALSE # Is this plugin a MIDI effect?
EDITOR_WANTS_KEYBOARD_FOCUS TRUE # Does the editor need keyboard focus?
COPY_PLUGIN_AFTER_BUILD FALSE # Should the plugin be installed to a default location after building?
# VST3_CATEGORIES
# AAX_CATEGORY
# AU_MAIN_TYPE
# COMPANY_WEBSITE https://www.mecanique-vivante.com
# COMPANY_EMAIL
BUNDLE_ID "com.mecaviv.${BaseTargetName}"
PLUGIN_NAME "${BaseTargetName}"
PRODUCT_NAME "${BaseTargetName}"
PRODUCT_NAME "${BaseTargetName}"
COMPANY_NAME "${VendorName}"
VERSION ${CMAKE_PROJECT_VERSION}
ICON_BIG "${CMAKE_SOURCE_DIR}/Assets/Icon.png"
ICON_SMALL "${CMAKE_SOURCE_DIR}/Assets/Icon.png"
FORMATS ${FORMATS}
# A four-character manufacturer id with at least one upper-case character
PLUGIN_MANUFACTURER_CODE McVv
# A unique four-character plugin id with at least one upper-case character
PLUGIN_CODE MvCs
IS_SYNTH TRUE # Is this a synth or an effect?
NEEDS_MIDI_INPUT TRUE # Does the plugin need midi input?
NEEDS_MIDI_OUTPUT TRUE # Does the plugin need midi output?
IS_MIDI_EFFECT FALSE # Is this plugin a MIDI effect?
EDITOR_WANTS_KEYBOARD_FOCUS TRUE # Does the editor need keyboard focus?
COPY_PLUGIN_AFTER_BUILD FALSE # Should the plugin be installed to a default location after building?
# VST3_CATEGORIES
# AAX_CATEGORY
# AU_MAIN_TYPE
# COMPANY_WEBSITE https://www.mecanique-vivante.com
# COMPANY_EMAIL
BUNDLE_ID "com.mecaviv.${BaseTargetName}"
PLUGIN_NAME "${BaseTargetName}"
PRODUCT_NAME "${BaseTargetName}"
)

juce_generate_juce_header(${BaseTargetName})
Expand All @@ -82,31 +90,37 @@ add_subdirectory(Assets)
add_subdirectory(Source)

target_link_libraries(${BaseTargetName}
PRIVATE
# copied from projucer project
juce::juce_audio_basics
juce::juce_audio_devices
juce::juce_audio_formats
juce::juce_audio_processors
juce::juce_audio_utils
juce::juce_core
juce::juce_data_structures
juce::juce_events
juce::juce_graphics
juce::juce_gui_basics
juce::juce_gui_extra
# recommended
juce::juce_recommended_warning_flags
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
PRIVATE
# copied from projucer project
juce::juce_audio_basics
juce::juce_audio_devices
juce::juce_audio_formats
juce::juce_audio_processors
juce::juce_audio_utils
juce::juce_core
juce::juce_data_structures
juce::juce_events
juce::juce_graphics
juce::juce_gui_basics
juce::juce_gui_extra
# recommended
juce::juce_recommended_warning_flags
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
)

target_compile_definitions(${BaseTargetName}
PUBLIC
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_WEB_BROWSER=0
target_compile_definitions(${BaseTargetName}
PUBLIC
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_WEB_BROWSER=0
)



corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Source/rust/Cargo.toml CRATES composesiren-dsp-rs)
target_link_libraries(${BaseTargetName} PUBLIC composesiren-dsp-rs)


################################################################################
# packaging

Expand All @@ -122,4 +136,4 @@ if(APPLE) # we generate a cmake subproject to build the installer
include(Packaging/Apple/MakePackage.cmake)
elseif(WIN32) # we just proceed the regular way
include(Packaging/Windows/MakePackage.cmake)
endif()
endif()
17 changes: 17 additions & 0 deletions Source/fsharp/ComposeSiren.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="composesiren.declarations.fs" />
<Compile Include="composesiren.dsp.fs" />
<Compile Include="composesiren.dsp.processor.fs" />
<Compile Include="lib.fs" />
<Content Include="paket.references" />
<None Include="sample.fsx" />
<Folder Include="samples\" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
19 changes: 19 additions & 0 deletions Source/fsharp/composesiren.declarations.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace composesiren.declarations
open Fable.Core.Rust
[<Struct;OuterAttr("repr(C)")>]
type SirenDataFileSuffix =
| S1
| S2
| S3
| S4
| S5
| S7

[<Struct;OuterAttr("repr(C)")>]
type SirenModel =
| Alto1
| Alto2
| Bass
| Tenor
| Soprano
| Piccolo
Loading