MobMidi.KeyboardScreen (mob_midi v0.1.0)

Copy Markdown View Source

MIDI out demo: a two-octave keyboard. Tap a key to send a note to the selected output device.

Orientation (stubbed)

This is meant to be a wide landscape keyboard. Until Mob.Device.lock_orientation/1 lands in mob core (PR GenericJam/mob#49), it renders portrait: white keys only, two rows of seven so they fit a portrait width. Once the orientation lock is available, mount/3 should call Mob.Device.lock_orientation(:landscape) and the layout swap to a single full piano (white + black keys). See the # TODO(orientation) markers.

The render tree is built as plain node maps (the idiom mob screens use for dynamic / list-driven UI).

Summary

Functions

dump_state(assigns)

Callback implementation for Mob.Screen.dump_state/1.

handle_event(event, params, socket)

Callback implementation for Mob.Screen.handle_event/3.

handle_info(arg1, socket)

@spec handle_info(term(), term()) :: {:noreply, term()}

Callback implementation for Mob.Screen.handle_info/2.

load_state(vsn, stored)

Callback implementation for Mob.Screen.load_state/2.

mount(params, session, socket)

@spec mount(term(), term(), term()) :: {:ok, term()}

Callback implementation for Mob.Screen.mount/3.

render(assigns)

@spec render(map()) :: map()

Callback implementation for Mob.Screen.render/1.

terminate(reason, socket)

@spec terminate(term(), term()) :: :ok

Callback implementation for Mob.Screen.terminate/2.