-
Notifications
You must be signed in to change notification settings - Fork 2
Performance work with copilot #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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.
…s and add them as a CI task
❌ Deploy Preview for singing-synthesis failed.
|
There was a problem hiding this 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) { |
Copilot
AI
Apr 20, 2025
There was a problem hiding this comment.
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.
✅ Deploy Preview for vehpus-singing-synthesis ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
No description provided.