# Technical, Musical, and Legal Aspects of an AI-Aided Algorithmic Music Production System
## 2 Materials and Methods
### The Generator  
Music organizes sound structures in time, although the actual forms these structures may assume vary depending on the stage of the creative process. The process starts with a concept that evolves into better defined, yet still abstract ideas. The ideas are transformed into a symbolic score, which is definite but may not express all the features of the previous stage. These are supplemented through an interpretation. Next, a performance produces a sonic representation that may be recorded, processed, and stored as an audio signal to be later reproduced, listened to, and perceived. A similar model of data flow has been adapted for the purpose of automatic music production (Figure 1). User-provided data represent a concept. The Generator uses data structures such as arrays (single type), lists (multiple types), maps (key-value), or rule sets to internally represent higher-level abstract musical structures throughout composition algorithms. The algorithms produce digital scores for individual tracks based on different principles, with elements of interpretation coded as performance marks (dynamics and articulation). Scores are converted to sequencer control data (MIDI--Musical Instrument Digital Interface) and supplemented with interpretation elements (pitch tuning). Sequencer control of a non-real-time sampler through MIDI is an equivalent of a performance and a recording (an output is directed into an audio file). Audio tracks are processed and mixed to undergo a mastering process. The process applied by the Generator to produce a musical work is presented in Figure 2. It may be assumed that in automatic production, a default approach would be to allow a user to define a general concept only. Therefore, in the first stage, a user provides a set of scalar parameters, as described in Table 1, controlling basic features of a single work. These characteristics have multiple relations with a larger set of internal algorithm parameters and affect various phases of the production process. At some point, there will emerge a need to allow a larger degree of control; thus, a set can be expanded with more specific parameters. As an example, the two most important aspects controlled by the mood parameter are the scale and chord type selection probability and the prevalence of a particular movement type in rhythmic motifs. Some musical scales as well as some chord types are considered happy, whereas some are considered sad; therefore, the parameter controls the probability of occurrence of either type in a recording (recordings utilize more than one scale or chord  
Figure 1: Data in subsequent phases of automatic music production. type). With regards to rhythm, setting a higher mood value (happy) allows more frequent use of shorter rhythmic values and characteristic groups, such as fast dotted rhythms. One might also consider tempo as strongly related to mood, which is true, but in a production system, the tempo is a key parameter and has to be controlled directly, so it has been left independent from the mood parameter. Another example is the oddity parameter. It has no common meaning in music, but in our system, it has been designed as a way to allow the generation process to differ more or less from the initially defined standard, common sense settings. If set to high values, it introduces more variety at the cost of a possibly not very well received musical solution. In particular, it controls the probability of non-typical harmonic sequences and allows the introduction of some non-typical scales. For the generation of motifs, it allows the use of some larger intervals more frequently, which can make melodies more interesting but also less easy to memorize. Also, in motif generation, a higher oddity introduces more motifs with less-ordered, irregular rhythmic sequences and flattens the initial probability distribution of note durations allowing a more frequent choice of extreme durations. In drum patterns. the oddity controls the amount of mutation applied to the initial base patterns.