fabricatio_yue.models.segment
Models for representing song segments and complete songs.
This module provides the data structures for working with songs and their component segments in the Fabricatio YUE system. Songs are composed of multiple segments, each with their own properties like duration, genre tags, and lyrics.
Classes
Represents a segment of a song with its attributes. |
|
Represents a complete song with its attributes and segments. |
Module Contents
- class fabricatio_yue.models.segment.Segment(/, **data: Any)
Bases:
fabricatio_core.models.generic.SketchedAbleRepresents a segment of a song with its attributes.
- duration: pydantic.NonNegativeInt
Duration of the segment in seconds
- extra_genres: List[str] = None
Additional genre tags for this segment to control generation if specified.
- class fabricatio_yue.models.segment.Song(/, **data: Any)
Bases:
fabricatio_core.models.generic.SketchedAble,fabricatio_core.models.generic.WithBriefingRepresents a complete song with its attributes and segments.
- property duration: pydantic.NonNegativeInt
Total duration of the song in seconds.
Calculated by summing the durations of all segments in the song.
- Returns:
The total duration in seconds
- Return type:
NonNegativeInt
- override_genres(genres: List[str]) Self
Override the primary genre tags for the entire song.
- Parameters:
genres (List[str]) – New list of genre tags
- save_to(parent_dir: str | pathlib.Path) Self
Save the song to a directory.
- Parameters:
parent_dir (str) – The directory to save the song to