UtaFormatix3

repository·master·Indexed 43 days ago

https://github.com/sdercolin/utaformatix3

A 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.

Tokens
2.2K
Snippets
5
Records
11
Agent score
55%

What's inside UtaFormatix3

  1. Overview of UtaFormatix3

    master
    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.
  2. Set up UtaFormatix3 for Development

    master

    To develop on UtaFormatix3, follow these steps:

    1. Install IntelliJ IDEA.
    2. Clone the repository and import it as a Gradle project.
    3. Configure IDEA's Gradle settings to use JDK 21 and enable Use Gradle Wrapper.
    4. Run the application using the following command:
    ./gradlew jsBrowserDevelopmentRun

    Alternatively, you can use the Gradle Task other/jsBrowserDevelopmentRun within IntelliJ.

    For development with live reloading enabled, use:

    ./gradlew jsBrowserDevelopmentRun --continuous
    # Run the development server
    ./gradlew jsBrowserDevelopmentRun
    
    # Run with live reloading enabled
    ./gradlew jsBrowserDevelopmentRun --continuous
  3. How to contribute to UtaFormatix3

    master

    Workflow

    • Branch off from the develop branch.
    • Submit Pull Requests towards the develop branch.
    • Ensure both build and ktlintCheck Gradle tasks pass before submitting.

    Common Tasks

    • Adding a format support: Refer to core/src/main/kotlin/core/model/Format.kt and 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.kt to understand existing processes.
    • Fixing code formatting: Use the ktlintFormat Gradle task to automatically fix most formatting issues. If your IDE formatter conflicts with ktlint, ensure it imports settings from the .editorconfig file.
  4. Supported Import and Export Formats

    master

    UtaFormatix3 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
  5. Pitch, Vibrato, and Data Support by Format

    master

    The following table details which formats support importing/exporting pitch and vibrato data:

    FormatPitch importVibrato importPitch 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                   | ✓            | ✓              | ✓            |
  6. Handle import warnings in UtaFormatix3

    master

    During the import process, UtaFormatix3 may emit ImportWarning objects 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
    }
  7. Handle IllegalFileException errors

    master

    When working with UtaFormatix3, you may encounter IllegalFileException when 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., when in Kotlin) to handle specific failure cases.

    Common error subtypes include:

    • UnknownVsqVersion: The .vsqx file 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 .tssln file.
    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}")
        }
    }
  8. Handle ValueTooLargeException

    master

    The ValueTooLargeException is thrown when a provided value exceeds the allowed maximum limit. This exception is exported for use in JavaScript environments via @JsExport. It contains the offending value and the maxValue limit 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)
    }