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

refactor rvoice_mixer #197

Closed
13 tasks done
derselbst opened this issue Sep 1, 2017 · 2 comments · Fixed by #1158
Closed
13 tasks done

refactor rvoice_mixer #197

derselbst opened this issue Sep 1, 2017 · 2 comments · Fixed by #1158

Comments

@derselbst
Copy link
Member

derselbst commented Sep 1, 2017

rvoice_mixer needs a bit refactoring after the workaround to fix #192. Think about:

  • remove fluid_rvoice_eventhandler_t::is_threadsafe
  • remove "synth.parallel-render"
  • remove fluid_voice_t::debug
  • refactor chrous and reverb types
    • fluid_revmodel_set takes floats.
    • fluid_revmodel_presets_t uses fluid_real_t
    • fluid_revmodel_t uses fluid_real_t
    • fluid_rvoice_mixer_set_chorus_params takes doubles
    • fluid_rvoice_mixer_set_reverb_params take doubles
    • fluid_rvoice_event_t::realparams is fluid_real_t.
    • public synth API takes doubles
    • etc.
  • each rvoice gets its own mono resampled buffer[FLUID_MIXER_MAX_BUFFERS_DEFAULT*FLUID_BUFSIZE]?
  • openMP parallelization?
  • get rid of that hug macro magic switch case in rvoice_event_handler
  • variable naming not very intuitive (buf_blocks, buf_count, current_blockcount ???)
  • loop that initializes rvoice buffer in fluid_rvoice_buffers_check_bufnum() is superfluous
  • efficiently render "silence"
  • rethink fluid_synth_check_finished_voices()
  • fluid_rvoice_set_output_rate() is called twice (by fluid_voice_set_output_rate() and fluid_rvoice_mixer_set_samplerate())
  • process effects units in parallel
@jjceresa
Copy link
Collaborator

jjceresa commented Feb 24, 2018

About the mixer.

variable naming not very intuitive (buf_blocks, buf_count, current_blockcount ???)

Some infos follow:
mixer-fluid_rvoice_mixer_t

  • buf_count: is the number of buffers .
    This number depends of the number of audio output. This number is specified by mixer->buffers.buf_count. (Probably a better naming should be related to the audio output number).

  • Internally each buffer have the same maximum size (buf_blocks). (not a good name too).

  • The size of a buffer (buf_blocks) is specified in blocks. Each block have FLUID_BUFSIZE samples

  • current_blockcount: is the current index (0 to buf_blocks) of the block been mixed.


Some images show the internals links from 'detail to top':
mixer-fluid_mixer_buffers_prepare
mixer-fluid_mixe_one

The buffs table pointers keeps the mixer independent of the real buffers structure.


mixer-fluid_rvoice_mixer_render
The caller requests blockcount block (each block is FLUID_BUFSIZE sample size ).
The function returns the real blocks number processed.

@derselbst
Copy link
Member Author

Thanks for this illustration!

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

Successfully merging a pull request may close this issue.

2 participants