katyo / aubio-rs

Rust bindings for Aubio library
36 stars 6 forks source link

Add a Tempo add_with_method function #3

Closed Polochon-street closed 4 years ago

Polochon-street commented 4 years ago

There's currently no helper to create a Tempo with a specific onset mode, so added it.

Also, ran RustFmt on the file apparently, hope it's okay?

katyo commented 4 years ago

I think we should add onset mode parameter to new() itself. Possibly I forgot to fix this.

katyo commented 4 years ago

It seems I was confused by comment here: https://github.com/aubio/aubio/blob/master/src/tempo/tempo.h#L45

I don't understand what "unused for now" really means, because it seems to be actually used: https://github.com/aubio/aubio/blob/master/src/tempo/tempo.c#L204-L210

It's problematic simply use OnsetMode type for this parameter because the default value for tempo is SpecFlux, but OnsetMode default is Hfc.

Polochon-street commented 4 years ago

I see you fixed it then, nice! Closing this one. Thanks a lot :)