Professional Documents
Culture Documents
Creation and Implementation of Intellige
Creation and Implementation of Intellige
Creation and Implementation of Intellige
Plug-ins are an essential component of any digital audio workstation (DAW), allowing the user
to modify audio and MIDI data in a variety of ways. The relationship between the DAW and a
plug-in is relatively simplistic. As a file is played, data is passed into the plug-in, modified in
some way, and sent through its output. While this stream of data is sufficient for basic digital
signal processing, it provides no musical context on its own. Simply put, the plug-in does
not know what beat the current sample lies within, what key signature the piece is written in,
or any other elements of the macro-composition. However, supplementary information can
often be used to answer these questions, giving plug-ins a level of intelligence that allows
them to react and adapt to the properties of a DAW project. While DAW developers have
already begun incorporating such software into the framework of their applications, such as
Logic Pro’s algorithmically implemented “Drummer” software, the relatively limited amount
of data provided by DAWs makes it quite difficult for third party software developers to create
intelligent, creatively inclined plug-ins. Although this paper will focus primarily on the cre-
ation of intelligent MIDI Effect plug-ins, several of these concepts can be utilized in Audio
Effect plug-ins as well.
Academia Letters, July 2021 ©2021 by the author — Open Access — Distributed under CC BY 4.0
1
new measure is reached, or an audio compressor that can clamp down harder on odd numbered
beats. It should be noted that in this context, the term “beat” refers to the base rhythmic unit
of the time signature, not the MIDI beat clock.
Unfortunately, the current beat number is not something that is provided by any major
DAW. Therefore, ancillary data must be used to calculate this value. To do that, the PPQ
position of the given note must first be calculated, representing its overall position within the
project in units of quarter notes (i.e. a PPQ position of 6 represents the 3rd beat of the 2nd
measure of a project in 4/4 time).
Academia Letters, July 2021 ©2021 by the author — Open Access — Distributed under CC BY 4.0
2
Once the beat number is calculated, it can be used for any number of things. A typical
setup might utilize a switch-statement to modify plug-in parameters based on the current beat.
Finally, NotePosition can also be used to determine a note’s proximity to the closest beat.
2 Denominator
BP = (|(N oteposition–M easureP osition– )×( |%1)×2
Denominator 4
Here, BP represents beat proximity, the distance between a note and the closest beat as
a unit interval (i.e. 1= perfectly on beat, 0= halfway between two beats). This can then be
used to process MIDI notes differently, based on their proximity to a downbeat. Likewise, this
same concept can be applied to audio samples.
FF 59 02 sf mi
where FF indicates a meta event, and 59 specifies a key signature event (McGill University).
02 indicates the number of data bytes to follow, while sf represents the number of accidentals
(positive for sharps, negative for flats) and mi specifies either a major or minor key. This meta
event can be used to determine the tonic quite easily.
Academia Letters, July 2021 ©2021 by the author — Open Access — Distributed under CC BY 4.0
3
T onic = ((N umof Accidentals×7) + 9)%12
In this equation, Tonic represents the integer of the corresponding pitch class (i.e. 0=C,
6=F#), while NumOfAccidentals represents the integer provided by the key signature meta
event. Calculating the tonic makes analyzing the relationship between keys easier. This equa-
tion can be used for a variety of purposes, to emphasize tonic notes or suggest potential mod-
ulation progressions for example.
3 Conclusion
Combining the techniques described above with basic music theory concepts can produce
powerfully intuitive tools. Artificially produced melodies, intelligent humanization, and au-
tomatic accompaniment are all within the scope of possibility. These types of plug-ins trans-
form the DAW into a compositional tool in and of itself. They are not meant to replace the
composer, but to supplement their work; analyzing huge amounts of musical information at a
speed no musician ever could.
Bibliography
“Standard MIDI-File Format Spec. 1.1, Updated.” McGill University,
www.music.mcgill.ca/ ich/classes/mumt306/StandardMIDIfileformat.html.
“Tutorial: Create a basic Audio/MIDI plugin, Part 2: Coding your plug-in.” JUCE,
docs.juce.com/master/tutorial_code_basic_plugin.html.
“MIDI Beat Time Considerations.” MajicDesigns, MD_MIDIFile Standard MIDI File Pro-
cessing, 2 Apr. 2020,
majicdesigns.github.io/MD_MIDIFile/page_timing.html.
Academia Letters, July 2021 ©2021 by the author — Open Access — Distributed under CC BY 4.0