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

Sound: Add pitch option #5960

Merged
merged 2 commits into from Jun 11, 2017
Merged

Sound: Add pitch option #5960

merged 2 commits into from Jun 11, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jun 11, 2017

minetest.sound_play("sound", {
    pitch = 1.5
})

minetest.register_node("aaa:aaa", {
    sounds = {
        footstep = {name = "default_place_node", gain = 1.0, pitch = 1.5}
    }
})

@ghost ghost changed the title sound_play: Add pitch option Sound: Add pitch option Jun 11, 2017
@bigfoot547
Copy link
Contributor

This would make noteblocks a lot easier

@@ -775,28 +776,30 @@ void Client::handleCommand_PlaySound(NetworkPacket* pkt)
u16 object_id;
bool loop;
float fade = 0;
float pitch = 1.0;
Copy link
Member

Choose a reason for hiding this comment

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

1.0f

@@ -228,25 +228,27 @@ int ModApiClient::l_sound_play(lua_State *L)
SimpleSoundSpec spec;
read_soundspec(L, 1, spec);
float gain = 1.0;
float pitch = 1.0;
Copy link
Member

Choose a reason for hiding this comment

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

same here

src/server.h Outdated
@@ -116,6 +116,7 @@ struct ServerSoundParams
float max_hear_distance;
bool loop;
float fade;
float pitch;
Copy link
Member

Choose a reason for hiding this comment

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

now we are using C++11 you can do "float pitch = 1.0f;" directly, maybe convert the whole constructor in that style ? :)

src/sound.h Outdated
@@ -44,6 +45,7 @@ struct SimpleSoundSpec
std::string name;
float gain;
float fade;
float pitch;
Copy link
Member

Choose a reason for hiding this comment

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

same for those params, please set default values here (you cannot remove the params affectations)

@nerzhul nerzhul added Sounds Feature ✨ PRs that add or enhance a feature labels Jun 11, 2017
@ghost
Copy link
Author

ghost commented Jun 11, 2017

Updated.

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

code looks good to me, haven't tested yet

@nerzhul
Copy link
Member

nerzhul commented Jun 11, 2017

I fixed the LINT

@nerzhul nerzhul merged commit ff73c7a into minetest:master Jun 11, 2017
@Fixer-007
Copy link
Contributor

Fixer-007 commented Jun 11, 2017

Introduced regression: can't connect to multiplayer servers now (0.4.14-16), singleplayer works:

ERROR[Main]: A serialization error occurred:
ERROR[Main]: deSerializeString: couldn't read all chars
ERROR[Main]: The server is probably  running a different version of Minetest.

@ghost
Copy link
Author

ghost commented Jun 11, 2017

#5964

@Fixer-007
Copy link
Contributor

Confirm it is fixed by 5964

osjc pushed a commit to osjc/minetest that referenced this pull request Jan 11, 2019
* Sound: Add pitch option
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
* Sound: Add pitch option
luk3yx pushed a commit to luk3yx/minetest that referenced this pull request Feb 10, 2019
* Sound: Add pitch option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ PRs that add or enhance a feature Sounds >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants