-
Notifications
You must be signed in to change notification settings - Fork 53
Design Docs
SammyIAm edited this page Oct 29, 2017
·
12 revisions
A working draft the the design for Moppy 2.0
The general goals of Moppy 2.0 are:
- To modularize the code a bit (i.e. breaking core functionality into a separate library)
- Improve user experience (i.e. better GUI, easier setup)
- Support more musical devices (e.g. stepper motors, relays, HDDs) on more platforms (e.g. Raspberry Pi, Python)
To that end, the plan is to create slightly more robust message protocol that offloads a tiny bit more logic onto the device-side of things, to free up the controller library to be a little more generic. The GUI will be rewritten separate from the core logic code, and also allow remote configuration of the receiving devices. And generally the project is going to be restructured a little to allow contributions for other platforms and instruments.
Byte | Required? | Example | Contents |
---|---|---|---|
Start of Message | Yes | 01001101 |
Always contains 01001101 and marks the start of a Moppy message |
Device Address | Yes |
00000001 (Device id 1) 00000000 (System message) |
First half of device address. 00000000 indicates a system-wide message. |
Sub-address | Yes (unless system message) |
00000011 (Sub-address 3) |
Second half of device address. Only present if the previous byte isn't 00000000 indicating a system message. |
Length | Yes |
00000010 (Two byte body) |
Indicates the number of bytes following this byte that make up the message body. For example, a command with two payload bytes would have a length of 3. |
Command | Yes | 00001010 |
The command for this message (see table below) |
Payload | No | 01101011 00100010 ... |
Zero or more bytes containing relevant payload information for the given command. |
Command | Command Byte | Payload Bytes | Description |
---|---|---|---|
Ping | 0x80 |
None | Requests a pong message from any Moppy devices on the network |
Pong | 0x81 |
[DeviceAddress] [NumberOfSubAddresses]
|
A pong message returned by devices when requested by the controller. The first payload byte indicates the device address, the second indicates the number of sub-addresses available on this device. Note: It is allowed for multiple devices to have the same address, possibly with a different number of sub-addresses |
Reset | 0x82 |
None | Instructs all devices to halt, and return to start / ready state |
Sequence Start | 0x83 |
None | Informs all devices that a sequence has started (should precede note messages) |
Sequence Stop | 0x84 |
None | Informs all devices that the sequence has stopped. Devices should halt, but not necessarily reset to their start / ready state |