Skip to content

Commit

Permalink
Document the extension and improve exposed API
Browse files Browse the repository at this point in the history
This also adds some minor fixes and validity
checks where appropriate. Some bigger changes
have been identified which will come in follow-up
commits.

Closes #3.
  • Loading branch information
YuriSizov committed Jun 26, 2024
1 parent cb03af2 commit 99069c4
Show file tree
Hide file tree
Showing 69 changed files with 2,035 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ bin/*
!bin/*.gdextension
example/bin/
example/export/
src/**/*.gen.cpp

### Godot project development ###

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ If you need the most recent fixes, you can also download the _[latest unstable](
4. Restart the editor, and start using the synth!

> [!TIP]
> You can type "SiON" in the search bar of the editor's built-in help to find available classes. Complete class and method descriptions are coming once _Godot 4.3_ reaches a more stable state (the ability to create class reference has been added very recently).
> You can type "SiON" in the search bar of the editor's built-in help to find available classes.
## Usage

First, you need to create a `SiONDriver` instance and add it to the scene tree. **Only one driver** can exist at the same time. (Some internal global objects are stateful and having multiple drivers can lead to conflicts.)

```gdscript
var driver := SiONDriver.new()
var driver := SiONDriver.create()
add_child(driver)
```

Expand Down
8 changes: 8 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ def _register_library(name, path):
env.Append(CPPPATH=["#{}/".format(path)])
env.library_sources = []

# Recursively iterate through sub configs in source folders and perform steps defined there.
SConscript("{}/SCsub".format(path))

# Add documentation to the list of sources as well.
if env["target"] in ["editor", "template_debug"]:
doc_data = env.GodotCPPDocData("{}/gen/doc_data.gen.cpp".format(path), source=Glob("doc_classes/*.xml"))
env.library_sources.append(doc_data)

# Finally, register the library to be built.

if env["platform"] == "macos":
library = env.SharedLibrary(
"{}/{}.{}.{}.framework/{}.{}.{}".format(
Expand Down
11 changes: 11 additions & 0 deletions doc_classes/BeatsPerMinute.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BeatsPerMinute" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Helper class for manipulating BPM data.
</brief_description>
<description>
[b]Warning:[/b] This class currently has no intended use in the API. If you need this class and its unexposed methods in your project, please [b][url=https://github.com/YuriSizov/gdsion/issues]create a feature request with your use case[/url][/b]!
</description>
<tutorials>
</tutorials>
</class>
11 changes: 11 additions & 0 deletions doc_classes/MMLData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MMLData" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Container for the state data of the internal processing. Base class of [SiMMLData] and [SiONData].
</brief_description>
<description>
[b]Warning:[/b] This class currently has no intended use in the API. If you need this class and its unexposed methods in your project, please [b][url=https://github.com/YuriSizov/gdsion/issues]create a feature request with your use case[/url][/b]!
</description>
<tutorials>
</tutorials>
</class>
11 changes: 11 additions & 0 deletions doc_classes/MMLEvent.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MMLEvent" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Container for event information of the internal sequencer.
</brief_description>
<description>
[b]Warning:[/b] This class currently has no intended use in the API. If you need this class and its unexposed methods in your project, please [b][url=https://github.com/YuriSizov/gdsion/issues]create a feature request with your use case[/url][/b]!
</description>
<tutorials>
</tutorials>
</class>
11 changes: 11 additions & 0 deletions doc_classes/MMLSequencer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MMLSequencer" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Internal sequencer. Base class of [SiMMLSequencer].
</brief_description>
<description>
[b]Warning:[/b] This class currently has no intended use in the API. If you need this class and its unexposed methods in your project, please [b][url=https://github.com/YuriSizov/gdsion/issues]create a feature request with your use case[/url][/b]!
</description>
<tutorials>
</tutorials>
</class>
11 changes: 11 additions & 0 deletions doc_classes/MMLSystemCommand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MMLSystemCommand" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Container for system commands of the internal sequencer.
</brief_description>
<description>
[b]Warning:[/b] This class currently has no intended use in the API. If you need this class and its unexposed methods in your project, please [b][url=https://github.com/YuriSizov/gdsion/issues]create a feature request with your use case[/url][/b]!
</description>
<tutorials>
</tutorials>
</class>
30 changes: 30 additions & 0 deletions doc_classes/SiControllableFilterBase.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiControllableFilterBase" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Base class for all controllable filters.
</brief_description>
<description>
Controllable filters allow to set their parameters directly without preprocessing.
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="cutoff" type="int" default="255" />
<param index="1" name="resonance" type="int" default="255" />
<param index="2" name="fps" type="float" default="20" />
<description>
Sets filter parameters.
</description>
</method>
<method name="set_params_manually">
<return type="void" />
<param index="0" name="cutoff" type="float" />
<param index="1" name="resonance" type="float" />
<description>
Sets filter parameters directly.
</description>
</method>
</methods>
</class>
11 changes: 11 additions & 0 deletions doc_classes/SiControllableFilterHighPass.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiControllableFilterHighPass" inherits="SiControllableFilterBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Controllable version of the high pass filter.
</brief_description>
<description>
See also [SiFilterHighPass].
</description>
<tutorials>
</tutorials>
</class>
11 changes: 11 additions & 0 deletions doc_classes/SiControllableFilterLowPass.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiControllableFilterLowPass" inherits="SiControllableFilterBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Controllable version of the low pass filter.
</brief_description>
<description>
See also [SiFilterLowPass].
</description>
<tutorials>
</tutorials>
</class>
20 changes: 20 additions & 0 deletions doc_classes/SiEffectAutopan.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectAutopan" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Automatic panning effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="frequency" type="float" default="1" />
<param index="1" name="stereo_width" type="float" default="1" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
10 changes: 10 additions & 0 deletions doc_classes/SiEffectBase.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectBase" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Base class for all effects and filters.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
</class>
31 changes: 31 additions & 0 deletions doc_classes/SiEffectComposite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectComposite" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Composite effect built from other effects and filters.
</brief_description>
<description>
A composite effect can have up to [code]8[/code] slots, each containing a chain of effects. Slot at the index [code]0[/code] has a special meaning as the master slot.
When processing, first secondary slots are calculated and mixed, and then the master slot is calculated and mixed.
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_slot_effects">
<return type="void" />
<param index="0" name="slot" type="int" />
<param index="1" name="effects" type="SiEffectBase[]" />
<description>
Sets a collection of effects for the given slot, overriding existing effects.
</description>
</method>
<method name="set_slot_levels">
<return type="void" />
<param index="0" name="slot" type="int" />
<param index="1" name="send_level" type="float" />
<param index="2" name="mix_level" type="float" />
<description>
Sets send and mix levels for the given slot.
</description>
</method>
</methods>
</class>
24 changes: 24 additions & 0 deletions doc_classes/SiEffectCompressor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectCompressor" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Compressor effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="threshold" type="float" default="0.7" />
<param index="1" name="window_time" type="float" default="50" />
<param index="2" name="attack_time" type="float" default="20" />
<param index="3" name="release_time" type="float" default="20" />
<param index="4" name="max_gain" type="float" default="-6" />
<param index="5" name="mixing_level" type="float" default="0.5" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
22 changes: 22 additions & 0 deletions doc_classes/SiEffectDistortion.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectDistortion" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Distortion effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="pre_gain" type="float" default="-60" />
<param index="1" name="post_gain" type="float" default="18" />
<param index="2" name="lpf_frequency" type="float" default="2400" />
<param index="3" name="lpf_slope" type="float" default="1" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
21 changes: 21 additions & 0 deletions doc_classes/SiEffectDownsampler.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectDownsampler" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Downsampler effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="frequency_shift" type="int" default="0" />
<param index="1" name="bitrate" type="int" default="16" />
<param index="2" name="channel_count" type="int" default="2" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
23 changes: 23 additions & 0 deletions doc_classes/SiEffectEqualizer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectEqualizer" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Equalizer effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="low_gain" type="float" default="1" />
<param index="1" name="mid_gain" type="float" default="1" />
<param index="2" name="high_gain" type="float" default="1" />
<param index="3" name="low_frequency" type="float" default="880" />
<param index="4" name="high_frequency" type="float" default="5000" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
19 changes: 19 additions & 0 deletions doc_classes/SiEffectSpeakerSimulator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectSpeakerSimulator" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Piezoelectric speaker simulator effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="hardness" type="float" default="0.2" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
24 changes: 24 additions & 0 deletions doc_classes/SiEffectStereoChorus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectStereoChorus" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Stereo chorus effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="delay_time" type="float" default="20" />
<param index="1" name="feedback" type="float" default="0.2" />
<param index="2" name="frequency" type="float" default="4" />
<param index="3" name="depth" type="float" default="20" />
<param index="4" name="wet" type="float" default="0.5" />
<param index="5" name="invert_phase" type="bool" default="true" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
22 changes: 22 additions & 0 deletions doc_classes/SiEffectStereoDelay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SiEffectStereoDelay" inherits="SiEffectBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Stereo delay effect.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="set_params">
<return type="void" />
<param index="0" name="delay_time" type="float" default="250" />
<param index="1" name="feedback" type="float" default="0.25" />
<param index="2" name="is_cross" type="bool" default="false" />
<param index="3" name="wet" type="float" default="0.25" />
<description>
Sets effect parameters.
</description>
</method>
</methods>
</class>
Loading

0 comments on commit 99069c4

Please sign in to comment.