MusicTool data structures : documentation

summary:


I: Bitwise Representation in MusicTool :


I.1: Bitwise Representation of MusicTool external types :

NB: external types are the types that users can interract with while using the MusicTool interpreter or an smtool command

I.2: Bitwise Representation of MusicTool internal types :

NB: external types are the types used inside MusicTool as intermediate representation or the constituant of the external types.

II: Other MusicTool objects :


NB: "complex" types is used to denote that these structures aren't just integers / don't use bitwise representation.

II.1: the "SAVED_" objects:

MusicTool uses singly linked lists to save objects in an environments. These objects can be scales, chord progs, harmonised scale, Pitch class sets or triad progressions. They are thus called S_SAVED_SCALES S_SAVED_MODES, S_SAVED_PROG, S_SAVED_DODEC, S_SAVED_TRIAD.

II.2: S_MODES:

S_MODES is simply an array of S_SCALES. It is not wrapped inside a structure where the length of it is stored because it's length is ALWAYS the length of the scale it contains.

II.3: S_TRIAD_PROG / S_CHPROG:

S_TRIAD_PROG is a simple structure containing an array of TRIADS and the length of the array. S_CHPROG is the same thing except it CHORD elements in it's array.

III: structure used for storage :


III.1: S_USERINFO:

S_USERINFO is a structure containing a reference to one of each S_SAVED_... structure in MusicTool as well as the number of elements in each of these structures.
At start, MusicTool initialises an S_USERINFO structure to store elements saved during the session. when a "save" function is called.

III.2: the prog book :

NB: THE PROG BOOK' CURRENT IMPLEMENTATION IS AWFUL. IT SHOULD BE
A TABLE WHERE INDEXES CORRESPOND TO THE LENGTH OF THE ENTRIES AT EACH INDEX (progs of length 1 stored at index 0, 2 index 1...)
AT EACH INDEX, PROGS WOULD BE STORED IN SMALLER TABLES WHERE THE KEYS WOULD BE THE PITCH_CLASS_SET ASSOCIATED WITH THE PROG

The prog book is a dynamic array used to stored BOOKENTRY elements. It is initialised with 30 slots when MusicTool is launched and can be edited by reading an environment containing an env book() section or by using the command "book add"