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 ExecutionProtocol Message Format
{
"context": "playerinitiatoraction",
"data": "sndKeys(CTRL ALT Q)"
}\r\nThe 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+Q | sndKeys(^%q) | sndKeys(CTRL ALT Q) |
| Ctrl+Shift+Delete | sndKeys(^+{DELETE}) | sndKeys(CTRL SHIFT DELETE) |
| Alt+F4 | sndKeys(%{F4}) | sndKeys(ALT F4) |
| Ctrl+A | sndKeys(^a) | sndKeys(CTRL A) |
| Windows+R | sndKeys(#{r}) | sndKeys(GUI R) or sndKeys(WIN R) |
DuckyScript Modifiers
| Modifier | DuckyScript | SendKeys Equivalent |
|---|---|---|
| Control | CTRL or CONTROL | ^ |
| Alt | ALT | % |
| Shift | SHIFT | + |
| Windows | GUI 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 | ^a | CTRL A |
| Alt+F4 | %{F4} | ALT F4 |
| Shift+Tab | +{TAB} | SHIFT TAB |
| Ctrl+Alt+A | ^%a | CTRL 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 MusicBee | Same as default, explicit |
!nofocus! | Send to current focused window | Alt+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
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:
WIN Dor#d- Show DesktopWIN Lor#l- Lock ComputerWIN Ror#r- Run DialogWIN TABor#{TAB}- Task View
MusicBee API Status
Working APIs
| Category | Status | Examples |
|---|---|---|
| Player Control | Working | Play, Pause, Stop, Next, Previous, Volume, Mute |
| Now Playing | Working | Track info, metadata, artwork, lyrics |
| Now Playing List | Working | Queue management, reorder, clear |
| Library | Working | Browse, search, tag reading/writing |
| Playlists | Working | Create, delete, modify playlists |
| Settings | Working | Storage 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:
- Location: MusicBee โ Edit โ Preferences โ Plugins โ MusicBee Remote โ Configure
- Setting: "Enable ARiA (Arbitrary Remote Initiated Actions)"
- Default: Disabled (for security)
- Storage:
%APPDATA%\MusicBee\mb_remote\settings.xml
What Works When ARiA is Disabled
- Standard music controls (play, pause, next, previous)
- Volume control
- Library browsing
- Playlist management
- Now playing information
- All non-keyboard-automation features
Security Considerations
- System commands (Alt+F4, Ctrl+Alt+Del)
- Application control in any focused window
- Text input to any focused field
- Run dialog commands (Win+R)
Mitigations:
- ARiA disabled by default - explicit opt-in required
- Use firewall to restrict plugin access to local network only
- Never expose plugin port to internet
- Default focus behavior targets MusicBee (safer)
!nofocus!prefix required for system-wide control
Protocol Version History
| Version | Features | Plugin Version |
|---|---|---|
| v4.0 | Standard playback, library, playlists, now playing | Standard plugin v1.4.1 |
| v4.5 | ARiA, Initiator Actions, tab navigation, focus control, enhanced metadata | v1.5.10.26 |
Deprecated Features
NavigationSettings.xml (Deprecated)
The playernavigateto command and NavigationSettings.xml file are deprecated. The older approach required:
- Client sends tab number via
playernavigateto - Plugin looks up hotkey mapping in NavigationSettings.xml
- Plugin sends mapped keys
This has been replaced by playerinitiatoraction where the client sends complete action scripts directly.
Troubleshooting Reference
Keys Not Working
- Verify MusicBee hotkeys are configured (Ctrl+Alt+Q through P for RIA1-10)
- Check plugin logs show "Sending keys:" messages
- Ensure no security software blocks SendKeys
- Verify ARiA is enabled in plugin settings
Wrong Window Receives Keys
- Use
!mb!prefix to ensure MusicBee focus - Check which window has focus before sending
- Add delays between focus change and key send
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:
- Client Freedom: Clients can send any action script syntax
- Plugin Control: Plugin decides how to execute received scripts
- Future Extension: New command types without protocol changes
- Clean Architecture: Clear separation between transport and execution
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:
- Works with MusicBee's existing hotkey system
- Allows user customization of both client and MusicBee hotkeys
- Can automate any keyboard-driven task
- Evolved from specific (tab navigation) to general-purpose automation