Skip to content
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

Music: fix preview plays #58491

Merged
merged 2 commits into from May 11, 2024
Merged

Music: fix preview plays #58491

merged 2 commits into from May 11, 2024

Conversation

breville
Copy link
Member

@breville breville commented May 9, 2024

With this change, plays of sounds marked with a type of "preview" no longer have their pitch shifted or rate changed. This allows previews of packs (both in the pack dialog and the sound panel) to play in their original form, even if the current project is set to a different BPM or key.

@breville breville requested review from moneppo and a team May 9, 2024 10:50
Copy link
Contributor

@thomasoniii thomasoniii left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@@ -353,6 +353,7 @@ export default class MusicPlayer {
effects: soundEvent.effects,
originalBpm: soundData.bpm || DEFAULT_BPM,
pitchShift: this.calculatePitchShift(soundData),
preview: soundData.type === 'preview',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we instead check this in calculatePitchShift and just return a pitch shift of 0 if soundData.type === preview (similar to how we do for 'beat')?

Looks like we'd still need some field to also indicate that we don't want tempo adjustment but then maybe we can rename this to disableTempoAdjustment or similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thing. Done.

@breville breville merged commit e897c0e into staging May 11, 2024
2 checks passed
@breville breville deleted the music-fix-preview-plays branch May 11, 2024 19:44
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.

None yet

3 participants