m A language for music generation.IntroductionCompiler DesignHello World TutorialDerived TypesLessons LearnedConclusionsDEMOmA language for music generation.Yiling Hu | Monica Ramirez-Santana | Jiaying XuIntroduction m is a language specifically designed for algorithmic music composition Gives the programmer the following functionality: translation of traditional musical concepts into arithmetic types arithmetic operators for manipulation typical control structures randomization functionsCompiler Designinterpret.mlm.ml scanner.mll parser.mly ast.mljavacjavaprogram.mOutput.javaOutput.classoutput.midHello World Tutorial/* The 'Hello World' program of the m algorithmic music compositionlanguage. Plays middle C. */void main(){note n;chord c;staff s;part p;n.pitch = C4; // set the note, middle Cn.duration = 1.0;n.intensity = 100;s.instrument = 0; // pianop.bpm = 60;p.beatsig = 0.25;add(c, n);add(s, c);add(p, s);play(p);}C-like syntaxPitch literal – shorthand for the programmerMore typesPrint this song to Java source fileCompose the songSet all derived type fields-Define note and song characteristicsDerived TypesType Members add() play()notepitchintensitydurationCannot add anything to type notePlay the pitch at the intensity defined for the duration defined.chordCollection of notesAdd type notePlay its notes simultaneously.staffCollection of notes and chordsinstrumentAdd typechordPlay its chords in the order they were added.partbpmbeat signatureAdd type staffPlay its staffs simultaneously. Translation of traditional music concepts into arithmetic types Hierarchical in nature Standard library functions to interact with themLessons Learned Start early Learn Ocaml Meet often Source code version control Testing is good Catching errors early on is hardConclusions Simple way to make simple music Great for elevators, coffee shops, places that have music that no one really pays attentions Meet often Making a language is
View Full Document