GitHub - haruneko/jules_test: Test Repository for Jules (original) (raw)

Music Editor Prototype (Tauri + React + Typescript)

This project is a prototype for a music editor frontend, focusing on handling data structures for vocal synthesis software like VOCALOID, UTAU, and Synthesizer V. It's built using Tauri, React, and Typescript with Vite.

Project Overview

The application aims to provide a user interface for creating and editing musical scores, with a layout typically featuring a piano roll at the top and a control area at the bottom. This prototype focuses on establishing the foundational data structures and basic UI placeholders.

Data Structures

Core data types are defined in src/types/music.ts:

State Management

Application state, primarily lists of notes and events, is managed using React Context API.

UI Features

The application now features a more integrated and visually detailed interactive music editing interface:

Key Components

Theming and Customization

The application's color scheme can be customized using CSS custom properties (variables). These properties are defined in src/App.css within the :root selector for the default (light) theme, and also within a @media (prefers-color-scheme: dark) block providing initial support for a dark theme.

You can customize these colors by:

Available CSS Custom Properties:

Piano Keyboard (--pkb-)

Piano Roll (--proll-)

Project Setup

  1. Prerequisites:
    • Node.js (which includes npm or pnpm/yarn)
    • Rust and its toolchain (including Cargo)
    • Follow the Tauri prerequisites guide: Tauri Prerequisites
  2. Clone the repository (if applicable)
  3. Install dependencies: Navigate to the project root directory and run: (If you prefer npm or yarn, you might need to adapt this command and ensure uuid and @types/uuid are installed.)

Development

To start the development server and open the app in development mode, run the following command in the project root directory:

This command will compile the Rust backend and start the Vite development server for the React frontend. Changes in your frontend or backend code will trigger automatic rebuilding and reloading of the application.

Building

To build the application for production, use the following command:

This will compile the Rust backend in release mode and build the frontend assets. The resulting executables and installers will be located in src-tauri/target/release/bundle/. (The exact path might vary based on your project's name if it's different from the template's default).

Important Note on Rust Version: Some Tauri dependencies require Rust compiler version 1.77.2 or newer. If your installed Rust version is older (e.g., 1.75.0), the pnpm tauri build command may fail during backend compilation. Please ensure your Rust installation is up to date if you encounter build issues. You can check your Rust version with rustc --version and update it using rustup update.

Testing

Unit tests for key React components have been implemented using React Testing Library and Jest (via Vitest's Jest-compatible API if using Vitest, or directly if Jest is configured).

Running Tests:

To run the unit tests, use the following command in the project root directory:

This command will execute the test suite and report results. (Ensure Vitest or your chosen test runner is configured in package.json's scripts section for this command).

Manual Testing:

Manual interaction with the UI is still valuable for end-to-end testing:

  1. Run pnpm tauri dev.
  2. In the "Control Area", you can use buttons to add sample data:
    • "Add Sample Tempo Event" and "Add Sample Time Signature Event" populate respective event types.
    • A debug button labeled "Add 'DoReMiReDo' Notes" is available. Clicking this button will add a sequence of five notes (C4-D4-E4-D4-C4, lyrics: "ドレミレド") starting at tick 0, useful for quickly populating the piano roll for testing note display and interaction.
  3. Interact with Notes:
    • Click on notes in the Piano Roll to select/deselect them.
    • With a note selected, press 'Delete' or 'Backspace' to remove it.
    • With a note selected, press 'Enter' to edit its lyric. Type a new lyric and press 'Enter' to confirm or 'Escape' to cancel.
  4. Verify that the Piano Keyboard correctly displays note positions and highlights C4.
  5. Verify that events (Tempo, Time Signature) are displayed and can be manipulated in the "Control Area".