55#define ALG_EPS 0.000001
56#define ALG_DEFAULT_BPM 100.0
59bool within(
double d1,
double d2,
double epsilon);
69#define alg_attr_name(a) ((a) + 1)
70#define alg_attr_type(a) (*(a))
88 for (
int i = 0; i <
len; i++) {
108#define DLLEXPORT __declspec(dllexport)
187#define ALG_PRESSURE 5
189#define ALG_TIMESIG_NUM 7
190#define ALG_TIMESIG_DEN 8
273 const char *
get_string_value(
const char *attr,
const char *value =
nullptr);
285 const char *
get_atom_value(
const char *attr,
const char *value =
nullptr);
323 bool overlap(
double t,
double len,
bool all);
345 void show()
override;
357 void show()
override;
382 assert(i >= 0 && i <
len);
504 assert(i >= 0 && i <
len);
552 bool set_tempo(
double tempo,
double start_beat,
double end_beat);
554 void cut(
double start,
double len,
bool units_are_seconds);
555 void trim(
double start,
double end,
bool units_are_seconds);
603 while (
reinterpret_cast<uintptr_t
>(
ptr) & 7) {
ptr++; }
609 buffer =
static_cast<char *
>(buf);
610 ptr =
static_cast<char *
>(buf);
616 const int32_t i = *(
reinterpret_cast<int32_t *
>(
ptr));
617 ptr +=
sizeof(int32_t);
621 const float f = *(
reinterpret_cast<float *
>(
ptr));
622 ptr +=
sizeof(float);
626 const double d = *(
reinterpret_cast<double *
>(
ptr));
627 ptr +=
sizeof(double);
632 [[maybe_unused]]
char *fence =
buffer +
len;
634 while (*
ptr++) { assert(
ptr < fence); }
655 assert(offset <=
static_cast<long>(
get_posn() -
sizeof(int32_t)));
656 *
reinterpret_cast<int32_t *
>(
buffer + offset) = value;
658 [[deprecated(
"Use store_int32() instead")]]
662 [[maybe_unused]]
char *fence =
buffer +
len;
666 while ((*
ptr++ = *s++)) { assert(
ptr < fence); }
667 assert(
reinterpret_cast<char *
>(
reinterpret_cast<uintptr_t
>(
ptr + 7) & ~7) <= fence);
671 *(
reinterpret_cast<long *
>(
ptr)) = v;
672 ptr +=
sizeof(int32_t);
675 *(
reinterpret_cast<double *
>(
ptr)) = v;
676 ptr +=
sizeof(double);
679 *(
reinterpret_cast<float *
>(
ptr)) = v;
680 ptr +=
sizeof(float);
684 while (
reinterpret_cast<uintptr_t
>(
ptr) & 7) {
set_char(0); }
688 char *newbuf =
new char[*
len];
714 assert(i >= 0 && i <
len);
739 virtual void serialize(
void **buffer,
long *bytes);
774 float pitch,
float loudness,
double duration);
844 virtual void clear(
double t,
double len,
bool all);
850 virtual void silence(
double t,
double len,
bool all);
870 long channel_mask,
long event_type_mask);
896 double *
num,
double *
den);
924 assert(i >= 0 && i <
len);
933 void insert(
double beat,
double num,
double den,
bool force =
false);
934 void cut(
double start,
double end,
double dur);
935 void trim(
double start,
double end);
953 assert(i >= 0 && i <
len);
1049 Alg_event *
next(
bool *note_on =
nullptr,
void **cookie_ptr =
nullptr,
1050 double *offset_ptr =
nullptr,
double end_time = 0);
1093 Alg_seq(std::istream &file,
bool smf,
double *offset_ptr =
nullptr);
1095 Alg_seq(
const char *filename,
bool smf,
double *offset_ptr =
nullptr);
1098 void serialize(
void **buffer,
long *bytes)
override;
1108 void write(std::ostream &file,
bool in_secs,
double offset = 0.0);
1110 bool write(
const char *filename,
double offset = 0.0);
1139 void clear(
double t,
double len,
bool all)
override;
1141 void silence(
double t,
double len,
bool all)
override;
1142 void clear_track(
int track_num,
double start,
double len,
bool all);
1145 bool all,
long channel_mask,
1146 long event_type_mask);
1149 long seek_time(
double time,
int track_num);
1169 bool set_tempo(
double bpm,
double start_beat,
double end_beat);
1173 void set_time_sig(
double beat,
double num,
double den);
1175 double *num,
double *den);
#define ALG_DEFAULT_BPM
default tempo
Definition allegro.h:56
DLLEXPORT Alg_atoms symbol_table
Definition allegro.cpp:25
#define alg_attr_type(a)
Definition allegro.h:70
const char * Alg_attribute
Definition allegro.h:68
#define DLLEXPORT
Definition allegro.h:110
char * heapify(const char *s)
Put a string on the heap.
Definition allegro.cpp:36
bool within(double d1, double d2, double epsilon)
Checks if d1 and d2 within epsilon of each other.
Definition allegro.cpp:29
#define alg_attr_name(a)
Definition allegro.h:69
Alg_error
Definition allegro.h:970
@ alg_error_syntax
Definition allegro.h:980
@ alg_error_open
Definition allegro.h:972
@ alg_no_error
no error reading Allegro or MIDI file
Definition allegro.h:971
Symbol table of Alg_attribute objects and other unique strings.
Definition allegro.h:74
Alg_atoms()
Definition allegro.h:76
void expand()
Definition allegro.cpp:44
virtual ~Alg_atoms()
Definition allegro.h:87
Alg_attribute insert_string(const char *name)
insert/lookup attribute by name (without prefixed type)
Definition allegro.cpp:87
Alg_attribute insert_new(const char *name, char attr_type)
Insert an Attribute not in table after moving attr to heap.
Definition allegro.cpp:62
long len
Definition allegro.h:99
Alg_attribute insert_attribute(Alg_attribute attr)
insert/lookup an atttribute
Definition allegro.cpp:75
Alg_attribute * atoms
Definition allegro.h:100
long maxlen
Definition allegro.h:98
Used to contruct a tempo map.
Definition allegro.h:485
double beat
Definition allegro.h:491
double time
Definition allegro.h:490
Alg_beat(double t, double b)
Definition allegro.h:487
A list of Alg_beat objects used in Alg_seq.
Definition allegro.h:496
Alg_beats()
Definition allegro.h:507
~Alg_beats()
Definition allegro.h:515
void insert(long i, Alg_beat *beat)
Definition allegro.cpp:804
long len
Definition allegro.h:501
long maxlen
Definition allegro.h:498
Alg_beat & operator[](int i)
Definition allegro.h:503
Alg_beat * beats
Definition allegro.h:502
void expand()
Definition allegro.cpp:792
static const char * last_error_message
Definition allegro.h:409
Alg_track * get_owner()
Definition allegro.h:448
int sequence_number
Definition allegro.h:424
Alg_event_list()
Definition allegro.h:443
virtual Alg_event *& operator[](int i)
Definition allegro.cpp:737
Alg_track * events_owner
Definition allegro.h:413
virtual void set_start_time(Alg_event *event, double)
Definition allegro.cpp:743
double get_beat_dur()
Returns the duration of the sequence in beats or seconds.
Definition allegro.h:456
static int sequences
to keep track of sequence numbers
Definition allegro.h:415
void set_beat_dur(double d)
Definition allegro.h:457
char type
'e' Alg_event_list, 't' Alg_track, 's' Alg_seq
Definition allegro.h:408
double beat_dur
Definition allegro.h:431
~Alg_event_list() override=default
double get_real_dur()
Definition allegro.h:458
void set_real_dur(double d)
Definition allegro.h:459
char get_type()
Definition allegro.h:447
const char * get_last_error_message()
get text description of run-time errors detected, clear error
Definition allegro.h:471
double real_dur
Definition allegro.h:432
Abstract superclass of Alg_note and Alg_update.
Definition allegro.h:196
double get_duration()
get duration in seconds or beats
Definition allegro.cpp:386
Alg_event()
Definition allegro.h:331
int get_type_code()
Definition allegro.cpp:229
bool has_attribute(const char *attr)
Test if note has attribute/value pair.
Definition allegro.cpp:417
void set_parameter(Alg_parameter *new_parameter)
Definition allegro.cpp:268
const char * get_atom_value()
Get the update's atom value.
Definition allegro.cpp:575
bool is_update()
Check whether an Alg_event is a parameter update.
Definition allegro.h:211
bool get_selected()
Definition allegro.h:222
void set_pitch(float)
Definition allegro.cpp:394
const char * GetDescription()
Computes a text description of this event.
void set_integer_value(const char *attr, int32_t value)
Definition allegro.cpp:328
float get_loud()
get loudness (MIDI velocity)
Definition allegro.cpp:362
char type
'e' event, 'n' note, 'u' update
Definition allegro.h:199
char get_attribute_type(const char *attr)
Get the associated attribute type.
Definition allegro.cpp:428
double get_start_time()
get start time in seconds or beats
Definition allegro.cpp:370
const char * get_string_value()
Get the update's string value.
Definition allegro.cpp:539
void set_logical_value(const char *attr, bool value)
Definition allegro.cpp:315
void set_atom_value(const char *attr, const char *atom)
Definition allegro.cpp:341
void set_real_value(const char *attr, double value)
Definition allegro.cpp:299
void delete_attribute(const char *attr)
Delete an attribute/value pair.
Definition allegro.cpp:514
long get_identifier()
get MIDI key or note identifier of note or update
Definition allegro.h:229
bool is_note()
Check whether an Alg_event is a note.
Definition allegro.h:208
void set_identifier(long i)
Definition allegro.h:230
double time
Definition allegro.h:203
float get_pitch()
get pitch in steps – use this even for MIDI
Definition allegro.cpp:354
bool get_logical_value()
get the update's logical value
Definition allegro.cpp:557
long key
note identifier
Definition allegro.h:200
void set_string_value(const char *attr, const char *value)
Definition allegro.cpp:286
bool selected
Definition allegro.h:198
long chan
Definition allegro.h:204
void set_duration(double)
Definition allegro.cpp:409
static const char * description
static buffer for debugging (in Alg_event)
Definition allegro.h:201
virtual ~Alg_event()=default
bool overlap(double t, double len, bool all)
Definition allegro.cpp:584
double get_real_value()
get the update's real value
Definition allegro.cpp:548
void set_selected(bool b)
Definition allegro.h:223
int32_t get_integer_value()
get the update's integer value
Definition allegro.cpp:566
const char * get_attribute()
get the update's attribute (string)
Definition allegro.cpp:522
double get_end_time()
get end time in seconds or beats
Definition allegro.cpp:378
char get_update_type()
Get the update's type.
Definition allegro.cpp:531
char get_type()
Definition allegro.h:214
void set_loud(float)
Definition allegro.cpp:401
A sequence of Alg_event objects.
Definition allegro.h:362
long maxlen
Definition allegro.h:364
Alg_event *& operator[](int i)
Definition allegro.h:381
virtual int length()
Definition allegro.h:380
bool in_use
Definition allegro.h:379
void expand()
Definition allegro.cpp:657
void set_events(Alg_event **e, long l, long m)
Definition allegro.h:394
void insert(Alg_event *event)
for use by Alg_track and Alg_seq
Definition allegro.cpp:669
void append(Alg_event *event)
Definition allegro.cpp:706
Alg_events()
Definition allegro.h:385
Alg_event * uninsert(long index)
Definition allegro.cpp:693
Alg_event ** events
events is array of pointers
Definition allegro.h:368
double last_note_off
Definition allegro.h:376
long len
Definition allegro.h:367
void show()
Definition allegro.cpp:2733
void begin_seq(Alg_seq *s, void *cookie=nullptr, double offset=0.0)
Definition allegro.cpp:3527
bool note_off_flag
Remembers if we are iterating over note-off events as well as note-on and update events.
Definition allegro.h:1018
Alg_iterator(Alg_seq *s, bool note_off)
Definition allegro.h:1020
void begin(void *cookie=nullptr)
Definition allegro.h:1039
Alg_pending_event * pending_events
Definition allegro.h:1001
long length()
Definition allegro.h:1019
long len
Definition allegro.h:999
Alg_seq * seq
Definition allegro.h:1000
long index
remembers index of current event
Definition allegro.h:1004
void insert(Alg_events *events, long index, bool note_on, void *cookie, double offset)
Definition allegro.cpp:2762
Alg_event * next(bool *note_on=nullptr, void **cookie_ptr=nullptr, double *offset_ptr=nullptr, double end_time=0)
Definition allegro.cpp:3540
void end()
clean up after enumerating events
Definition allegro.cpp:3586
~Alg_iterator()
Definition allegro.h:1015
bool remove_next(Alg_events *&events, long &index, bool ¬e_on, void *&cookie, double &offset, double &time)
returns the info on the next pending event in the priority queue
Definition allegro.cpp:2800
void request_note_off()
Definition allegro.cpp:3579
void expand()
Definition allegro.cpp:2719
Alg_events * events_ptr
the next four fields are mainly for request_note_off()
Definition allegro.h:1003
long maxlen
Definition allegro.h:996
void expand_to(int new_max)
Definition allegro.cpp:2707
bool earlier(int i, int j)
Definition allegro.cpp:2743
double offset
Definition allegro.h:1006
void * cookie
remembers the cookie associated with next event
Definition allegro.h:1005
float pitch
pitch in semitones (69 = A440)
Definition allegro.h:340
void show() override
Definition allegro.cpp:626
Alg_note(Alg_note *note)
copy constructor
Definition allegro.cpp:602
Alg_parameters * parameters
attribute/value pair list
Definition allegro.h:343
Alg_note()
Definition allegro.h:344
double dur
duration in seconds (normally to release point)
Definition allegro.h:342
float loud
dynamic corresponding to MIDI velocity
Definition allegro.h:341
An attribute/value pair.
Definition allegro.h:120
Alg_attribute attr
Definition allegro.h:122
void show()
Definition allegro.cpp:110
Alg_parameter()
Definition allegro.h:135
void set_attr(Alg_attribute a)
Definition allegro.h:140
char attr_type()
Definition allegro.h:138
void copy(Alg_parameter *)
copy from another parameter
Definition allegro.cpp:100
const char * attr_name()
Definition allegro.h:139
A list of attribute/value pairs.
Definition allegro.h:146
static Alg_parameters * remove_key(Alg_parameters **list, const char *name)
Definition allegro.cpp:200
Alg_parameters(Alg_parameters *list)
Definition allegro.h:151
static void insert_atom(Alg_parameters **list, const char *name, const char *s)
Definition allegro.cpp:189
static void insert_logical(Alg_parameters **list, const char *name, bool l)
Definition allegro.cpp:178
Alg_parameter parm
Definition allegro.h:149
static void insert_real(Alg_parameters **list, const char *name, double r)
Definition allegro.cpp:145
static void insert_string(Alg_parameters **list, const char *name, const char *s)
insert string will copy string to heap
Definition allegro.cpp:156
static void insert_integer(Alg_parameters **list, const char *name, int32_t i)
Definition allegro.cpp:168
Alg_parameter * find(Alg_attribute attr)
find an attribute/value pair
Definition allegro.cpp:216
class Alg_parameters * next
Definition allegro.h:148
An array of Alg_events.
Definition allegro.h:1065
Alg_event_list * find_in_track(int track_num, double t, double len, bool all, long channel_mask, long event_type_mask)
Definition allegro.cpp:3298
void add(Alg_event *) override
Definition allegro.h:1166
void write(std::ostream &file, bool in_secs, double offset=0.0)
write an ascii representation to file
Definition allegrowr.cpp:83
double get_bar_len(double beat)
get the bar length in beats starting at beat
Definition allegro.cpp:3458
void set_time_map(Alg_time_map *map) override
Definition allegro.cpp:3011
void silence(double t, double len, bool all) override
Definition allegro.cpp:3246
void copy_time_sigs_to(Alg_seq *dest)
a utility function
Definition allegro.cpp:3001
void paste(double start, Alg_seq *seq)
Definition allegro.cpp:3182
void silence_track(int track_num, double start, double len, bool all)
Definition allegro.cpp:3238
void insert_silence(double t, double len) override
Definition allegro.cpp:3102
int tracks()
Returns the number of tracks.
Definition allegro.cpp:2917
Alg_track * cut_from_track(int track_num, double start, double dur, bool all)
Definition allegro.cpp:2992
Alg_seq(Alg_track *track)
Definition allegro.h:1090
int channel_offset_per_track
used to encode track_num into channel
Definition allegro.h:1074
void seq_from_track(Alg_track &tr)
Definition allegro.cpp:2873
void merge(double t, Alg_event_list *seq) override
Definition allegro.cpp:3224
void set_in_use(bool flag) override
set in_use flag on all tracks
Definition allegro.cpp:3615
void convert_to_beats() override
Change units.
Definition allegro.cpp:2954
void serialize(void **buffer, long *bytes) override
Definition allegro.cpp:1398
void beat_to_measure(double beat, long *measure, double *m_beat, double *num, double *den)
Definition allegro.cpp:3470
Alg_error error
Definition allegro.h:1069
int beat_x
Definition allegro.h:1077
void serialize_seq()
Definition allegro.cpp:1429
void add_event(Alg_event *event, int track_num)
Definition allegro.cpp:3416
void unserialize_seq()
Definition allegro.cpp:1592
Alg_tracks track_list
array of Alg_events
Definition allegro.h:1075
void clear(double t, double len, bool all) override
Definition allegro.cpp:3262
void insert_silence_in_track(int track_num, double t, double len)
Definition allegro.cpp:3095
void clear_track(int track_num, double start, double len, bool all)
Definition allegro.cpp:3254
Alg_time_sigs time_sig
Definition allegro.h:1076
Alg_seq()
Definition allegro.h:1084
long seek_time(double time, int track_num)
find index of first score event after time
Definition allegro.cpp:3321
Alg_seq * copy(double start, double len, bool all) override
Definition allegro.cpp:3132
void set_time_sig(double beat, double num, double den)
Definition allegro.cpp:3464
bool set_tempo(double bpm, double start_beat, double end_beat)
Definition allegro.cpp:3438
void add_track(int track_num)
create a track
Definition allegro.h:1118
bool insert_beat(double time, double beat)
Definition allegro.cpp:3335
void basic_initialization()
Definition allegro.h:1078
Alg_track * copy_track(int track_num, double t, double len, bool all)
Definition allegro.cpp:3126
bool insert_tempo(double bpm, double beat)
warning: insert_tempo may change representation from seconds to beats
Definition allegro.cpp:3380
Alg_seq(Alg_track &track)
Definition allegro.h:1089
Alg_event * write_track_name(std::ostream &file, int n, Alg_events &events)
an internal function used for writing Allegro track names
Definition allegrowr.cpp:51
void convert_to_seconds() override
Definition allegro.cpp:2969
Alg_seq * cut(double t, double len, bool all) override
Definition allegro.cpp:3020
Alg_track * track(int)
Definition allegro.cpp:2923
Alg_iterator * pending
iterator used internally by Alg_seq methods
Definition allegro.h:1067
bool stretch_region(double b0, double b1, double dur)
Definition allegro.cpp:3368
Alg_event *& operator[](int i) override
Definition allegro.cpp:2933
int get_read_error()
Definition allegro.h:1097
double get_tempo(double beat)
get the tempo starting at beat
Definition allegro.cpp:3432
void merge_tracks()
void set_events(Alg_event **events, long len, long max);
Definition allegro.cpp:3591
void smf_write(std::ostream &file)
Definition allegrosmfwr.cpp:653
double nearest_beat_time(double time, double *beat)
Definition allegro.cpp:3357
long locate_time(double time)
Definition allegro.cpp:843
bool stretch_region(double b0, double b1, double dur)
Definition allegro.cpp:1049
Alg_time_map()
Definition allegro.h:527
long locate_beat(double beat)
Definition allegro.cpp:853
void trim(double start, double end, bool units_are_seconds)
Definition allegro.cpp:1079
bool last_tempo_flag
Definition allegro.h:526
double last_tempo
Definition allegro.h:525
Alg_beats beats
array of Alg_beat
Definition allegro.h:524
bool insert_tempo(double tempo, double beat)
Definition allegro.cpp:953
double beat_to_time(double beat)
Definition allegro.cpp:863
void insert_time(double start, double len)
Definition allegro.cpp:1236
double time_to_beat(double time)
Definition allegro.cpp:898
void insert_beats(double start, double len)
Definition allegro.cpp:1261
bool set_tempo(double tempo, double start_beat, double end_beat)
set the tempo over a region
Definition allegro.cpp:1026
void show()
Definition allegro.cpp:832
void reference()
Definition allegro.h:569
long length()
Definition allegro.h:535
void cut(double start, double len, bool units_are_seconds)
Definition allegro.cpp:1134
void insert_beat(double time, double beat)
add a point to the map
Definition allegro.cpp:926
int refcount
Definition allegro.h:522
void paste(double start, Alg_track *tr)
Definition allegro.cpp:1197
double get_tempo(double beat)
get the tempo starting at beat
Definition allegro.cpp:990
void dereference()
Definition allegro.h:563
Represents a single time signature.
Definition allegro.h:884
Alg_time_sig(double b, double n, double d)
Definition allegro.h:889
double beat
when does this take effect?
Definition allegro.h:886
Alg_time_sig()
Definition allegro.h:892
double num
what is the "numerator" (top number?)
Definition allegro.h:887
void beat_to_measure(double beat, double *measure, double *m_beat, double *num, double *den)
double den
what is the "denominator" (bottom number?)
Definition allegro.h:888
A dynamic array of Alg_time_sig objects.
Definition allegro.h:912
double nearest_beat(double beat)
find the nearest beat (see Alg_seq::nearest_beat) to beat
Definition allegro.cpp:2591
void trim(double start, double end)
retain just start to end
Definition allegro.cpp:2262
Alg_time_sig & operator[](int i)
Definition allegro.h:923
~Alg_time_sigs()
Definition allegro.h:927
long maxlen
Definition allegro.h:914
long len
Definition allegro.h:916
int find_beat(double beat)
Definition allegro.cpp:2114
void paste(double start, Alg_seq *seq)
Definition allegro.cpp:2383
double get_bar_len(double beat)
get the number of beats per measure starting at beat
Definition allegro.cpp:2125
void show()
Definition allegro.cpp:2104
void expand()
make more space
Definition allegro.cpp:2042
void insert(double beat, double num, double den, bool force=false)
Definition allegro.cpp:2055
long length()
Definition allegro.h:929
Alg_time_sig * time_sigs
Definition allegro.h:917
void insert_beats(double beat, double len)
Definition allegro.cpp:2525
void cut(double start, double end, double dur)
remove from start to end
Definition allegro.cpp:2137
Alg_time_sigs()
Definition allegro.h:919
virtual Alg_event_list * find(double t, double len, bool all, long channel_mask, long event_type_mask)
Definition allegro.cpp:2012
bool units_are_seconds
Definition allegro.h:699
void serialize_parameter(Alg_parameter *parm)
Definition allegro.cpp:1522
double get_double(char **p, long *b)
static Serial_read_buffer ser_read_buf
Definition allegro.h:704
virtual void convert_to_beats()
Change units.
Definition allegro.cpp:1744
static Alg_track * unserialize(void *buffer, long len)
Definition allegro.cpp:1561
virtual void merge(double t, Alg_event_list *seq)
Definition allegro.cpp:1939
Alg_note * create_note(double time, int channel, int identifier, float pitch, float loudness, double duration)
Definition allegro.cpp:1797
virtual void insert_silence(double t, double len)
Definition allegro.cpp:2000
long get_int32(char **p, long *b)
virtual Alg_track * cut(double t, double len, bool all)
Definition allegro.cpp:1821
Alg_event * copy_event(Alg_event *event)
make a complete copy
Definition allegro.cpp:1290
virtual void set_time_map(Alg_time_map *map)
Definition allegro.cpp:1729
virtual void convert_to_seconds()
Definition allegro.cpp:1764
~Alg_track() override
Definition allegro.h:728
Alg_seq * to_alg_seq()
Definition allegro.h:747
virtual void add(Alg_event *event)
Definition allegro.h:782
virtual void silence(double t, double len, bool all)
Definition allegro.cpp:1979
Alg_event *& operator[](int i) override
Definition allegro.h:713
virtual void serialize(void **buffer, long *bytes)
Definition allegro.cpp:1328
Alg_update * create_update(double time, int channel, int identifier)
Definition allegro.cpp:1811
static Serial_write_buffer ser_write_buf
Definition allegro.h:705
void unserialize_parameter(Alg_parameter *parm_ptr)
Definition allegro.cpp:1694
void unserialize_track()
Definition allegro.cpp:1640
Alg_track()
Definition allegro.h:717
virtual void clear(double t, double len, bool all)
Definition allegro.cpp:1955
bool get_units_are_seconds()
Are we using beats or seconds?
Definition allegro.h:751
void set_dur(double dur)
Definition allegro.cpp:1784
float get_float(char **p, long *b)
void serialize_track()
Definition allegro.cpp:1470
virtual Alg_track * copy(double t, double len, bool all)
Definition allegro.cpp:1862
Alg_time_map * get_time_map()
Definition allegro.h:768
virtual void set_in_use(bool flag)
Definition allegro.h:872
void paste(double t, Alg_event_list *seq)
Definition allegro.cpp:1889
char * get_string(char **p, long *b)
Alg_time_map * time_map
Definition allegro.h:698
double get_dur()
Definition allegro.h:756
A sequence of Alg_events objects.
Definition allegro.h:944
void reset()
Definition allegro.cpp:2683
long len
Definition allegro.h:949
void expand_to(int new_max)
Definition allegro.cpp:2627
void append(Alg_track *track)
Append a track to tracks. This Alg_tracks becomes the owner of track.
Definition allegro.cpp:2646
void set_in_use(bool flag)
handy to set in_use flag on all tracks
Definition allegro.cpp:2699
long maxlen
Definition allegro.h:946
Alg_track & operator[](int i)
Definition allegro.h:952
long length()
Definition allegro.h:956
Alg_track ** tracks
tracks is array of pointers
Definition allegro.h:951
void add_track(int track_num, Alg_time_map *time_map, bool seconds)
Definition allegro.cpp:2656
void expand()
Definition allegro.cpp:2638
Alg_tracks()
Definition allegro.h:957
~Alg_update() override=default
void show() override
Definition allegro.cpp:649
Alg_update()
Definition allegro.h:356
Alg_parameter parameter
an update contains one attr/value pair
Definition allegro.h:353
Alg_update(Alg_update *update)
copy constructor
Definition allegro.cpp:641
char * buffer
Definition allegro.h:579
long get_posn()
Definition allegro.h:590
long get_len()
Definition allegro.h:591
virtual ~Serial_buffer()=default
Serial_buffer()
Definition allegro.h:583
char * ptr
Definition allegro.h:580
long len
Definition allegro.h:581
void init_for_read(void *buf, long n)
Definition allegro.h:608
~Serial_read_buffer() override=default
char get_char()
Definition allegro.h:613
double get_double()
Definition allegro.h:625
const char * get_string()
Definition allegro.h:630
int32_t get_int32()
Definition allegro.h:615
void get_pad()
Definition allegro.h:602
void unget_chars(int n)
Definition allegro.h:614
void check_input_buffer(long needed)
Definition allegro.h:638
float get_float()
Definition allegro.h:620
void check_buffer(long needed)
Definition allegro.cpp:1407
void * to_heap(long *len)
Definition allegro.h:686
void pad()
Definition allegro.h:683
void set_int32(int32_t v)
Definition allegro.h:670
void init_for_write()
Definition allegro.h:652
void set_string(const char *s)
Definition allegro.h:661
void set_char(char v)
Definition allegro.h:682
void store_int32(long offset, int32_t value)
Writes an int32_t at a given offset.
Definition allegro.h:654
~Serial_write_buffer() override
Definition allegro.h:651
void set_double(double v)
Definition allegro.h:674
void set_float(float v)
Definition allegro.h:678
void store_long(long offset, long value)
Definition allegro.h:659
void * cookie
client-provided sequence identifier
Definition allegro.h:985
bool note_on
is this a note-on or a note-off (if applicable)?
Definition allegro.h:988
double time
time for this event
Definition allegro.h:990
long index
offset of this event
Definition allegro.h:987
double offset
time offset for events
Definition allegro.h:989
Alg_events * events
the array of events
Definition allegro.h:986
const char * a
symbol (atom)