UtaFormatix3
repository·master·Indexed 43 days ago
https://github.com/sdercolin/utaformatix3A project conversion tool for singing voice synthesizer software that allows users to move projects between different formats while preserving tracks, notes, and lyrics metadata. Built with Kotlin for JavaScript and React, it supports a wide range of import and export formats including .vsqx, .vpr, .vsq, .ust, .ustx, .svp, and .mid.
What's inside UtaFormatix3
- UtaFormatix3 is an application designed for converting projects among various singing voice synthesizer softwares. It is built using Kotlin for JavaScript and React. It preserves essential project information such as tracks, notes, tempo labels, and time signatures during conversion.
Set up UtaFormatix3 for Development
masterTo develop on UtaFormatix3, follow these steps:
- Install IntelliJ IDEA.
- Clone the repository and import it as a Gradle project.
- Configure IDEA's Gradle settings to use
JDK 21and enableUse Gradle Wrapper. - Run the application using the following command:
./gradlew jsBrowserDevelopmentRunAlternatively, you can use the Gradle Task
other/jsBrowserDevelopmentRunwithin IntelliJ.For development with live reloading enabled, use:
./gradlew jsBrowserDevelopmentRun --continuous# Run the development server ./gradlew jsBrowserDevelopmentRun # Run with live reloading enabled ./gradlew jsBrowserDevelopmentRun --continuousHow to contribute to UtaFormatix3
masterWorkflow
- Branch off from the
developbranch. - Submit Pull Requests towards the
developbranch. - Ensure both
buildandktlintCheckGradle tasks pass before submitting.
Common Tasks
- Adding a format support: Refer to
core/src/main/kotlin/core/model/Format.ktand its usages. - Adding a Language: Refer to
src/jsMain/kotlin/ui/strings/Strings.kt. - Adding a configurable process: Refer to
src/jsMain/kotlin/ui/ConfigurationEditor.ktto understand existing processes. - Fixing code formatting: Use the
ktlintFormatGradle task to automatically fix most formatting issues. If your IDE formatter conflicts withktlint, ensure it imports settings from the.editorconfigfile.
- Branch off from the
Supported Import and Export Formats
masterUtaFormatix3 supports a wide range of singing voice synthesizer formats for both importing and exporting projects.
Supported Importing Formats:
.vsqx(3/4),.vpr,.vsq,.mid(VOCALOID),.mid(standard),.ust,.ustx,.ccs,.xml(MusicXML),.musicxml,.svp,.s5p,.dv,.ppsf(NT),.tssln,.ufdata
Supported Exporting Formats:
.vsqx(4),.vpr,.vsq,.mid(VOCALOID),.mid(standard),.ust,.ustx,.ccs,.xml(MusicXML),.svp,.s5p,.dv,.tssln,.ufdata
Pitch, Vibrato, and Data Support by Format
masterThe following table details which formats support importing/exporting pitch and vibrato data:
Format Pitch import Vibrato import Pitch export VSQ/VSQX/VPR/MID(V1) ✓ ✓ UST(mode2) ✓ ✓ ✓ UST(mode1) ✓ N/A ✓ USTX ✓ ✓ ✓ CCS ✓ ✓ SVP ✓ ✓ ✓ S5P ✓ ✓ DV ✓ ✓ ✓ | Format | Pitch import | Vibrato import | Pitch export | |----------------------|--------------|----------------|--------------| | VSQ/VSQX/VPR/MID(V1) | ✓ | | ✓ | | UST(mode2) | ✓ | ✓ | ✓ | | UST(mode1) | ✓ | N/A | ✓ | | USTX | ✓ | ✓ | ✓ | | CCS | ✓ | | ✓ | | SVP | ✓ | ✓ | ✓ | | S5P | ✓ | | ✓ | | DV | ✓ | ✓ | ✓ |Handle unsupported file format errors
masterWhen attempting to process a file that the system does not recognize or support, the library throws anUnsupportedFileFormatError. This is a base exception class. A specific subclass,UnsupportedLegacyPpsfError, is thrown specifically when a legacy.ppsffile format is encountered that the current version cannot process.Handle import warnings in UtaFormatix3
masterDuring the import process, UtaFormatix3 may emit
ImportWarningobjects to notify the user of non-fatal issues such as missing metadata, ignored tempo/time signature settings, or version mismatches. These warnings allow the import to proceed while informing the user of potential data discrepancies.Available warning types include:
- Tempo Issues:
TempoNotFound: No tempo information was found.TempoIgnoredInFile(file, tempo): A specific tempo in the file was ignored.TempoIgnoredInTrack(track, tempo): A tempo within a specific track was ignored.TempoIgnoredInPreMeasure(tempo): A tempo in a pre-measure was ignored.DefaultTempoFixed(originalBpm): The original BPM was invalid or missing, and a default tempo was applied.
- Time Signature Issues:
TimeSignatureNotFound: No time signature information was found.TimeSignatureIgnoredInTrack(track, timeSignature): A time signature within a specific track was ignored.TimeSignatureIgnoredInPreMeasure(timeSignature): A time signature in a pre-measure was ignored.
- Version Issues:
IncompatibleFormatSerializationVersion(currentVersion, dataVersion): The data version is incompatible with the current software version.
// Example of handling specific warning types when (warning) { is ImportWarning.TempoNotFound -> println("Warning: No tempo found.") is ImportWarning.DefaultTempoFixed -> println("Warning: Fixed BPM from ${warning.originalBpm}") is ImportWarning.IncompatibleFormatSerializationVersion -> println("Version mismatch: ${warning.dataVersion} vs ${warning.currentVersion}") // ... handle other cases }- Tempo Issues:
Handle IllegalFileException errors
masterWhen working with UtaFormatix3, you may encounter
IllegalFileExceptionwhen attempting to load or parse files that are corrupted, use an unsupported version, or do not match the expected format. This is a sealed class, meaning you can use exhaustive pattern matching (e.g.,whenin Kotlin) to handle specific failure cases.Common error subtypes include:
UnknownVsqVersion: The.vsqxfile version cannot be identified.XmlRootNotFound: The XML file is missing its root element.XmlElementNotFound(name): A required XML element<name>is missing.XmlElementValueIllegal(name): A required XML element<name>contains an invalid value.XmlElementAttributeValueIllegal(attribute, elementName): An attribute is missing or invalid within a specific element.IllegalMidiFile: The file cannot be parsed as a MIDI file.IllegalTsslnFile: The file cannot be parsed as a.tsslnfile.
try { // Attempt to load a file } catch (e: IllegalFileException) { when (e) { is IllegalFileException.UnknownVsqVersion -> println("Version error") is IllegalFileException.XmlRootNotFound -> println("XML structure error") is IllegalFileException.XmlElementNotFound -> println("Missing element: ${e.message}") // ... handle other cases else -> println("General file error: ${e.message}") } }UnsupportedLegacyPpsfError
masterA specific subclass ofUnsupportedFileFormatErrorthrown when the system encounters a legacy.ppsffile format that is not supported.UnsupportedFileFormatError
masterA base exception thrown when a file format is not supported by UtaFormatix3. It is marked with@JsExport, making it available for use in JavaScript environments.Handle ValueTooLargeException
masterThe
ValueTooLargeExceptionis thrown when a provided value exceeds the allowed maximum limit. This exception is exported for use in JavaScript environments via@JsExport. It contains the offendingvalueand themaxValuelimit in its constructor, providing a descriptive error message:"Given value $value is larger than the maximum: $maxValue."// Example of how this exception might be caught in Kotlin try { // operation that might exceed limits } catch (e: ValueTooLargeException) { println(e.message) }