-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Change non-legacy control points to have CustomSampleBank 1 #29311
Change non-legacy control points to have CustomSampleBank 1 #29311
Conversation
I do agree with the direction of allowing sample banks to be overriden this way. There is no need for custum sample set indices because you can use custom bank names instead (though these cant be saved yet). However this implementation seems to still be somewhat broken. When I add a custom sample, I still need to cut and repaste the objects for the custom sound to play, and when I reload the editor or go in play the sounds are gone again. |
Are you testing on an existing beatmap? This change only affects creating new timing points, it will not change existing ones that are already saved as 0. |
I'm testing on a completely new beatmap. It's still very much broken. osu._7SeQSSoGva.mp4osu._FnCFBIoZsd.mp4 |
Found it - the encoder goes through each HItObject to add a SampleControlPoint to it, which was defaulting to CustomSampleBank -1: SampleControlPoint createSampleControlPointFor(double time, IList<HitSampleInfo> samples)
{
int volume = samples.Max(o => o.Volume);
int customIndex = samples.Any(o => o is ConvertHitObjectParser.LegacyHitSampleInfo)
? samples.OfType<ConvertHitObjectParser.LegacyHitSampleInfo>().Max(o => o.CustomSampleBank)
: -1;
return new LegacyBeatmapDecoder.LegacySampleControlPoint { Time = time, SampleVolume = volume, CustomSampleBank = customIndex };
} After changing that fallback to 1, custom hit sounds appear to be persisting: pr-29311-2.webm |
Before further review happens here I will link back #29280 here, and particularly #29280 (comment) which seems to indicate that this implementation is much more opinionated about what should happen than it probably should be. Would be good to set some expectations in stone first before we go in any direction what is this. I'm not sure I have a valid opinion to give on that, though. |
@@ -220,8 +220,15 @@ LegacyControlPointProperties getLegacyControlPointProperties(ControlPointGroup g | |||
var samplePoint = legacyControlPoints.SamplePointAt(group.Time); | |||
var effectPoint = legacyControlPoints.EffectPointAt(group.Time); | |||
|
|||
// if samplePoint isn't already legacy, create LegacyHitSampleInfo with customSampleBank 1 |
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.
If we're going to go with this, I want much better inline documentation describing what the expectations are, and what 1
means.
As pointed out by @bdach and #29280 (comment) there are some fundamental issues with this implementation that I failed to notice earlier, and I think we should go in a different direction. |
Going to close this for now based on #29311 (comment) and the fact that it's only a few lines of change. |
Passes test
osu.Game.Tests.Beatmaps.Formats.LegacyBeatmapEncoderTest
, which previous implementation #29084 failed (thanks @smoogipoo!)See also #29280 regarding long-term implementation of custom samplesets - this PR implements the third option proposed.