Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coremidimap tool #15

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/gtk/gschemas.compiled
/tools/regtool
/web/oscmix.wasm
.DS_Store
16 changes: 8 additions & 8 deletions device_ff802.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ static const struct inputinfo inputs[] = {
{"Analog 6", INPUT_GAIN | INPUT_REFLEVEL},
{"Analog 7", INPUT_GAIN | INPUT_REFLEVEL},
{"Analog 8", INPUT_GAIN | INPUT_REFLEVEL},
{"Mic/Inst 9", INPUT_GAIN | INPUT_48V},
{"Mic/Inst 10", INPUT_GAIN | INPUT_48V},
{"Mic/Inst 11", INPUT_GAIN | INPUT_48V},
{"Mic/Inst 12", INPUT_GAIN | INPUT_48V},
{"Mic/Inst 9", INPUT_48V | INPUT_HIZ},
{"Mic/Inst 10", INPUT_48V | INPUT_HIZ},
{"Mic/Inst 11", INPUT_48V | INPUT_HIZ},
{"Mic/Inst 12", INPUT_48V | INPUT_HIZ},
{"AES L"},
{"AES R"},
{"ADAT 1"},
Expand Down Expand Up @@ -45,10 +45,10 @@ static const struct outputinfo outputs[] = {
{"Analog 6", OUTPUT_REFLEVEL},
{"Analog 7", OUTPUT_REFLEVEL},
{"Analog 8", OUTPUT_REFLEVEL},
{"Phones 9", OUTPUT_REFLEVEL},
{"Phones 10",OUTPUT_REFLEVEL},
{"Phones 11",OUTPUT_REFLEVEL},
{"Phones 12",OUTPUT_REFLEVEL},
{"Phones 9"},
{"Phones 10"},
{"Phones 11"},
{"Phones 12"},
{"AES L"},
{"AES R"},
{"ADAT 1"},
Expand Down
24 changes: 18 additions & 6 deletions sysex.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
#define SYSEX_H 1

#include <stdint.h>
#include <stddef.h> // For size_t

#ifdef __cplusplus
extern "C" {
#endif

struct sysex {
uint_least32_t mfrid;
Expand All @@ -20,13 +25,15 @@ enum {
size_t sysexenc(struct sysex *p, unsigned char *dst, int flags);
int sysexdec(struct sysex *p, const unsigned char *src, size_t len, int flags);


void base128enc(unsigned char *dst, const unsigned char *src, size_t len);
int base128dec(unsigned char *dst, const unsigned char *src, size_t len);

static inline uint_least32_t
getle32_7bit(const void *p)
{
const unsigned char *b = p;
// Cast to `const unsigned char*` for C++ compatibility (needed in tools/regtool_osx.cpp)
const unsigned char *b = reinterpret_cast<const unsigned char *>(p);
uint_least32_t v;

v = b[0] & 0x7ful;
Expand All @@ -40,14 +47,19 @@ getle32_7bit(const void *p)
static inline void *
putle32_7bit(void *p, uint_least32_t v)
{
unsigned char *b = p;
// Cast to `unsigned char*` for C++ compatibility (needed in tools/regtool_osx.cpp)
unsigned char *b = reinterpret_cast<unsigned char *>(p);

b[0] = v & 0x7f;
b[1] = v >> 7 & 0x7f;
b[2] = v >> 14 & 0x7f;
b[3] = v >> 21 & 0x7f;
b[4] = v >> 28 & 0x3f;
b[1] = (v >> 7) & 0x7f;
b[2] = (v >> 14) & 0x7f;
b[3] = (v >> 21) & 0x7f;
b[4] = (v >> 28) & 0x3f;
return b + 5;
}

#ifdef __cplusplus
}
#endif

#endif // SYSEX_H
Loading