-
Notifications
You must be signed in to change notification settings - Fork 427
Enunu style support #1506
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
Enunu style support #1506
Conversation
EnunuConfig Extensions and Rendering Improvements Added new properties and classes to `EnunuConfig.cs` to make the configuration more extensible. Modified the `PhraseToEnunuNotes` method to take `EnunuConfig` as an argument and added `timbre` construction logic using `style_format`. The `GetSuggestedExpressions` method has also been updated to properly load when the configuration is null. The `Load` method now has a condition to consider the `unLoadSubBanks` property, and `EnunuUtils.cs` now has `UTF8` encoding.
The lines `using System.Diagnostics;` and `using Vortice;` have been removed. This means that these namespaces are no longer used in this file.
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 introduces Enunu style support by extending the Enunu configuration and updating rendering logic for improved style and subbank handling.
- Extended EnunuConfig with new properties and parsing logic for style formats and expression details.
- Modified rendering functions to pass configuration and incorporate style formatting in note generation.
- Updated the singer loading logic to conditionally add subbanks based on the new configuration parameter.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| OpenUtau.Core/Enunu/EnunuUtils.cs | Added UTF8 encoding support. |
| OpenUtau.Core/Enunu/EnunuSinger.cs | Adjusted subbank addition logic to consider the unLoadSubBanks setting. |
| OpenUtau.Core/Enunu/EnunuRenderer.cs | Updated PhraseToEnunuNotes to accept a config parameter and fixed note style processing; added logic for generating suggested expressions. |
| OpenUtau.Core/Enunu/EnunuConfig.cs | Extended config to include unLoadSubBanks and parsing for style_format and styles. |
Comments suppressed due to low confidence (2)
OpenUtau.Core/Enunu/EnunuConfig.cs:14
- [nitpick] Consider renaming 'unLoadSubBanks' to 'UnloadSubBanks' to follow standard C# naming conventions for boolean properties.
public bool unLoadSubBanks = false;
OpenUtau.Core/Enunu/EnunuRenderer.cs:300
- The variable 'config' is referenced in GetSuggestedExpressions without a clear declaration within the method or as a class member. Ensure that 'config' is properly defined or passed to the method to avoid runtime errors.
if(config == null) {
| } | ||
| } | ||
| timbre += result; | ||
| timbre = timbre.TrimEnd('/'); |
Copilot
AI
Apr 21, 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 'timbre' variable is declared outside the phone loop and is not reset for each iteration, which may lead to unintended accumulation of style values. Consider initializing 'timbre' inside the loop for each phone.
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 AI seems to have a point?
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.
@stakira
The timbre is assigned a style setting for each suffix and voicebank.
The style settings are assembled in lines 254 to 284 and the result is assigned to result.
The result is appended to timbre at line 280.
As timbre is set to EnunuNote (phoneme), timbre is initialised at line 255 each time an EnunuNote is created.
…nfig は各メソッド内でのみ有効となり、クラス全体の状態を持たなくなりました。Render や GetSuggestedExpressions メソッド内で config を初期化するよう修正し、コードのスコープが明確化されました。
|
Corrected the way format is specified. extensions:
style_format:
p9:
format: "{0}{1}{2}{3}"
index: [ldst, loud, nrml, soft]
p16:
format: "s{0}s{1}r{2}b{3}p{4}"
index: [Std, swt, rock, brth, pop] |
…log out singer names and voicebank hashes.
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 Enunu configuration and rendering by introducing style support, updated configuration handling, and improved encoding support. Key changes include adding a UTF8 encoding constant, updating subbank loading logic based on a new configuration flag, refactoring the PhraseToEnunuNotes method to use the latest configuration, and expanding the EnunuConfig parser to support new style format and expression properties.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| OpenUtau.Core/Enunu/EnunuUtils.cs | Added a UTF8 encoding constant to support flexible text encoding. |
| OpenUtau.Core/Enunu/EnunuSinger.cs | Modified subbanks loading condition to honor the enuconfig.unLoadSubBanks flag. |
| OpenUtau.Core/Enunu/EnunuRenderer.cs | Updated configuration handling in PhraseToEnunuNotes and GetSuggestedExpressions; removed unused field. |
| OpenUtau.Core/Enunu/EnunuConfig.cs | Added a new unLoadSubBanks property and extended parsing functionality for style_format and styles. |
Comments suppressed due to low confidence (2)
OpenUtau.Core/Enunu/EnunuRenderer.cs:304
- Returning null from GetSuggestedExpressions may force callers to perform extra null checks; consider returning an empty array for a more consistent API.
if (ensinger == null) { return null; }
OpenUtau.Core/Enunu/EnunuConfig.cs:206
- Overwriting the flag variable within ParseEnunuStyleFormat may inadvertently discard valid entries if extra keys are present. Consider checking for required keys without unconditionally resetting the flag.
else { flag = false; }
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…penUtau into Enunu_Style_Support
The addition of values to `part` variables has been changed from the `=` operator to the `+=` operator. This fixes a problem where the flag key was not included.
Removed the `config` field.
EnunuConfig Extensions and Rendering Improvements
Added new properties and classes to
EnunuConfig.csto make the configuration more extensible. Modified thePhraseToEnunuNotesmethod to takeEnunuConfigas an argument and addedtimbreconstruction logic usingstyle_format. TheGetSuggestedExpressionsmethod has also been updated to properly load when the configuration is null. TheLoadmethod now has a condition to consider theunLoadSubBanksproperty, andEnunuUtils.csnow hasUTF8encoding.Voice colours (strength, singing style) for the following sources are now loaded from config.yaml.
NNSVS/ENUNU 波音リツ CRISSCROSS 5スタイル #4130
An option to not read in voice colours from the question file has been added.