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

Add reverb and chorus settings #385

Merged
merged 10 commits into from
May 18, 2018
Merged

Add reverb and chorus settings #385

merged 10 commits into from
May 18, 2018

Conversation

derselbst
Copy link
Member

This introduces reverb and chorus realtime settings as suggested by #49. It also deprecates reverb and chorus shell commands and removes the FLUID_*_DEFAULT_* macros from the public API, as they can now be retrieved via the settings object.

Closes #49.

@derselbst derselbst added this to the 2.0 milestone May 15, 2018
@derselbst derselbst self-assigned this May 15, 2018
Copy link
Member

@mawe42 mawe42 left a comment

Choose a reason for hiding this comment

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

Looks good! Some very small comments below.

TEST_ASSERT(settings != NULL);

TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.roomsize", 1.0));
TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.damp", 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.

If you would use different values for the parameters, the tests could actually check that the correct value is returned/set for a named parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

the tests could actually check that the correct value is returned/set for a named parameter.

This is done below by asking the synth to return these values (which he must have read from the settings object to be correct). For the correct saving of the settings, relying on the return value of the settings API is sufficient here.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I mean by settings damp to 1.0, roomsize to 0.9, etc we could test that fluid_synth_get_reverb_damp does actually return the value set by synth.reverb.damp, and not the one set via synth.reverb.roomsize.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh ok. Yeah makes sense. Will do that + test the realtime settings functionality to update properly as well.


TEST_ASSERT(fluid_synth_get_chorus_nr(synth) == 99);
TEST_ASSERT(fluid_synth_get_chorus_level(synth) == 1.0);
TEST_ASSERT(fluid_synth_get_chorus_speed_Hz(synth) == 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.

I just noticed that there is this capital "H" in fluid_synth_get_chorus_speed_Hz. Maybe we should clean that up as well before the 2.0 release?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. This function is already in use for 1.1.x for long. I dont like it as well, if you'd asked me I would simply call it *_speed(). However one might consider this as an unnecessary API change, motivated by personal taste.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's more than personal taste... it's about consistency in the API. All assuming this is the only function that uses a capital letter in the API. If it is, then I would consider this a bug. But then again, how much you value consistency is definitely personal taste... :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, consistency is a good argument. Shall we call it fluid_synth_get_chorus_speed() then?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, sounds good. Especially as the setter is called fluid_synth_set_chorus_speed. Which leads to another possible cleanup, I guess: we currently have fluid_synth_set_chrous_depth and fluid_synth_get_chrous_depth_ms.

@@ -3367,6 +3428,53 @@ fluid_synth_render_blocks(fluid_synth_t* synth, int blockcount)
return blockcount;
}

/*
* Handler for synth.reverb.* settings.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also mention synth.chorus.* settings and explain the _num (floating point) and _int (int) distinction?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@derselbst
Copy link
Member Author

synth.reverb.roomsize or synth.reverb.room-size?

@mawe42
Copy link
Member

mawe42 commented May 17, 2018

synth.reverb.roomsize or synth.reverb.room-size?

room-size would be more consistent with the other settings, I think. We already have things like media-role, period-size, sample-format, cpu-cores, min-note-length.

@derselbst
Copy link
Member Author

Ok, should be good now.

@mawe42
Copy link
Member

mawe42 commented May 17, 2018

Yes, looks good! Just wondering if we should have a deprecation path for the renamed API functions?

@derselbst
Copy link
Member Author

Dont think that's necessary, it's mentioned in the overall 2.0 changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants