Skip to content

Commit

Permalink
docs: publish all categories excluding Developer Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmacha committed May 23, 2024
1 parent 3a13ff8 commit 31e612f
Show file tree
Hide file tree
Showing 18 changed files with 485 additions and 46 deletions.
2 changes: 1 addition & 1 deletion _externals/BassMusic.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// var string BassMusic_ActiveThemeFilename
// Holds the filename of currently played song or the last song if none is playing now.
// ---------------------------------------------------------------
var string BassMusic_ActiveThemeFilename;
var string BassMusic_ActiveThemeFilename;BassMusic_ActiveThemeFilename

// ---------------------------------------------------------------
// var string BassMusic_ActiveThemeID
Expand Down
33 changes: 32 additions & 1 deletion docs/docs/reference/classes/C_MUSICTHEME.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# C_MUSICTHEME
# C_MUSICTHEME

## Description

The class represents a music theme that can be played by the plugin.

## Definition

```dae
class C_MUSICTHEME
{
var string file;
var float vol;
var int loop;
var float reverbmix;
var float reverbtime;
var int transtype;
var int transsubtype;
};
```

## Fields

| Field | Type | Description |
|----------------|--------|-------------------------------------|
| `file` | string | The filename of the music theme. |
| `vol` | float | The volume of the music theme. |
| `loop` | int | If true, music will loop after nd |
| `reverbmix` | float | The reverb mix of the music theme. |
| `reverbtime` | float | The reverb time of the music theme. |
| `transtype` | int | The type of the transition. |
| `transsubtype` | int | The subtype of the transition. |
103 changes: 101 additions & 2 deletions docs/docs/reference/externals/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func void BassMusic_Play(var string id)
* `#!dae var string id`<br>
Symbol name of the music theme ([C_MUSICTHEME](../classes/C_MUSICTHEME.md)) to play

## BassMusic_SetFullScriptControl
## <a href="#bassmusic_setfullscriptcontrol">BassMusic_SetFullScriptControl</a>

...
Set the "Full Script Control"

```dae
func void BassMusic_SetFullScriptControl(int enabled) {}
Expand All @@ -29,4 +29,103 @@ func void BassMusic_SetFullScriptControl(int enabled) {}
Boolean value if full script control should be enabled.


## <a href="#bassmusic_onendevent">BassMusic_OnEndEvent</a>

Set a callback function to be called when the music ends.

```dae
func void BassMusic_OnEndEvent(var func callback) {}
```

**Parameters**

* `#!dae var func callback`<br>
Callback function to be called when the music ends with signature:<br>
`#!dae func void callback();`

## <a href="#bassmusic_ontransitionevent">BassMusic_OnTransitionEvent</a>

Set a callback function to be called when the music is close to the end and transition starts.

```dae
func void BassMusic_OnTransitionEvent(var func callback) {}
```

**Parameters**

* `#!dae var func callback`<br>
Callback function to be called when the music is close to the end and transition starts:<br>
`#!dae func void callback(var float time_left_ms);`

## <a href="#bassmusic_onchangeevent">BassMusic_OnChangeEvent</a>

Set a callback function to be called when the music changes.

```dae
func void BassMusic_OnChangeEvent(var func callback) {}
```

**Parameters**

* `#!dae var func callback`<br>
Callback function to be called when the music changes with signature:<br>
`#!dae func void callback();`

## <a href="#bassmusic_opt_transitiontime">BassMusic_Opt_TransitionTime</a>

Set [Bass].TransitionTime ini setting.

```dae
func void BassMusic_Opt_TransitionTime(var float time) {}
```

**Parameters**

* `#!dae var float time`<br>
The transition time in miliseconds

## <a href="#bassmusic_opt_forcedisablereverb">BassMusic_Opt_ForceDisableReverb</a>

Set [Bass].ForceDisableReverb ini setting.

```dae
func void BassMusic_Opt_ForceDisableReverb(var int enabled) {}
```

**Parameters**

* `#!dae var int enabled`<br>
If true, the reverb effect is globally disabled

## <a href="#bassmusic_opt_forcefadetransition">BassMusic_Opt_ForceFadeTransition</a>

Set [Bass].ForceFadeTransition ini setting.

```dae
func void BassMusic_Opt_ForceFadeTransition(var int enabled) {}
```

**Parameters**

* `#!dae var int enabled`<br>
If true, the fade transition is globally enabled

## <a href="#bassmusic_opt_transitionrule_onbeat">BassMusic_TransitionRule_OnBeat</a>

Add a new OnBeat rule to the Transition Scheduler.

```dae
func void BassMusic_TransitionRule_OnBeat(var string name, var string interval, var string timeCodes) {}
```

**Parameters**

* `#!dae var string name`<br>
Input music theme name
* `#!dae var string interval`<br>
String formatted as double, the interval of a beat in seconds. Set "0" to disable.
* `#!dae var string timeCodes`<br>
String formatted as a list of semicolon-separated doubles, the time codes in seconds when the transition can happen,
eg. `"0.0;1.0;2.0;3.0"`

</div>
20 changes: 18 additions & 2 deletions docs/docs/reference/globals/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Globals

<div id="BassMusic_ActiveThemeFilename"></div>
<div class="zbassmusic-externals" markdown>

## `var string BassMusic_ActiveThemeFilename`
## <a href="#bassmusic_activethemefilename">BassMusic_ActiveThemeFilename</a>

Holds the filename of the currently active theme.

```dae
var string BassMusic_ActiveThemeFilename;
```

## <a href="#bassmusic_activethemeid">BassMusic_ActiveThemeID</a>

Hods the ID (symbol name) of the currently active theme.

```dae
var string BassMusic_ActiveThemeID;
```

</div>
32 changes: 31 additions & 1 deletion docs/docs/reference/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# Reference
# Reference

## Classes

* [C_MUSICTHEME](classes/C_MUSICTHEME.md)

## Globals

* [BassMusic_ActiveThemeFilename](globals/index.md#bassmusic_activethemefilename)
* [BassMusic_ActiveThemeID](globals/index.md#bassmusic_activethemeid)

## Externals

* [BassMusic_Play](externals/index.md#bassmusic_play)
* [BassMusic_SetFullScriptControl](externals/index.md#bassmusic_setfullscriptcontrol)
* [BassMusic_OnEndEvent](externals/index.md#bassmusic_onendevent)
* [BassMusic_OnTransitionEvent](externals/index.md#bassmusic_ontransitionevent)
* [BassMusic_OnChangeEvent](externals/index.md#bassmusic_onchangeevent)
* [BassMusic_Opt_TransitionTime](externals/index.md#bassmusic_opt_transitiontime)
* [BassMusic_Opt_ForceDisableReverb](externals/index.md#bassmusic_opt_forcedisablereverb)
* [BassMusic_Opt_ForceFadeTransition](externals/index.md#bassmusic_opt_forcefadetransition)
* [BassMusic_TransitionRule_OnBeat](externals/index.md#bassmusic_transitionrule_onbeat)

## Options (.ini)

* [[BassMusic] TransitionTime](options/index.md#transitiontime)
* [[BassMusic] ForceDisableReverb](options/index.md#forcedisablereverb)
* [[BassMusic] ForceFadeTransition](options/index.md#forcefadetransition)
* [[BassMusic] CreateMainParserCMusicTheme](options/index.md#createmainparsercmusictheme)
* [[BassMusic] LoggerLevelUnion](options/index.md#loggerlevelunion)
* [[BassMusic] LoggerLevelZSpy](options/index.md#loggerlevelzspy)
57 changes: 54 additions & 3 deletions docs/docs/reference/options/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,57 @@
# Options (.ini)

## [BassMusic]
<div class="zbassmusic-externals" markdown>

<div id="LoggerLevelUnion"></div>
### LoggerLevelUnion
Options are defined under `[BassMusic]` sction.

## <a href="#transitiontime">TransitionTime</a>

The time of the crossfade transition in milliseconds.

```dae
TransitionTime=2000
```

## <a href="#forcedisblereverb">ForceDisableReverb</a>

If true, all reverb effects are disabled.

```dae
ForceDisableReverb=0
```

## <a href="#forcefadetransition">ForceFadeTransition</a>

If true, all transitions use cross-fade even if it's not set in the theme.

```dae
ForceFadeTransition=0
```

## <a href="#createmainparsercmusictheme">CreateMainParserCMusicTheme</a>

If true, the class [C_MUSICTHEME](../classes/C_MUSICTHEME.md) is also created within the main scripts' parser
and you can define music themes in Content scripts. Be aware that it doesn't provide any sharing between parsers
so you can't use instance from music parser in the main parser - then you have to redefine it in the other

```dae
CreateMainParserCMusicTheme=1
```

## <a href="#loggerlevelunion">LoggerLevelUnion</a>

Sets the logger level for Union Console logs

```dae
LoggerLevelUnion=INFO
```

## <a href="#loggerlevelzspy">LoggerLevelZSpy</a>

Sets the logger level for ZSpy logs

```dae
LoggerLevelZSpy=DEBUG
```

</div>
42 changes: 24 additions & 18 deletions docs/docs/roadmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ hide:

# Roadmap

<div class="roadmap-legend" markdown>
!!! success "Done"
!!! info "In Progress"
!!! warning "Waiting in Queue"
!!! danger "Planned"
</div>

## Done

### Core functions
!!! success "Music Engine (v0.1.0)"
??? success "Music Engine (v0.1.0)"
Music engine capable of replacing the original DM system in the scope of playing audio and switching songs based on game events.

!!! success "Daedalus API for controlling playback (v0.1.0)"
??? success "Daedalus API for controlling playback (v0.1.0)"
External functions to take control over music scheduling in Daedalus scripts. API is stable and shouldn't introduce any breaking changes.

!!! success "Simple crossfade (v0.1.0)"
??? success "Simple crossfade (v0.1.0)"
Every music theme can opt-in for simple fade-in and fade-out transitions to smoothly crossfade changing themes. The crossfade time is
set globally and the transition starts instantly after receiving an event from the game.

Expand All @@ -23,41 +30,40 @@ hide:

### Transition Scheduler

!!! info "Transition Scheduler (v0.1.x)"
??? info "Transition Scheduler (v0.2.x)"
Scheduler for executing advanced transitions between songs based on defined rules. The system should be flexible and offer different
transition effects behind an easy-to-use interface. The artist should be able to define rules with high precision (soft goal: <10ms latency).

!!! success "Instant Transition (Done)"
??? success "Instant Transition (Done)"
Default transition starts the effect instantly after receiving an event from the game.

!!! success "OnBeat Transition (Done)"
??? success "OnBeat Transition (Done)"
Transition accepts a list of time points when the transition can happen and schedules it for the closest point. This way the song may
switch exactly in a moment when the beat ends to match the rhythm.

!!! warning "Jingle Transition (To Do)"
??? warning "Jingle Transition (To Do)"
Transition plays an additional short audio during the transition as a one-time jingle. For example, battle music transitioning into
normal can play some theme to emphasize the end of a fight.

!!! question "Format for defining the transition rules (Analysis / Planning)"
We are still thinking about how can we accept the transition rules from developers. The options to consider are:

* Daedalus API (not very ergonomic to pass lots of data)
* MIDI file (easy to work with for composers because they can do it directly in their DAW)
* Custom file format (we prefer not to introduce additional custom formats that require custom tooling)
??? info "MIDI bridge for Transition Scheduler (v0.2.x)"
The MIDI format is the best option for defining rules for the Transition Scheduler. The composer can just
put all the information about the transitions as MIDI events on some muted track in DAW and export it to the plugin.
The composer uses a tool he knows, and we can extract precise information from the MIDI file perfectly synchronized
with the music.

We may choose more than one option. At this moment the best option seems to be MIDI for defining time points + Daedalus API to setup
additional metadata.
The bridge defines a spec how to interpret MIDI events and how they map to the internal structures of the Transition Scheduler.
Then the bridge can load MIDI files and provide the rules to the scheduler.

## Future Plans

!!! question "New features?"
??? question "New features?"
We still may plan to implement some new features if they can provide value.

!!! warning "Support late injection"
??? danger "Support late injection"
Right now the plugin hooks early into Gothic initialization to set itself up and replace the `zmusic` pointer with a custom implementation.
We should add support for late initialization and let the plugin be loaded by Daedalus/Ikaus scripts.

!!! danger "Complete Product Release (v1.0.0)"
??? danger "Complete Product Release (v1.0.0)"
Before we release version v1.0.0 and mark zBassMusic as a finished product, we need to:

* finish all the features in the backlog
Expand Down
9 changes: 9 additions & 0 deletions docs/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@
margin: 0 !important;
padding: 0 !important;

}

.roadmap-legend .admonition {
margin: 0 auto;
font-size: 0.7rem;
}

.md-main {
margin-bottom: 3rem;
}
Loading

0 comments on commit 31e612f

Please sign in to comment.