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

Adding pitch support #2564

Merged
merged 10 commits into from
Sep 29, 2022
Merged

Adding pitch support #2564

merged 10 commits into from
Sep 29, 2022

Conversation

Cheemsandfriends
Copy link
Contributor

I know there's already a PR that's been merged in lime right here
but that build doesn't seem to be public yet, sooo I decided to make this support as local as possible (also that it may work on more than one version while using lime idk)

@Cheemsandfriends
Copy link
Contributor Author

I'll work on this, it's just that it works when you play and change the pitch, but when you play it with the pitch already given, it doesn't for some reason?

@Cheemsandfriends Cheemsandfriends marked this pull request as ready for review August 4, 2022 08:50
Copy link
Member

@Geokureli Geokureli left a comment

Choose a reason for hiding this comment

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

failing on cpp

Plus previous concerns haven't been addressed

@Cheemsandfriends
Copy link
Contributor Author

I think the failing on cpp is a false alarm, cos I have everything ok (testing on desktop at least), and if I check on the cpp builds, there seem to have an error somewhere in Run HaxeFlixel/setup-flixel@master which honestly I can't find the error.

@Cheemsandfriends
Copy link
Contributor Author

I also addressed the concerns that you have about the code I made, when you can tell me if you have any questions about what I replied or adding some suggestion of my code

@Geokureli
Copy link
Member

Geokureli commented Aug 16, 2022

I think the failing on cpp is a false alarm, cos I have everything ok (testing on desktop at least), and if I check on the cpp builds, there seem to have an error somewhere in Run HaxeFlixel/setup-flixel@master which honestly I can't find the error.

I don't think it's a false alarm, I'm seeing the unit tests failing at:

Class: flixel.system.FlxSoundGroupTest .
Segmentation fault (core dumped)

Have you ran the unit tests on cpp? Have you tried using this feature for sounds in a soundGroup? try using this feature with FlxG.sound.play(...), it will add the sound to the default sound group

@Cheemsandfriends
Copy link
Contributor Author

I hope you don't mind re-re-requesting another review about this @Geokureli lmao

Copy link
Member

@Geokureli Geokureli left a comment

Choose a reason for hiding this comment

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

still failing on flash

#else
@:privateAccess
if (_channel.__source != null)
_channel.__source.pitch = v;
Copy link
Member

Choose a reason for hiding this comment

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

getting errors here:

.../FlxSound.hx:752: characters 17-25 : flash.media.SoundChannel has no field __source
.../FlxSound.hx:753: characters 14-22 : flash.media.SoundChannel has no field __source

There must be a problem with the FLX_PITCH definition

@@ -129,6 +131,9 @@ class FlxDefines
defineInversion(FLX_NO_FOCUS_LOST_SCREEN, FLX_FOCUS_LOST_SCREEN);
defineInversion(FLX_NO_DEBUG, FLX_DEBUG);
defineInversion(FLX_NO_POINT_POOL, FLX_POINT_POOL);
#if (openfl_legacy && sys || lime >= "8.0.0" && !flash)
defineInversion(FLX_NO_PITCH, FLX_PITCH);
#end
Copy link
Member

@Geokureli Geokureli Sep 28, 2022

Choose a reason for hiding this comment

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

the #if shouldn't be here, FLX_PITCH and FLX_NO_PITCH will always be inversions of each other, you need to define FLX_PITCH here:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why it shouldn't be there?
afaik, defineInversion is for stuff that has 2 sides, the yes and the no version, which, what defineInversions() does afaik.
defineHelperDefines() only adds defines depending if it can help the first thing
unless I'm overlooking things

Copy link
Member

Choose a reason for hiding this comment

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

None of the other inversion are wrapped in #ifs, take a look at what
defineInversion() actually does
. I believe this is the reason flash is failing

@Geokureli
Copy link
Member

also do you have a little tiny project that uses this feature you could share?

@Cheemsandfriends
Copy link
Contributor Author

also do you have a little tiny project that uses this feature you could share?

I have one little project that I used for testing back in the lime pr.
do you want me to publish that thing?

@Geokureli
Copy link
Member

Geokureli commented Sep 28, 2022

do you want me to publish that thing?

Either that, or send me a relevant snippet, or zip it on discord

@Cheemsandfriends
Copy link
Contributor Author

Either that, or send me a relevant snippet, or zip it on discord

Sure! here it is!

@Cheemsandfriends
Copy link
Contributor Author

and I believe this should wrap it up @Geokureli?

@Geokureli
Copy link
Member

something is odd about this, I feel I was wrong about the order here. FLX_NO_PITCH needs to be set to true on flash and openfl legacy before defineInversions is called.

Right now it's still failing on flash

@Cheemsandfriends
Copy link
Contributor Author

something is odd about this, I feel I was wrong about the order here. FLX_NO_PITCH needs to be set to true on flash and openfl legacy before defineInversions is called.

Right now it's still failing on flash

I believe it was still failing on flash cos I forgot a semicolon when setting the FLX_NO_PITCH thing.
let's wait for the checker to check everything, but even then, I do believe that my setting of stuff wasn't bad but whatev lmao

@Geokureli
Copy link
Member

oh no, it was failing on flash because I was testing with your demo, which should fail on flash, Im dumb

@Cheemsandfriends
Copy link
Contributor Author

oh no, it was failing on flash because I was testing with your demo, which should fail on flash, Im dumb

Oh LMAO

@Cheemsandfriends
Copy link
Contributor Author

a/w I think that rn it's somewhat acceptable to merge, unless there's another change that should be made @Geokureli?

@Geokureli Geokureli merged commit e58f765 into HaxeFlixel:dev Sep 29, 2022
@ninjamuffin99
Copy link
Member

I think it would be nice / accessible to have a demo, or at the very least a snippet that nicely demos the new pitch support, just suggestion tho !!!

@Cheemsandfriends
Copy link
Contributor Author

I think it would be nice / accessible to have a demo, or at the very least a snippet that nicely demos the new pitch support, just suggestion tho !!!

I don't mind if geokureli wants to use this as a pitch sample.
I doubt it but if he wants to I won't mind lmao

@Geokureli
Copy link
Member

thanks cheems, I'll probably use that as a starting point, if not, as is

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