Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
fiddle with replayer headers a bit in preparation for exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
cpdt committed Aug 12, 2018
1 parent e37f3e6 commit f762f37
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 37 deletions.
49 changes: 12 additions & 37 deletions replayer/Axiom.h
@@ -1,49 +1,24 @@
#ifndef AXIOM_H
#define AXIOM_H
#ifndef AXIOM_INSTRUMENT_H
#define AXIOM_INSTRUMENT_H

#include <stdint.h>
#include <stdbool.h>
#include "AxiomCommon.h"

typedef void AxiomDefinition;
typedef void AxiomInstrument;
typedef void AxiomInput;
typedef void AxiomOutput;
#define AXIOM_SAMPLERATE 44100
#define AXIOM_BPM 60

typedef struct {
bool active;
float left;
float right;
uint8_t form;
} AxiomNum;

typedef enum : uint8_t {
AXIOM_EVENT_NOTE_ON,
AXIOM_EVENT_NOTE_OFF,
AXIOM_EVENT_POLYPHONIC_AFTERTOUCH,
AXIOM_EVENT_CHANNEL_AFTERTOUCH,
AXIOM_EVENT_PITCH_WHEEL
} AxiomMidiEventType;

typedef struct {
AxiomMidiEventType type;
uint8_t channel;
uint8_t note;
uint8_t param;
} AxiomMidiEvent;
#define AXIOM_INPUT_PORTAL 0
#define AXIOM_OUTPUT_PORTAL 1

#ifdef __cplusplus
extern "C" {
#endif
AxiomInstrument* __cdecl axiom_create_instrument(AxiomDefinition *definition);
AxiomInput* __cdecl axiom_get_input(AxiomInstrument *instrument, uint32_t id);
AxiomInput* __cdecl axiom_get_output(AxiomInstrument *instrument, uint32_t id);
void __cdecl axiom_init();
void __cdecl axiom_packup();
void __cdecl axiom_generate();
void __cdecl axiom_destroy_instrument(AxiomInstrument *instrument);

void __cdecl axiom_midi_push(AxiomInput *input, AxiomMidiEvent event);
void __cdecl axiom_midi_clear(AxiomInput *input);
void __cdecl axiom_num_write(AxiomInput *input, AxiomNum value);
AxiomNum __cdecl axiom_num_read(AxiomOutput *output);
void *__cdecl axiom_get_portal(uint32_t id);

void __cdecl axiom_midi_push(AxiomMidi *midi, AxiomMidiEvent event);
#ifdef __cplusplus
}
#endif
Expand Down
33 changes: 33 additions & 0 deletions replayer/AxiomCommon.h
@@ -0,0 +1,33 @@
#ifndef AXIOM_COMMON_H
#define AXIOM_COMMON_H

#include <stdbool.h>
#include <stdint.h>

typedef struct {
float left;
float right;
uint8_t form;
} AxiomNum;

typedef enum : uint8_t {
AXIOM_EVENT_NOTE_ON,
AXIOM_EVENT_NOTE_OFF,
AXIOM_EVENT_POLYPHONIC_AFTERTOUCH,
AXIOM_EVENT_CHANNEL_AFTERTOUCH,
AXIOM_EVENT_PITCH_WHEEL
} AxiomMidiEventType;

typedef struct {
AxiomMidiEventType type;
uint8_t channel;
uint8_t note;
uint8_t param;
} AxiomMidiEvent;

typedef struct {
uint8_t event_count;
AxiomMidiEvent events[16];
} AxiomMidi;

#endif

0 comments on commit f762f37

Please sign in to comment.