MBXRemote | MusicBee Remote Desktop Client | HALRAD Research

Technical Appendix & Errata

This appendix provides detailed technical documentation for developers and power users interested in the inner workings of MBXRemote and the ARiA protocol.

ARiA Protocol Architecture

The ARiA (Arbitrary Remote Initiated Actions) system is a command-agnostic transport protocol. The protocol itself doesn't interpret commands - it simply transports action scripts from client to server for execution.

[MBXRemote Client] โ”€โ”€TCP/JSONโ”€โ”€> [MusicBee Plugin] โ”€โ”€Executeโ”€โ”€> [Windows/MusicBee]
        |                              |                           |
   Action Script                 Command-Agnostic            SendKeys/Commands
   "sndKeys(CTRL ALT Q)"            Transport                  Execution

Protocol Message Format

{
  "context": "playerinitiatoraction",
  "data": "sndKeys(CTRL ALT Q)"
}\r\n

The data field contains an action script string passed unchanged to the plugin's execution engine. The protocol layer never parses or validates this content.

SendKeys Notation Reference

ARiA uses .NET System.Windows.Forms.SendKeys notation for keyboard automation.

Modifier Keys

Modifier SendKeys Symbol ARiA Notation
Control^CTRL or CONTROL
Alt%ALT
Shift+SHIFT
Windows# (unofficial)WIN or WINDOWS

Special Keys

Key Syntax
Enter{ENTER} or ~
Tab{TAB}
Escape{ESC}
Backspace{BACKSPACE} or {BS}
Delete{DELETE} or {DEL}
Arrow Keys{UP} {DOWN} {LEFT} {RIGHT}
Page Up/Down{PGUP} {PGDN}
Home/End{HOME} {END}
Function Keys{F1} through {F24}
Space{SPACE} or literal space
Insert{INSERT}
Print Screen{PRTSC}
Caps Lock{CAPSLOCK}
Num Lock{NUMLOCK}
Scroll Lock{SCROLLLOCK}
Break{BREAK}
Application/Menu{APPS}

Key Repeat Syntax

{TAB 3}      // Tab 3 times
{RIGHT 5}    // Right arrow 5 times
+{RIGHT 5}   // Shift+Right 5 times (select 5 characters)

DuckyScript Notation

As an alternative to SendKeys symbols, ARiA also accepts DuckyScript-style notation for key combinations - a more readable, space-separated format.

DuckyScript vs SendKeys

Action SendKeys Notation DuckyScript Notation
Ctrl+Alt+QsndKeys(^%q)sndKeys(CTRL ALT Q)
Ctrl+Shift+DeletesndKeys(^+{DELETE})sndKeys(CTRL SHIFT DELETE)
Alt+F4sndKeys(%{F4})sndKeys(ALT F4)
Ctrl+AsndKeys(^a)sndKeys(CTRL A)
Windows+RsndKeys(#{r})sndKeys(GUI R) or sndKeys(WIN R)

DuckyScript Modifiers

Modifier DuckyScript SendKeys Equivalent
ControlCTRL or CONTROL^
AltALT%
ShiftSHIFT+
WindowsGUI or WIN or WINDOWS#

DuckyScript Examples

sndKeys(CTRL ALT A)           // MusicBee Goto Tab 1
sndKeys(CTRL ALT S)           // MusicBee Goto Tab 2
sndKeys(CTRL ALT L)           // MusicBee Goto Tab 9
sndKeys(CTRL SHIFT DELETE)    // Ctrl+Shift+Delete
sndKeys(ALT F4)               // Close window
sndKeys(GUI R)                // Windows Run dialog
sndKeys(CTRL A);delay(100);sndKeys(CTRL C)  // Select all, copy

Both notations can be used interchangeably. Use whichever is more readable for your use case.

Complete Key Mapping Reference

Key/Action SendKeys DuckyScript
Ctrl+A^aCTRL A
Alt+F4%{F4}ALT F4
Shift+Tab+{TAB}SHIFT TAB
Ctrl+Alt+A^%aCTRL ALT A
Ctrl+Shift+Esc^+{ESC}CTRL SHIFT ESCAPE
Win+D#{d}GUI D or WIN D
Win+R#{r}GUI R or WIN R
Enter{ENTER} or ~ENTER
Tab{TAB}TAB
Escape{ESC}ESCAPE or ESC
Space{SPACE}SPACE
Backspace{BACKSPACE}BACKSPACE
Delete{DELETE}DELETE
Up Arrow{UP}UP
Down Arrow{DOWN}DOWN
Left Arrow{LEFT}LEFT
Right Arrow{RIGHT}RIGHT
F1-F12{F1} - {F12}F1 - F12
Home{HOME}HOME
End{END}END
Page Up{PGUP}PAGEUP
Page Down{PGDN}PAGEDOWN
Insert{INSERT}INSERT
Print Screen{PRTSC}PRINTSCREEN

Focus Control Prefixes

Control whether MusicBee receives focus before sending keys:

Prefix Behavior Use Case
(none)Focus MusicBee first (default)Tab navigation, MusicBee commands
!mb!Explicitly focus MusicBeeSame as default, explicit
!nofocus!Send to current focused windowAlt+Tab, system commands

Examples

sndKeys(CTRL ALT Q)           // Focus MusicBee, send Ctrl+Alt+Q (RIA1)
sndKeys(!mb!CTRL S)           // Explicitly focus MusicBee, save
sndKeys(!nofocus!ALT TAB)     // Alt+Tab without changing focus
sndKeys(!nofocus!WIN D)       // Show desktop (current window)

Windows Key Limitation

Known Limitation: The official .NET SendKeys class does NOT have native support for the Windows key. The # symbol is unofficially supported in some implementations but is not part of the standard.

For Windows key combinations, the plugin uses Windows API (P/Invoke) when WIN or # is detected:

MusicBee API Status

Working APIs

Category Status Examples
Player ControlWorkingPlay, Pause, Stop, Next, Previous, Volume, Mute
Now PlayingWorkingTrack info, metadata, artwork, lyrics
Now Playing ListWorkingQueue management, reorder, clear
LibraryWorkingBrowse, search, tag reading/writing
PlaylistsWorkingCreate, delete, modify playlists
SettingsWorkingStorage paths, skin info

Non-Working APIs

Navigation API

MB_InvokeCommand(Command.NavigateTo) does not work for tab switching. This is why ARiA uses SendKeys as a workaround.

Visualizer API EXPERIMENTAL

playervisualizer and playervisualizerlist commands are implemented but non-functional. MusicBee's API returns empty data and MB_ShowVisualiser always returns false. This feature is experimental and may not work.

ARiA Security Model

Enable/Disable Control

ARiA is controlled via a checkbox in the MusicBee Remote plugin settings:

What Works When ARiA is Disabled

Security Considerations

Warning: When enabled, ARiA can send ANY keystroke to the Windows machine running MusicBee. This includes:

Mitigations:

Protocol Version History

Version Features Plugin Version
v4.0Standard playback, library, playlists, now playingStandard plugin v1.4.1
v4.5ARiA, Initiator Actions, tab navigation, focus control, enhanced metadatav1.5.10.26

Deprecated Features

NavigationSettings.xml (Deprecated)

The playernavigateto command and NavigationSettings.xml file are deprecated. The older approach required:

  1. Client sends tab number via playernavigateto
  2. Plugin looks up hotkey mapping in NavigationSettings.xml
  3. Plugin sends mapped keys

This has been replaced by playerinitiatoraction where the client sends complete action scripts directly.

Troubleshooting Reference

Keys Not Working

Wrong Window Receives Keys

Debug Logging

Plugin logs are stored at:

%APPDATA%\MusicBee\mb_remote\

Key log entries to check:

"Executing action script: [script]"
"Sending keys: [keys]"
"Focused MusicBee window"
"ARiA functionality is disabled"

Design Philosophy

The "Sandworm" Protocol

The ARiA protocol acts as a transport tunnel that carries action scripts without understanding or interpreting them. Like the sandworms of Arrakis that transport spice harvesters without knowledge of their cargo, the protocol simply moves action scripts from client to server.

This separation allows:

Why SendKeys Instead of API?

MusicBee's MB_InvokeCommand(Command.NavigateTo) didn't work for tab switching. The Command enum only has one value (NavigateTo = 1) with no documentation on parameters. Testing showed no consistent behavior.

SendKeys provides a universal solution that: