Conversation
f590d34 to
31f2fbc
Compare
31f2fbc to
3c3815b
Compare
saintmatthieu
left a comment
There was a problem hiding this comment.
Looks simple: if someone has a gamepad plugged, we take control of it and the user can start interacting.
Eventually, we'll want to show some indication that the gamepad is connected and available, but until then just LOGI() would be enough for us to get started.
About the interaction: ideally we need four easily accessible buttons, two for each hand, to be able to play legato or staccato, and two other controls for left-hand and right-hand velocities, if possible without interfering with the fingers that trigger the notes (except if the note-triggering buttons themselves can convey velocity). Maybe there's something to explore with the accelerometers.
It'd be great if it could be tuned to something pleasant to use and without expressiveness restriction wrt a MIDI keyboard, it could really make a difference in widening the audience. All these improvements can be done peu à peu. If it turns out good, then we should support multiple pads, to allow two persons (e.g. parent and kid, teacher and pupil) to play together.
| public muse::async::Asyncable | ||
| { | ||
| muse::Inject<IOrchestrion> orchestrion = {this}; | ||
| muse::Inject<IGamepad> gamepad = {this}; |
There was a problem hiding this comment.
I expect the gamepad to be owned exclusively be GamepadMidiController? Then I would just let it be a member, no need for it to be injected.
There was a problem hiding this comment.
Actually, thought about it again: I don't think there is a need for the IGamepadMidiController API, just having the module instantiate and own GamepadMidiController would be enough.
| private: | ||
| void doConnect() { | ||
| if (SDL_Init(SDL_INIT_GAMECONTROLLER) < 0) { | ||
| std::cerr << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl; |
There was a problem hiding this comment.
This call succeeds even if there is not game controller connected? If not, then I'd log just at info leve.
BTW, you can use the framework's log.h
| } | ||
| } | ||
|
|
||
| SDL_AddEventWatch([](void* userdata, SDL_Event* event) -> int { |
There was a problem hiding this comment.
Should probably check that m_controller != nullptr before adding the watcher?
|
Of course, CI must be fixed before merging. |
1cb98ff to
c869682
Compare
A simple note input with a gamepad, left-side buttons are mapped to note 0, and right-side buttons are mapped to note 60. Velocity is controlled with the left stick.