Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hideakitai/maxmtrparser
Max/MSP MTR (Multi-Track Recorder) Protocol Parser for Arduino
https://github.com/hideakitai/maxmtrparser
Last synced: 2 days ago
JSON representation
Max/MSP MTR (Multi-Track Recorder) Protocol Parser for Arduino
- Host: GitHub
- URL: https://github.com/hideakitai/maxmtrparser
- Owner: hideakitai
- License: mit
- Created: 2022-03-22T08:50:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T08:25:07.000Z (9 months ago)
- Last Synced: 2024-03-16T10:35:04.686Z (8 months ago)
- Language: C++
- Size: 41 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MaxMtrParser
Max/MSP MTR (Multi-Track Recorder) Protocol Parser for Arduino
## Usage
See `parser` example for the details.
```C++
// include file system library before MTR Parser
#include
#define fs SD// #define MAXMTRPARSER_DEBUGLOG_ENABLE
#includeFile file;
String path = "/single.txt";
MaxMtrParser mtr;
uint32_t start_ms = 0;void setup() {
Serial.begin(115200);
delay(2000);fs.begin();
file = fs.open(path, FILE_READ);mtr.attach(file);
start_ms = millis();
}void loop() {
if (mtr.hasNextLine()) {
if (millis() >= start_ms + mtr.nextTimeMs()) {
for (size_t i = 0; i < mtr.numArgs(); ++i) {
Serial.print(mtr.argAsString(i));
Serial.print(", ");
}
Serial.println();mtr.pop();
}
}
}
```## Options
### Enable Debug Logger
```C++
// define this preprocessor
#define MAXMTRPARSER_DEBUGLOG_ENABLE// then include library
#include
```### Change the size limit of Track / Arguments
```C++
// define this preprocessor (default: 16)
#define MAXMTRPARSER_MAX_ARGS 16
#define MAXMTRPARSER_MAX_TRACKS 16// then include library
#include
```## Dependent Libraries
- [ArxContainer](https://github.com/hideakitai/ArxContainer)
- [DebugLog](https://github.com/hideakitai/DebugLog)## APIs
```C++
bool attach(File& f, const size_t track_idx = 0);
bool hasNextLine();
uint32_t nextTimeMs() const;
bool seek(const size_t track, const uint32_t time_ms);
bool seek(const uint32_t time_ms);size_t numTracks() const;
uint8_t numArgs() const;const String& argAsString(const uint8_t i) const;
int32_t argAsInt(const uint8_t i) const;
float argAsFloat(const uint8_t i) const;
double argAsDouble(const uint8_t i) const;
void pop();
```## License
MIT