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 tempomult option to control playing speed #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yotam-medini
Copy link
Contributor

This --tempomult option is very useful for practicing music.
Especially for choir singers.

@psi29a
Copy link
Member

psi29a commented Sep 13, 2024

Can you explain how this would be used? Can you provide an example? :)

(aside from, speed it up :P )

@sezero
Copy link
Contributor

sezero commented Sep 13, 2024

BTW, This is an API + ABI change: Do we really want this?

@yotam-medini
Copy link
Contributor Author

yotam-medini commented Sep 13, 2024

Say for example we download
https://www.cpdl.org/wiki/images/7/74/Ws-bwv-mp76.mid
and play the ~15 seconds segment 0:40-0:55 via
wildmidi -i 40 -j 55 Ws-bwv-mp76.mid
We can play it slower - for easy practicing - via (will take ~18 seonds)
wildmidi -i 40 -j 55 -T 0.8 Ws-bwv-mp76.mid
or faster - as the choir conductor's taste - via (will take ~8 seconds)
wildmidi -i 40 -j 55 -T 1.8 Ws-bwv-mp76.mid

I chose the '-T' option character as timidity has similar option:
-T n, --adjust-tempo=n
Adjust tempo to n%; 120 play MOD files with an NTSC Amiga's timing.

@yotam-medini
Copy link
Contributor Author

yotam-medini commented Sep 14, 2024

About the API change.
An alternative would be to introduce global :(static): variable(s)
and add API functions to get/set them.

Also for both API-change or API-additions
it may be better instead of the 'float tempo_mult' value
to have something like

  struct _parse_cfg {
    float tempo_mult;
    // possible more future parameters
  };

with

  void init_parse_cfg(struct _parse_cfg *p) {
    p->tempo_mult = 1.0f;
    // possible more default future settings
  }

and in wildmidi.c have

  static _parse_cfg parse_cfg;
  ...
  int main(int argc, char **argv) {
    ...
    init_parse_cfg(&parse_cfg);
    ...
  }

and pass &parse_cfg instead of tempo_mult.
This will allow for future enhancements without API change.

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.

3 participants