flutter_midi icon indicating copy to clipboard operation
flutter_midi copied to clipboard

Velocity parameter

Open MrHazee opened this issue 4 years ago • 10 comments

Hi, First, great library! Is there any way of adding velocity (or volume) to the notes played?

thanks

MrHazee avatar Apr 19 '21 14:04 MrHazee

Still slowly working on a new version in rust that would give me more control on all the platforms. Currently there is a 2 different synths on iOS and android

rodydavis avatar Apr 19 '21 17:04 rodydavis

Thanks for letting me know!

MrHazee avatar Apr 20 '21 10:04 MrHazee

Hey, I'm using the flutter_midi (very nice library!) in a personal project and I expanded the "playMidiNote" method to accept a velocity parameter for iOS and Android. You said you're working on a new version in rust, but would you maybe be interested in a pull request for until then? The main call changes as follows:

 Future<String?> playMidiNote({required int midi,int velocity=127}) async {
    return _channel.invokeMethod('play_midi_note', {'note': midi,'velocity':velocity});
  } 

The velocity parameter is then processed by each platform (iOS and Android) accordingly, with actually very few changes.

Thiagohgl avatar Aug 29 '21 10:08 Thiagohgl

@MrHazee I have created a branch with velocity support. Could you give it a try and tell me if it works well for you?

https://github.com/kNoAPP/flutter_midi/tree/velocity

kNoAPP avatar Nov 10 '21 19:11 kNoAPP

Thanks! Sure, will try it out as soon as possible

ons 10 nov. 2021 kl. 20:23 skrev Alden Bansemer @.***>:

@MrHazee https://github.com/MrHazee I have created a branch with velocity support. Could you give it a try and tell me if it works well for you?

https://github.com/kNoAPP/flutter_midi/tree/velocity

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/rodydavis/flutter_midi/issues/30#issuecomment-965666111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7PK7WLKCKQDNP2CNRFVF3ULLBDLANCNFSM43F4XQMQ .

MrHazee avatar Nov 11 '21 07:11 MrHazee

That's amazing! Thank you 🙏🏼

rodydavis avatar Nov 11 '21 17:11 rodydavis

Could you make a PR?

rodydavis avatar Nov 11 '21 17:11 rodydavis

@rodydavis The velocity branch is branched from the Android Embedded PR I created. I'm using this library for another project, so I needed both the new embedded system and velocity in a branch right away.

I don't want to PR velocity just yet because it would house commits from an unrelated issue. Once #36 is tested and makes it in, I'll go back and do a separate PR for this velocity stuff.

kNoAPP avatar Nov 11 '21 18:11 kNoAPP

Hello! So the PR #36 has been merged. Now, it would be great to create a new PR in order to introduce https://github.com/kNoAPP/flutter_midi/commit/b46db8ea5a950063c7baf6fb7e12ebe4c9e7cc09 into this tree. @kNoAPP any plans about this? @rodydavis while you are working on your new Rust version, I think this library could still be useful as is. Perhaps it could continue to evolve on its own? What are the plans for it, now?

Thank you!

aalex avatar Aug 06 '23 17:08 aalex

Hello! So the PR #36 has been merged. Now, it would be great to create a new PR in order to introduce kNoAPP@b46db8e into this tree. @kNoAPP any plans about this? @rodydavis while you are working on your new Rust version, I think this library could still be useful as is. Perhaps it could continue to evolve on its own? What are the plans for it, now?

Thank you!

https://github.com/rodydavis/flutter_midi/pull/37

kNoAPP avatar Aug 06 '23 18:08 kNoAPP