Skip to content

Conversation

@VehpuS
Copy link
Owner

@VehpuS VehpuS commented Apr 20, 2025

No description provided.

- Refactored audio generation logic to utilize a web worker for improved performance and UI responsiveness.
- Introduced `useVoiceGenerationWorker` hook to manage audio generation requests and worker lifecycle.
- Added `useXmlProcessingWorker` hook for processing MusicXML files in a background thread.
- Created `WorkerControls` component to toggle between worker and legacy modes for audio generation.
- Enhanced `generateOddVoiceJsonForSplit` function to optimize event generation and handle edge cases.
- Implemented error handling and loading states for voice and XML processing.
- Added new worker scripts for voice generation and XML processing, ensuring modularity and separation of concerns.
@VehpuS VehpuS requested a review from Copilot April 20, 2025 07:59
@netlify
Copy link

netlify bot commented Apr 20, 2025

Deploy Preview for singing-synthesis failed.

Name Link
🔨 Latest commit 4be98ae
🔍 Latest deploy log https://app.netlify.com/sites/singing-synthesis/deploys/6804a97209556e0008946204

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances performance by introducing dedicated worker hooks for XML processing and voice generation, refactoring the voice synthesis pipeline and UI integration, and updating tests to remove redundant events. Key changes include:

  • New hooks (useXmlProcessingWorker and useVoiceGenerationWorker) to offload computation to background threads.
  • Modifications to voice generation and event processing logic in oddVoiceJSON with optimizations for rest transitions.
  • UI updates in App and associated components to incorporate worker controls and fallback logic.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/workers/useXmlProcessingWorker.tsx Added XML processing worker hook with message and error handling.
src/workers/useVoiceGenerationWorker.tsx Introduced voice generation worker hook with fallback error handling.
src/oddvoices/index.tsx Updated voice synthesis integration and added file unlinking in FS operations.
src/oddVoiceJSON/index.ts Refactored event generation logic to optimize rest and note transitions.
src/components/* Refactored components (UploadButton, useGenerateAudio, App, WorkerControls) to integrate worker functionality and update state handling.
.github/workflows/* Added CI/test workflows and made deployment dependent on test success.
Files not reviewed (2)
  • musicxml-singer-with-oddvoices/package-lock.json: Language not supported
  • musicxml-singer-with-oddvoices/package.json: Language not supported
Comments suppressed due to low confidence (3)

musicxml-singer-with-oddvoices/src/components/App/useGenerateAudio.tsx:72

  • [nitpick] When workerGenerateAudio fails and falls back to legacy mode, the error log could include more diagnostic details. Consider enhancing the error message to include additional context (such as the request id or parameters) for easier troubleshooting.
return workerGenerateAudio(oddVoiceJson, voice);

musicxml-singer-with-oddvoices/src/components/UploadButton/index.tsx:19

  • [nitpick] The removal of the setOddVoiceOutputs and resetAudioOutputs props in the UploadButton component alters its API. Please ensure that all consumers of this component have been updated accordingly and update the component documentation to reflect this change.
setOddVoiceOutputs and resetAudioOutputs props removed

musicxml-singer-with-oddvoices/src/components/App/index.tsx:93

  • The function createSplitOddVoiceJsonInputsFromMusicXml is used without a corresponding import in App/index.tsx; ensure that it is correctly imported from the oddVoiceJSON module to avoid runtime undefined errors.
outputs = createSplitOddVoiceJsonInputsFromMusicXml(parsedXml);

newEvents.push(

// Transition from non-rest to rest
if (isRest && !inRestSection) {
Copy link

Copilot AI Apr 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new inRestSection logic introduces a branch that uses 'continue' to skip processing subsequent rest events. Please review the logic to ensure that transitions from rest to non-rest sections are handled correctly and that no valid event is skipped inadvertently.

Copilot uses AI. Check for mistakes.
@netlify
Copy link

netlify bot commented Apr 20, 2025

Deploy Preview for vehpus-singing-synthesis ready!

Name Link
🔨 Latest commit 4be98ae
🔍 Latest deploy log https://app.netlify.com/sites/vehpus-singing-synthesis/deploys/6804a9729d8ea70008f0ecfb
😎 Deploy Preview https://deploy-preview-8--vehpus-singing-synthesis.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants