Linear Computer-Music through Sequences over Galois Fields
It is shown how binary sequences can be associated with automatic composition of monophonic pieces. We are concerned with the composition of e-music from finite field structures. The information at the input may be either random or information from a…
Authors: H.M. de Oliveira, R.C. de Oliveira
Linear Computer -Music thr ough Sequences o ver Galois Fields H. M. de Oliv eira 1 e R. C . de Oliv eira 2 1 F ederal University of P ernambuco , Depar tment of Statistics, Recif e, Brazil 2 Amazon State Univ ersity , Depar tment of Computer Engineering, Manaus, Brazil hmo@de.ufpe .br , rcoliveira@uea.br A B S T R A C T It is shown ho w binary sequences can be associated with automatic composition of monophonic pieces. W e are concerned with the composition of e-music from finite field structures. The information at the input may be either random or information from a black-and-white, grayscale or color picture. Ne w e- compositions and music score are made a vailable, including a new piece from the famous Lenna picture: the score of the e-music “Between Lenna’ s eyes in C major . ” The corresponding stretch of music score are presented. Some particular structures, including clock arithmetic (mod 12), GF(7), GF(8), GF(13) and GF(17) are addressed. Further , multilev el block-codes are also used in a new approach of e-music composition, engendering a particular style as an “e-composer . ” As an e xample, Pascal multilev el block codes recently introduced are handled to generate a ne w style of electronic music ov er GF(13). 0 I N T R O D U C T I O N Many ways ha ve been de vised to compose music with aid of computers [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ]. One of the most common is adopting the basic principle of map- ping some (binary or multile vel) data source to musical notes [ 6 ]. Among these, a random song is quite straight- forward, simply by generating random sequences at the input of the mapping [ 7 ], [ 8 ]. The input information can also come from another source such as 1 /f noise [ 9 ], or fractal structures [ 10 ]. In the case of a nucleotide se- quence of a genome (or a particular genome stretch) of species [ 11 ], [ 12 ], this is named DNA-music or gene- music [ 13 ], [ 14 ] (do not confuse with music generated by a genetic algorithm [ 15 ]). In the same line of rea- soning, an amino acid sequence in the generation of a protein can be used as data to generate the sound: the protein-music [ 16 ], [ 13 ], [ 17 ], [ 18 ]. Another approach may use an image as a data source to create a song (for example, [ 19 ], [ 3 ]). In this in vestigation, we propose miscellaneous of image-to-note maps from multilevel sequences over a Galois field to music notes, without the concern of put them in categories. DNA-music can be seen as sequences ov er GF(4), a particular case. W e can also use nibbles from bytes (from a binary files, whatev er be the information) to define both note and note value associated with each byte of the file. If you want to hear some interesting computer music genera- ted by this approach, many sites are a v ailable, • https://www.youtube.com/watch?v= qNf9nzvnd1k • http://www.toshima.ne.jp/%7Eedogiku/ TextTable/WhatisGM.html • http://www.genomamusic.com/genoma/ing/ inicio.htm • http://larrylang.net/GenomeMusic/ Indeed, many dif ferent mathematical-based descripti- ons are possible. There are other very interesting appro- aches to composing songs, including polyphonic [ 20 ], much more sophisticated and attracti ve, such as the one dev eloped at Sony Computer Science Laboratories, Pa- ris [ 21 ]. Not to mention Iamus , classical music’ s com- puter composer , that conceive the first complete album composed solely by a computer [ 22 ]. Chermillier pre- sented the Nzakara people’ s music from Congo and Su- dan to five strings harp [ 23 ]. Symmetries and group structure hav e long been exploited, as in [ 24 ], [ 25 ]. Since all these approaches deal with sequences over fi- nite field, this can be generalized. Furthermore, coded sequences (from multilev el error-correcting codes) can be used to replace the input sequences giv en rise some sort of signature of sequences, defining a “style” of mu- sical composition. This is called here an e-composer (deriv ed from the block code used to encoder the in- put sequence). In particular , we consider here the new (multilev el) block codes called Pascal Codes [ 26 ]. En- coding the data from a giv en image, we generate a mu- sic composed by this virtual composer: in this case, Mr Pascal code (Equation 1 ). 1 C O M P U T E R M U S I C F R O M U N C O D E D B I N A RY S E Q U E N C E S There are at least two straightforward ways to cre- ate e-music from particular input: i) music engende- red from an image file ii) music deri ved from a random H. M. DE OLIVEIRA MUSIC O VER GALOIS FIELDS input sequence. In both case, we are initially concer- ned with 8-level information sequences. For picture- music, the image may be resized to a suitable size and then con verted from color to black-white/grayscale as to yield note sequences in a standard octave-repeating (Diatonic scale). For random music generation, input are merely random sequences from a uniform numbers X ∼ U(0,7) generator . From sequences generated ov er GF(7), a natural mapping is present in T able 1 . Also, taking α as a primiti ve element of GF(8), different maps can be assigned using some key signature. For instance, when adopting F major as key signature, the mapping row 3 (T able 1 ) should be replaced by F G A Bb C D E F instead ( 4 th row). Why using the cumulativ e sum of note index es? Redu- cing modulus 5 each note index may be not a good solu- tion, since each single note always yields the same note value. As an option for defining the note value, its du- ration can also be computed by means of the accumula- tiv e sum of 8-lev el note index es by reducing it modulus q = p 0 = 5 , where q stands for an integer that esta- blishes the finest quantization level of notes. If the fi- nest le vel is assumed to be 1/16=1/ 2 ( p 0 − 1) , then p 0 = 5 . Smaller quantization is also possible, e.g. letting p 0 = 7 we reach a 1/64. For instance, let us fists consider T a- ble 2 mapping. In order to compose a short and naive e-music from the most used image of signal proces- sing, the Lenna picture [ https://en.wikipedia.org/ wiki/Lenna ] was conv erted to black-and-white and just the region between Lenna’ s eye was cropped (Figure 1 .) (562 bytes from which there are 416 data bytes, 72 pixel/inch, 105 × 26 pixel). The file http://www.de. ufpe.br/ ˜ hmo/lennabetweeneyes.bmp was read using http://www.onlinehexeditor.com [note that the hea- der field used to identify the bmp file is 0 × 42 0 × 4d [i.e. the character “B” then the character “M” in AS- CII encoding]. The file size is 562 10 bytes. The ini- tial position of image data is 92 16 = 146 10 . Indeed, the score generated may or not contain the header infor- mation: in this case we throw out the header . In- deed, other image format can be used to compose e- music from the hex information. F or instance, the gif file corresponding to the bmp has 107 bytes ( http: //www.de.ufpe.br/ ˜ hmo/lennabetweeneyes.gif ) 1.1 V ariant 1 The reading of any binary file in hexadecimal can be done in octal and each octal symbol set the note to play . In order to illustrate such a process, the first data line is (hex) 7b b9 96 57 ee 95 b5 bf ff 53 88 00 00 (a) Between Lenna’ s eyes (b) grayscale image (c) binarized image Figure 1: images from which the binarized file was used to compose the e-music piece. 00... , which corresponds in (oct base) to the sequence 173 271 226 127 356 225 265 277 377 123 210 0 0 0... . It should be noted that the coding of a byte can be done in a different number of notes (between one and three notes). For example, the particular fiv e bytes 00 06 1b 27 e2 result in the following sequence of notes: { rest } { A } { E E } { F B } { E F D } , since 00= 0 8 06= 6 8 1b= 33 8 27= 47 8 e2= 342 8 . Length: 828 musical notes. 17327122612735622526527737712321000000354342334737311325 337737737514200000336261212233771242452773773751020000027 112427377377252133377377346276200000030615337377375326252 377377153237300000017110127737734244151377372163773200000 140657377356231333177376141573700000300325737733415226377 370162736000002201023377363203231377374230735000000241377 350144127277376120136000000013773603053177376003500000000 377341203226377374003600000040017734226147377374003740000 00017730020272377377003600000000177451127177377043600000 000377026265377377043400000000375032157337377200034000000 001700252311773773000000000000066177377377360000000000013 452453773773700000000000125213637737737400000030000021251 733773773740000003000001106273377377377100000003600001123 115717737737733000000361400140302441473373773772450000037 0125601212113773773773772101000000 416 bytes of data 1.2 V ariant 2 Another possible “data bit-to-note code” mapping is using nibbles (the first octal symbol) of the byte to set the note code and the second one to set the note value. Therefore, the initial sequence of the file, 7b b9 | 96 57... would be map as (173 mod 13) (271 mod 5) | (226 mod 13) (127 mod 5) | ... that is to say 4 1 | 5 2 ... The two first note are then Eb 1/2 E 1/4... 1.3 V ariant 3 Further straightforward approach should be to use the Hamming weight [ 27 ] each data byte of the file to define the musical codes according with the T able 3 . The idea of cut out the code “0” becomes not only to fulfill the mapping of T able 1 (from 8-point to 9-point), but also to av oid the common long sequences of zeros, which imply long rests. Here is the result for the file (Length: 237 musical notes): 64456457842544474588736433834787253488458856143787548856 25278424863832258646772652358543854342228634863342184357 72141842477484348641743586672158847135781480358813736781 34347824788415488514588621468862136888142467884512235788 4542321888821 (cf. T able 3 ) GEEFGEF ABECFEEEAEFBB ADGEDDBDEABA CFDEBBEFBB FG rest ED AB AFEBBFGCFCABECEBGDBDCCFBGEGA A CGFCDFBFEDBFEDECCCBGDEBGDDEC rest BEDF AA C rest E rest BECEAAEBEDEBGE rest AEDFBGGAC rest FBBEA rest DF AB rest EBDFBB rest D AD GAB rest DEDEABCEABBE rest FEBBF rest EFBBGC rest EGBBGC rest DGBBB rest ECE GABBEF rest CCDF ABBEFECDC rest BBBBC . H. M. DE OLIVEIRA MUSIC O VER GALOIS FIELDS T able 1: Musical notes codes as a function of the 8-Gray pixel lev el (or GF(8)). signal 0 1 2 3 4 5 6 ov er GF(7) 8-gray α 0 α 1 α 2 α 3 α 4 α 5 α 6 α 7 ov er GF(8) C major rest C D E F G A B F major rest F G A Bb C D E G major rest G A B C D E F# T able 2: Note values defined in terms of the accumulati ve inde xes by reducing it modulus p 0 = 5 . symbol of GF(5) duration note symbol 0 1 / 2 0 = 1 / 1 Whole note (Semibrev e) 1 1 / 2 1 = 1 / 2 Half note (Minim) 2 1 / 2 2 = 1 / 4 Quarter note (Crotchet) 3 1 / 2 3 = 1 / 8 Eighth note (Quarver) 4 1 / 2 4 = 1 / 16 Sixteenth note (Semiquarver) Figure 2: Score of an excerpt of “Between Lenna’ s eyes” in C major . T able 3: Musical notes codes for the Hamming weight of a byte. lev el 0 1 2 3 4 5 6 7 8 note erase rest C D E F G A B 2 L I N E A R C O M P U T E R M U S I C F R O M S E Q U E N C E S O F M U LT I L E V E L B L O C K C O D E S A possible way of choosing the note is to take into account each symbol of the GF(13)-valued codew ord assuming a look-up table such as shown in T able 4 to deal with the chromatic scale. Indeed, clock arith- metic (mod 12) can also be used, simply by neglecting rest. Again, The note values can be computed accor- ding to T able 2 . Let us now pick a clef. Here we also offer the use of multilevel error correcting codes over GF(13) to introduce some redundancy to the input data, i.e. by doing a block encoding on the sequence over GF(13). In order to play multilev el block codew ords ov er GF(13), and starting new linear electronic music, an ( N , K ) code ov er GF(13) is chosen. Input: i) ran- dom generation of codew ords as k numbers with distri- bution ∼ U(0,12), or ii) an image for the generation of codew ords from the binary file of the picture and use as the information P 12 1 i . A Pascal (13,8) blockcode ov er GF(13) has generator matrix G giv en by (meet Mr H. M. DE OLIVEIRA MUSIC O VER GALOIS FIELDS T able 4: One-to-one mapping between notes of the temperate scale and symbols of GF(13). 0 1 2 3 4 5 6 7 8 9 10 11 12 rest C C# D Eb E F F# G G# A Bb B Pascal): 1 0 0 0 0 0 0 0 0 0 0 0 12 0 1 0 0 0 0 0 0 0 0 0 1 12 0 0 1 0 0 0 0 0 0 0 12 2 12 0 0 0 1 0 0 0 0 0 1 10 3 12 0 0 0 0 1 0 0 0 12 4 7 4 12 0 0 0 0 0 1 0 0 4 11 12 4 10 0 0 0 0 0 0 1 0 7 12 8 12 6 0 0 0 0 0 0 0 1 4 12 4 1 2 (1) The Number of Distinct Excerpts is 13 K = 815 , 730 , 721 . Coding the bmp image “between Lenna’ s eyes” with the generating matrix of Equation 1 , we hav e the associated music generated by composer Mr P ascal. For instance, the simple repetition code (2,1) over GF(13) with random information symbols such as 11, 2, 5, 0... generate the sequence of repea- ted notes: 11 11 | 2 2 | 5 5 | 0 0 ... i.e. Bb 1/4 Bb 1/2 | C# 1/4 C# 1/2 | E 1/4 E 1/1 | rest 1/1 rest 1/1 ... . For a block code of length say N =10, a particular codew ord (11 2 5 0 3 3 12 1 4 8) engender the follo wing accumu- lated (mod 3) sequence: 11 13 18 18 21 24 36 37 41 49 ≡ 2 1 0 0 0 0 0 1 2 1. In this particular case, since q =3, only Whole note, Half note, and Quarter note are con- sidered. The note sequence would thus be: Bb (1/4) C# (1/2) E (1/1) rest (1/1) D (1/1) D (1/1) B (1/1) C (1/2) Eb (1/4) G (1/2) Now by assuming q =5 for the same codew ord, the cor- responding sequence is: 11 13 18 18 21 24 36 37 41 49 ≡ 1 3 3 3 1 4 1 2 1 4 The note sequence this time would be: Bb 1/2 C# 1/8 E 1/8 rest 1/8 D 1/2 D 1/16 B 1/2 C 1/4 Eb 1/2 G 1/16 . Of course, many variants are possible. For example, to incorporate different lengths for rests, one can cho- ose to use the structure on GF(17), using an (arbitrary) mapping of the type described in the T able 5 . 3 C O N C L U S I O N S A new approach to generating electronic music is presented which consists of the use of structures on fi- nite fields, including multilev el block codes. Musical compositions employing block codes with different in- put symbols can be viewed as songs of the same compo- ser (characterized by block code). Different variants are presented for both diatonic scale and chromatic scale. Some score of new musical pieces are av ailable, inclu- ding “Between Lenna’ s eyes. ” R E F E R E N C E S [1] Marvin Minsky , ”Music, Mind, and Meaning”. In: Roads, Curtis (ed), The Music Machine: se- lected readings fr om the music journal , The MIT Press, Cambridge, Mass., 1989. [2] Eduardo Miranda, Composing music with compu- ters , CRC Press, 2001. [3] Curtis Roads, The computer music tutorial , MIT press, 1996. [4] W ilhelm Fucks, “Mathematical analysis of formal structure of music, ” IRE T ransactions on Informa- tion Theory , vol. 8, no. 5, pp. 225–228, 1962. [5] Bill Manaris, Dallas V aughan, Christopher W ag- ner , Juan Romero, and Robert B Davis, “Evolu- tionary music and the zipf-mandelbrot law: De- veloping fitness functions for pleasant music, ” in W orkshops on Applications of Evolutionary Com- putation . Springer , 2003, pp. 522–534. [6] Thomas Rossing, Richard Moore, and Paul Whe- eler , The Science of Sound , Addison W esley , 3rd ed edition, 2002. [7] Harald Niederreiter , Random number generation and quasi-Monte Carlo methods , SIAM, 1992. [8] Harry F Olson and Herbert Belar , “ Aid to mu- sic composition employing a random probability system, ” The J ournal of the Acoustical Society of America , vol. 33, no. 9, pp. 1163–1170, 1961. [9] Richard F V oss and John Clarke, “”1/f noise” in music: Music from 1/f noise, ” The Journal of the Acoustical Society of America , vol. 63, no. 1, pp. 258–263, 1978. [10] Zhi-Y uan Su and Tzuyin W u, “Music walk, fractal geometry in music, ” Physica A: Statistical Me- chanics and its Applications , vol. 380, pp. 418– 428, 2007. [11] Peter Gena and Charles Strom, “Musical synthesis of dna sequences, ” in XI Colloquio di Informatica Musicale , 1995, pp. 203–204. [12] Serge Morand and Franc ¸ ois Gasser, Langage des g ` enes - musique des hommes? Nodulations - la musique des g ` enes , INRA Editions, V ersailles, 1998. [13] Nobuo Munakata and K enshi Hayashi, Gene Mu- sic; T onal assignments of Bases and Amino Acid- sin: V isualizing Biological Information , W orld Scientific, Singapore, 1995, ISBN 9810214278. [14] Nobuo Munakata, Musical Representation of Gene Sequences, in:In Arts Medicine , Saint Louis, 1997, 0-918812-92-5. H. M. DE OLIVEIRA MUSIC O VER GALOIS FIELDS T able 5: Mapping GF(17) for the chromatic scale allowing dif ferent rest lengths (until Semiquav er-length rest). 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 C C# D Eb E F F# G G# A Bb B [15] Dragan Mati ´ c, “ A genetic algorithm for compo- sing music, ” Y ugoslav Journal of Operations Re- sear ch , vol. 20, no. 1, pp. 157–177, 2010. [16] John Dunn and Mary Anne Clark, “Life mu- sic: the sonification of proteins, ” Leonar do Music Journal , v ol. 32, no. 1, pp. 25–32, 1999. [17] Ross D King and Colin G Angus, “Pm—protein music, ” Computer applications in the bioscien- ces: CABIOS , vol. 12, no. 3, pp. 251–252, 1996. [18] Rie T akahashi and Jef frey H Miller , “Con ver- sion of amino-acid sequence in proteins to classi- cal music: search for auditory patterns, ” Genome biology , v ol. 8, no. 5, pp. 405, 2007. [19] Thomas Oberst, “Blind graduate student ‘reads’ maps using cu software that con verts color into sound, ” Cornell Chronicle , v ol. 36, pp. 5, 2005. [20] V ictor Lavrenko and Jeremy Pickens, “Polypho- nic music modeling with random fields, ” in Pro- ceedings of the eleventh ACM international con- fer ence on Multimedia . ACM, 2003, pp. 120–129. [21] Ga ¨ etan Hadjeres and Franc ¸ ois P achet, “Deep- bach: a steerable model for bach chorales gene- ration, ” arXiv preprint , 2016. [22] Gustav o Diaz-Jerez, “Composing with melomics: Delving into the computational world for musical inspiration, ” Leonardo Music Journal , vol. 21, pp. 13–14, 2011. [23] Marc Chemillier , “Math ´ ematiques et musiques de tradition orale, ” Math ´ ematiques et sciences hu- maines , , no. 178, pp. 11–40, 2007. [24] Kathryn Bailey , “Symmetry as nemesis: W ebern and the first mov ement of the concerto, opus 24, ” Journal of Music Theory , vol. 40 10.2307/843890, no. 2, pp. 245–310, 1996. [25] Daniel Muzzulini, “Musical modulation by sym- metries, ” Journal of Music Theory , vol. 39, no. 2, pp. 311–327, 1995, 00222909. [26] Arquimedes J A Paschoal, H ´ elio M de Oliveira, and Ricardo M Campello de Souza, “ A transfor- mada num ´ erica de pascal, ” in Anais do XXXIII Simp ´ osio Br asileir o de T elecomunicac ¸ ˜ oes , Juiz de Fora, 2015, SBrT . [27] Richard W Hamming, Coding and Theory , Prentice-Hall, 1980.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment