Referencia Core
Documentación autogenerada de los módulos core.
Reclist Parser module.
This module handles parsing of 7-Mora reclist files for VCV voicebanks. Based on Section 6, MÓDULO 1 specification.
ReclistParseError
Bases: Exception
Exception raised when reclist parsing fails.
Attributes:
| Name | Type | Description |
|---|---|---|
line_number |
The line number where the error occurred |
|
line_content |
The content of the problematic line |
|
message |
Detailed error message |
Source code in src/core/reclist_parser.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
ReclistParser
Parser for 7-Mora VCV reclist files.
Analyzes reclist text files and converts them into structured PhoneticLine objects with metadata for each line.
The parser identifies: - Pure vowels (VV): a_a_i_a_u_e_o - Basic consonants (CV): ba_be_bi_bo_bu_ba_b - Clusters (CCR/CCL): pra_pre_pri... - Diphthongs (DIP): kya_kyu_kyo... - Breaths (R): R or breath markers
Example
parser = ReclistParser(bpm=120) lines = parser.parse_file("reclist.txt") print(lines[0].segments) ['a', 'a', 'i', 'a', 'u', 'e', 'o']
Source code in src/core/reclist_parser.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
__init__(bpm=DEFAULT_BPM)
Initialize parser with BPM for duration calculations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bpm
|
int
|
Beats per minute for timing calculations |
DEFAULT_BPM
|
Source code in src/core/reclist_parser.py
75 76 77 78 79 80 81 82 | |
detect_phoneme_type(segment)
Classify a phoneme segment into its type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
segment
|
str
|
Individual segment (e.g., "ba", "a", "pra") |
required |
Returns:
| Type | Description |
|---|---|
PhonemeType
|
PhonemeType classification |
Source code in src/core/reclist_parser.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
get_line_summary(line)
Generate a human-readable summary of a phonetic line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
PhoneticLine
|
PhoneticLine to summarize |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted summary string |
Source code in src/core/reclist_parser.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
parse_content(content)
Parse reclist content string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
Raw text content of reclist |
required |
Returns:
| Type | Description |
|---|---|
List[PhoneticLine]
|
List of PhoneticLine objects |
Raises:
| Type | Description |
|---|---|
ReclistParseError
|
If content format is invalid |
Source code in src/core/reclist_parser.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
parse_file(filepath)
Parse a reclist file and return list of PhoneticLine objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to the reclist .txt file |
required |
Returns:
| Type | Description |
|---|---|
List[PhoneticLine]
|
List of PhoneticLine objects with complete metadata |
Raises:
| Type | Description |
|---|---|
ReclistParseError
|
If the file format is invalid |
FileNotFoundError
|
If the file doesn't exist |
Source code in src/core/reclist_parser.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
validate_mora_count(line, expected=MORAS_PER_LINE)
Verify that the line has the expected number of moras.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
str
|
Raw line text |
required |
expected
|
int
|
Expected mora count (default: 7) |
MORAS_PER_LINE
|
Returns:
| Type | Description |
|---|---|
bool
|
True if mora count matches expected |
Source code in src/core/reclist_parser.py
188 189 190 191 192 193 194 195 196 197 198 199 | |
Data models for VocalParam.
This module contains all dataclasses and enums used throughout the application. Following the specification in Section 6-7 of the design document.
OtoEntry
dataclass
Represents a single entry in oto.ini file.
Format: filename.wav=alias,offset,consonant,cutoff,preutter,overlap
Attributes:
| Name | Type | Description |
|---|---|---|
filename |
str
|
WAV file name |
alias |
str
|
Phonetic alias (e.g., "- ba" or "a be") |
offset |
float
|
Start position in ms (cian/cyan line) |
consonant |
float
|
Fixed consonant region in ms (dark blue line) |
cutoff |
float
|
End position in ms, negative = from end (pink/magenta line) |
preutter |
float
|
Pre-utterance point in ms (red line) |
overlap |
float
|
Overlap region in ms (green line) |
Source code in src/core/models.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
from_oto_line(line)
classmethod
Parse an oto.ini format line.
Source code in src/core/models.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
to_oto_line()
Convert to oto.ini format string.
Source code in src/core/models.py
94 95 96 97 98 99 100 101 | |
validate()
Validate OTO parameters.
Checks: - Overlap <= Preutterance (Gold Rule)
Returns:
| Type | Description |
|---|---|
List[str]
|
List of error messages. |
Source code in src/core/models.py
121 122 123 124 125 126 127 128 129 130 131 132 133 | |
PhonemeType
Bases: Enum
Classification of phoneme segments.
Based on RF-02.1 specification: - VV: Pure vowels - CV: Consonant + Vowel (basic) - VCV: Vowel-Consonant-Vowel transitions - VC: Vowel + Consonant (coda) - CCR: Consonant clusters (right) - CCL: Consonant clusters (left) - DIP: Diphthongs (palatization/labialization) - R: Breaths/respirations
Source code in src/core/models.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
PhoneticLine
dataclass
Represents a single line from the Reclist.
As specified in Section 6, MÓDULO 1.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
int
|
Line number (001, 002...) |
raw_text |
str
|
Original text from reclist (e.g., "ba_be_bi_bo_bu_ba_b") |
segments |
List[str]
|
List of individual segments (e.g., ["ba", "be", "bi"...]) |
phoneme_types |
List[PhonemeType]
|
Classification of each segment |
expected_duration_ms |
float
|
Calculated duration based on BPM |
filename |
str
|
Generated WAV filename |
Source code in src/core/models.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
mora_count
property
Number of moras (segments) in this line.
ProjectData
dataclass
Complete project state for serialization (JSON).
Based on Section 7 data model specification.
Source code in src/core/models.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
from_dict(data)
classmethod
Create ProjectData from dictionary with validation.
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing. |
Source code in src/core/models.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
to_dict()
Convert to dictionary for JSON serialization.
Source code in src/core/models.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
validate()
Validate project data consistency.
Returns:
| Type | Description |
|---|---|
List[str]
|
List of error messages, empty if valid. |
Source code in src/core/models.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
Recording
dataclass
Represents a single recording with its oto entries.
Source code in src/core/models.py
136 137 138 139 140 141 142 143 144 | |
RecordingStatus
Bases: Enum
Status of a recording line.
Source code in src/core/models.py
36 37 38 39 40 | |