diff --git a/docs/source/changelog.md b/docs/source/changelog.md index fecd5aa..857397f 100644 --- a/docs/source/changelog.md +++ b/docs/source/changelog.md @@ -28,6 +28,7 @@ - `offset` changed sign, it's now the time at which the first beat occurs in the audio file, instead of its opposite - `offset` now has an implicit default value of 0 in case no timing object in the file defines it - BPM changes can now be stored in the `bpms` array ! + - `hakus` allow storing special background bounce patterns - **Removed** - In the metadata object : - `preview path` is now replaced with the polymorphic `preview` diff --git a/docs/source/other-things.md b/docs/source/other-things.md index 3cdf76e..32959fc 100644 --- a/docs/source/other-things.md +++ b/docs/source/other-things.md @@ -114,6 +114,11 @@ For example, in this case : The BPM on beat zero is set to 124 +### Duplicate HAKUs + +The schema allows of duplicate hakus, implementations should deduplicate hakus by beat. + + (multiple-timing-objects)= ### Multiple Timing Objects diff --git a/docs/source/schema.md b/docs/source/schema.md index 1dec6ab..4ff37d1 100644 --- a/docs/source/schema.md +++ b/docs/source/schema.md @@ -89,7 +89,8 @@ Describes the part of the music file that's meant to be played on loop when prev { "offset": 0, "resolution": 240, - "bpms": [] + "bpms": [], + "hakus": [] } ``` @@ -115,6 +116,10 @@ Describes the relationship between seconds in the audio file and symbolic time ( ``` - Array of [BPM events](#bpm) +- **hakus** + - array, optional + - If the key is missing, default to the regular background bounce pattern + - HAKUs (named after the `HAKU` command in .eve files) describe how the background animation should bounce along with the music, most songs just leave a default regular patterns that makes the background bounce on every beat, but some songs use these commands as a gimmick. In that sense they are similar to beat lines in BMS Timing objects can appear in multiple places in a memon file. The section [](other-things.md#multiple-timing-objects) explains how to deal with them. @@ -240,7 +245,7 @@ A classic long note, with a tail - Integer between 0 and 5 inclusive - Tail starting position in 6-notation : - For every given button on the controler, there are 6 possible starting + For every given button on the controller, there are 6 possible starting positions for long note tails. For example if the long note is held here : diff --git a/schema.json b/schema.json index a9127e3..e73e082 100644 --- a/schema.json +++ b/schema.json @@ -230,7 +230,7 @@ "$ref": "#/$defs/decimal" }, "resolution": { - "description": "Number of ticks in a beat for the bpm events", + "description": "Number of ticks in a beat for the bpms and the hakus", "type": "integer", "minimum": 1, "default": 240 @@ -255,6 +255,13 @@ "required": ["beat", "bpm"] }, "default": [{"beat": 0, "bpm": 120}] + }, + "hakus": { + "description": "Array of HAKUs, dictates how the background should bounce if the bouncing pattern differs from the usual 4/4", + "type": "array", + "items": { + "$ref": "#/$defs/timeInBeats" + } } } } diff --git a/tests/data/09 - hakus/fail/not a symbolic time.json b/tests/data/09 - hakus/fail/not a symbolic time.json new file mode 100644 index 0000000..9d4e9bd --- /dev/null +++ b/tests/data/09 - hakus/fail/not a symbolic time.json @@ -0,0 +1,7 @@ +{ + "version": "1.0.0", + "timing": { + "hakus": ["0.1", "0.2"] + }, + "data": {} +} \ No newline at end of file diff --git a/tests/data/09 - hakus/pass/hakus in a chart timing object.json b/tests/data/09 - hakus/pass/hakus in a chart timing object.json new file mode 100644 index 0000000..76db915 --- /dev/null +++ b/tests/data/09 - hakus/pass/hakus in a chart timing object.json @@ -0,0 +1,11 @@ +{ + "version": "1.0.0", + "data": { + "a chart": { + "timing": { + "hakus": [0, 1, 2, 3] + }, + "notes": [] + } + } +} \ No newline at end of file diff --git a/tests/data/09 - hakus/pass/hakus in the root timing object copy.json b/tests/data/09 - hakus/pass/hakus in the root timing object copy.json new file mode 100644 index 0000000..7ecbd5f --- /dev/null +++ b/tests/data/09 - hakus/pass/hakus in the root timing object copy.json @@ -0,0 +1,7 @@ +{ + "version": "1.0.0", + "timing": { + "hakus": [0, 1, 2, 3] + }, + "data": {} +} \ No newline at end of file diff --git a/tests/data/09 - hakus/pass/hakus with mixed numbers.json b/tests/data/09 - hakus/pass/hakus with mixed numbers.json new file mode 100644 index 0000000..63de980 --- /dev/null +++ b/tests/data/09 - hakus/pass/hakus with mixed numbers.json @@ -0,0 +1,12 @@ +{ + "version": "1.0.0", + "timing": { + "hakus": [ + [1, 0, 1], + [2, 0, 1], + [3, 0, 1], + 4 + ] + }, + "data": {} +} \ No newline at end of file