Skip to content

feat(ustx,seqtool,base): replace flat-dict USTX API with typed datamo…#24

Merged
NewComer00 merged 1 commit intomainfrom
feat/multi-parts-tempos
Mar 22, 2026
Merged

feat(ustx,seqtool,base): replace flat-dict USTX API with typed datamo…#24
NewComer00 merged 1 commit intomainfrom
feat/multi-parts-tempos

Conversation

@NewComer00
Copy link
Copy Markdown
Owner

…del and multi-tempo support

BREAKING CHANGE: load_ustx() now returns UProject instead of dict; save_ustx() now accepts UProject instead of dict;
edit_ustx_expression_curve() is removed — use UstxEditor or UVoicePart.set_curve() instead.

feat(ustx): add UProject, UVoicePart, UCurve, UTrack, UTempo, UTimeSignature dataclasses mirroring OpenUtau C# models

feat(ustx): add TimeAxis — piecewise tick ↔ ms converter replicating OpenUtau's BuildSegments / TickPosToMsPos / MsPosToTickPos logic, with full multi-tempo and multi-time-signature support

feat(ustx): add UstxEditor — RAII context manager with exclusive FileLock, add_expression_to_part(), and add_expression_to_track() (absolute → relative tick translation with per-part windowing)

feat(seqtool): replace time_to_ticks/ticks_to_time with a set_tick_converters() / reset_tick_converters() registry; all to_ticks=True paths and align_sequence_tick() now use the registered tempo-map-aware converters instead of a fixed BPM approximation

feat(base): register tick converters from ustx_time_axis in ExpressionLoader.init(); remove threading.Lock (superseded by FileLock in UstxEditor); remove self.tempo in favour of self.ustx_time_axis; offset shifting moved to load_to_ustx() via shift_ticks_by_seconds()

feat(dyn,pitd,tenc): drop tempo/ppqn kwargs from align_sequence_tick calls; remove manual utau_offset_ticks arithmetic; pitd gains RMS + RMS dynamics features to match dyn/tenc feature sets

feat(examples): add テトリス and Прекрасное Далеко examples with project.ustx, reference.wav, utau.wav, expressive_config.json and README; update 明天会更好 project with reference track and corrected exp_selectors; remove expressive_config.json from .gitignore

fix(wavtool): extract_wav_frequency now returns np.ndarray instead of list, matching documented return type

deps: add filelock to pyproject.toml

test(ustx): replace dict-based assertions with UProject attribute access throughout; add TestUProject, TestUCurve, TestTimeAxis, TestUstxEditor covering roundtrip, multi-tempo boundary, relative-tick translation, and context-manager save/no-save behaviour

test(seqtool): replace TestTimeConversion with TestTickConverterRegistry using _make_tick_converters() helper and tick_converters_120bpm fixture; drop TestNumericalStability (absorbed into registry tests)

test(base): replace loader.tempo with ustx_time_axis assertions; remove ustx_lock tests; add test_tick_converters_registered_after_init

test(wavtool): fix list → ndarray type assertions for extract_wav_frequency return values

test(expressive): fix integration test to use UProject attribute access

…del and multi-tempo support

BREAKING CHANGE: load_ustx() now returns UProject instead of dict;
save_ustx() now accepts UProject instead of dict;
edit_ustx_expression_curve() is removed — use UstxEditor or
UVoicePart.set_curve() instead.

feat(ustx): add UProject, UVoicePart, UCurve, UTrack, UTempo,
UTimeSignature dataclasses mirroring OpenUtau C# models

feat(ustx): add TimeAxis — piecewise tick ↔ ms converter replicating
OpenUtau's BuildSegments / TickPosToMsPos / MsPosToTickPos logic,
with full multi-tempo and multi-time-signature support

feat(ustx): add UstxEditor — RAII context manager with exclusive
FileLock, add_expression_to_part(), and add_expression_to_track()
(absolute → relative tick translation with per-part windowing)

feat(seqtool): replace time_to_ticks/ticks_to_time with a
set_tick_converters() / reset_tick_converters() registry; all
to_ticks=True paths and align_sequence_tick() now use the registered
tempo-map-aware converters instead of a fixed BPM approximation

feat(base): register tick converters from ustx_time_axis in
ExpressionLoader.__init__(); remove threading.Lock (superseded by
FileLock in UstxEditor); remove self.tempo in favour of
self.ustx_time_axis; offset shifting moved to load_to_ustx() via
shift_ticks_by_seconds()

feat(dyn,pitd,tenc): drop tempo/ppqn kwargs from align_sequence_tick
calls; remove manual utau_offset_ticks arithmetic; pitd gains RMS +
RMS dynamics features to match dyn/tenc feature sets

feat(examples): add テトリス and Прекрасное Далеко examples with
project.ustx, reference.wav, utau.wav, expressive_config.json and
README; update 明天会更好 project with reference track and corrected
exp_selectors; remove expressive_config.json from .gitignore

fix(wavtool): extract_wav_frequency now returns np.ndarray instead of
list, matching documented return type

deps: add filelock to pyproject.toml

test(ustx): replace dict-based assertions with UProject attribute
access throughout; add TestUProject, TestUCurve, TestTimeAxis,
TestUstxEditor covering roundtrip, multi-tempo boundary, relative-tick
translation, and context-manager save/no-save behaviour

test(seqtool): replace TestTimeConversion with TestTickConverterRegistry
using _make_tick_converters() helper and tick_converters_120bpm fixture;
drop TestNumericalStability (absorbed into registry tests)

test(base): replace loader.tempo with ustx_time_axis assertions; remove
ustx_lock tests; add test_tick_converters_registered_after_init

test(wavtool): fix list → ndarray type assertions for
extract_wav_frequency return values

test(expressive): fix integration test to use UProject attribute access

Co-authored-by: Claude <claude@anthropic.com>
@NewComer00 NewComer00 merged commit 83d33f0 into main Mar 22, 2026
3 checks passed
@NewComer00 NewComer00 deleted the feat/multi-parts-tempos branch March 22, 2026 10:08
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 90.58172% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
expressions/pitd.py 11.11% 16 Missing ⚠️
utils/ustx.py 95.86% 12 Missing ⚠️
expressions/tenc.py 0.00% 5 Missing ⚠️
utils/seqtool.py 96.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant