gRPC Control

mtrack provides a gRPC interface for remote control, allowing you to control the player from any device on your network.

Configuration

Enable the gRPC server in your mtrack.yaml:

1
2
3
controllers:
  - kind: grpc
    port: 43234  # Optional, defaults to 43234

Command-Line Interface

The mtrack command provides subcommands for gRPC interaction:

Play

Start playback of the current song:

1
mtrack play

Start from a specific time:

1
mtrack play --from "1:23.456"  # 1 minute, 23.456 seconds

Navigate the playlist:

1
2
mtrack previous
mtrack next

Stop

Stop the currently playing song:

1
mtrack stop

Playlist Management

Switch between playlists:

1
2
mtrack switch-to-playlist all_songs
mtrack switch-to-playlist playlist

Status

Get current player status:

1
mtrack status

Active Effects

View all active lighting effects:

1
mtrack active-effects

Cues

List all cues in the current song’s lighting timeline:

1
mtrack cues

gRPC Service Definition

The gRPC service definition can be found in the mtrack repository. The service provides methods for:

  • Playback control (play, stop, pause)
  • Playlist navigation (next, previous)
  • Status queries (current song, elapsed time, etc.)
  • Playlist management (switch playlists)
  • Lighting control (active effects, cues)

Use Cases

Remote Control

Control mtrack from a phone, tablet, or laptop on the same network:

1
2
3
4
# From another device on the network
mtrack play
mtrack next
mtrack status

Backup Control

If your MIDI foot controller fails during a gig, you can still control mtrack via gRPC from any device with network access.

Automation

Integrate mtrack control into other systems or scripts using gRPC clients in various languages.

Security Note

Important: There is currently no security/authentication on the gRPC server.

  • Do not run mtrack on a public network
  • Consider disabling the gRPC server if your network is wide open
  • Use firewall rules to restrict access if needed