# Technical, Musical, and Legal Aspects of an AI-Aided Algorithmic Music Production System
### Related Work  
The system discussed in this paper is related to two well known concepts, i.e., functional, or background music, and algorithmic composition. Both were conceived centuries before the advent of digital computers. A characteristic of functional music is that it has a secondary, accompanying role during some other activity. It has to comply with various requirements regarding its quality, and therefore it may be well suited for some algorithmic approaches that help to achieve predictable results [4, 5, 6]. This kind of music, where artistic value is secondary to utilitarian value and adaptation to externally imposed requirements, is a suitable target for the presented system. A good example may be music created for the purpose of relaxation. Algorithmic composition is a technique that easily dates back to at least the early polyphonic music and rules of counterpoint [7]. In the 20 th century, it helped to develop the dodecaphony and serial techniques [8], but for the most part, it was considered a composer's tool. It required an introduction of digital computers to code and apply selected rules so that entire works could be composed in a fully automated manner. First among notable examples was a string quartet 'Illiac Suite' by [PERSON] and [PERSON] [9]. The principle applied was based on the counterpoint and dodecaphonic rules controlled by probabilistic techniques. After the 'Illiac Suite', various methods and techniques have been applied to music generation. In [10], seven categories were discussed, such as Markov chains, formal grammars, rule-based systems, neural networks (with deep learning), evolutionary algorithms, chaos similarity, and agent-based systems. AI methods have greatly expanded in recent years. Finding the needed method has turned out to be easier, necessary, and sufficient for the generation and classification of music data, which is a complex task. As reported in [11], several AI techniques and algorithms have been proposed for solving the problem. Evolutionary algorithms have been applied in various areas of music composition. Many directions of their application for composing music can be found, e.g., making variations of an existing composition or motif, considering a melody composition with or without rhythm generation, and so on. In [12], a genetic algorithm that evolved a four-part musical composition melodically, harmonically, and rhythmically was presented. In [13], the use of evolutionary computation to create melodic line harmonization was proposed. In turn, a survey by [PERSON] et al. [14] specifically focused on an analysis of using deep learning for music generation. Recently, many studies have explored deep neural networks for creating music and obtaining its proper quality [15]. In the domain of algorithmic music composition, promising results have been described using deep recurrent neural networks, mainly a specific recurrent neural network known as the long short-term memory neural network or simply LSTM. For example, in [16], LSTM for polyphonic music prediction was proposed. In [17], a method for automatically developing music based on music segments from existing music and LSTM for tinnitus music therapy was described. Moreover, some studies have observed good results when examining the transformers to create music compositions. For example, Google used the transformer for music generation [18]. In [19], a music generation model that combines a transformer with generative adversarial networks (GANs) was proposed. [PERSON] et al., in [20], proposed a transformer-GAN model to create symbolic music conditioned by sentiment. In [21], [PERSON] et al. proposed a scheme based on combining the transformer and generative pre-training model (GPT) to generate multi-track music including tracks of piano, guitar, and drum. A good review of the available works about AI methods and solutions is given in [22]. A number of papers have discussed various classification problems.