Who first compared the Trinity to a musical triad? Who first compared the Trinity to a musical triad (a three-note chord), where each Divine Person is analogous to a distinct note and the chord analogous to the Divine Substance?
Short Answer: Johannes Lippius (1585-1612), a German Protestant theologian, philosopher, composer, and music theorist, who also coined the term &quot;harmonic triad&quot; as a set of three notes stacked vertically in thirds.
Earliest use of the musical triad as a harmonic entity in Western music
The triad became common from 1300 onwards, but the triad functioning as a chord appeared only much later (toward the late 1400s).  The following 4 famous compositions between 1300-1600 should illustrate the progression of the use of triad from &quot;juxtaposition&quot; of the 3 notes to the 3 notes as &quot;indivisible unit&quot; (see quotes from Dr. Bertoglio and Dr. Elders below):

c. 1365 Guillaume de Machaut's Messe de Nostre Dame (sample performance): Triad appearing in Organum style compositions as juxtaposition of two consonant harmonic intervals but rarely in important places.
c. mid to late 1400s Johannes Ockeghem's Missa Prolationum (sample performance, score): Triad appearing much more frequently in end of phrase cadences in this Mensuration canon style composition, but still mostly as a side effect of polyphonic writing, not as a self-standing entity.
c. 1515 Josquin des Prez's Missa Pange Lingua (sample performance): Triad starts appearing in isolated homophonic section such as the &quot;et incarnatus est&quot; in the Credo (10:36-11:33) in an otherwise cantus firmus style composition featuring imitative voice pairings (less polyphonic).
c. 1562 Giovanni Palestrina's Missa Papae Marcelli (sample performance): Triad appearing in chordal harmony style similar to later chorale style compositions.

cited in this answer to the question &quot;Who first compared the Trinity to a musical triad?&quot;

Tri-unity represented by triad→monotone conversion

&quot;et hi tres unum sunt&quot; (based on: Isaias 6:1-4)

Monteverdi Duo seraphim @ 3:47
Guerrero's @ 1:55



Contrapuntal technique symbolizing generation
1 (dux)→2 (comes generated by dux, not created by composer!)→3 voices
Father→Son, Father+Son → Holy Ghost

“genitum, non factum”

Missa Ecce Ancilla Domini/Beata es Maria Credo, Guillaume Dufay @ 1:54
Missa Hercules Dux Ferrariæ Credo, Josquin Desprez @ 1:42


“genitum, non factum, [...] per quem omnia facta sunt”

canon in Credo of Bach's B-minor Mass @ 2:23


&quot;Filium Dei unigenitum&quot;

Missa Sine Nomine n. 2 Credo, Johannes Tinctoris @ 1:09



playlist of these in the above-listed order
source: PDF pp. 7-8, notes 5-7, of

Chiara Bertoglio, “A Perfect Chord: Trinity in Music, Music in the Trinity,” Religions 4, no. 4 (December 2013): 485–501

Earliest comparison of the chord and the Trinity
Musicologist Willem Elders in his book Symbolic Scores: Studies in the Music of the Renaissance wrote in the section &quot;Symbols of the Trinity in Art and Music&quot; of the chapter &quot;Canon and Imitation as Musical Images of the Three Divine Persons&quot; (emphasis mine):

The dogma 'one God in three Persons' can be musically represented in the following ways:
(a) the number three can be expressed in the rhythmic movement of the composition, viz. by means of perfect mensuration or proportio sesquialtera;
(b) the concept 'three-in-one' may be symbolized in the triad;
(c) the same concept can also be expressed by way of three canonic voices.
...
The occurrence of the triad as a possible symbol of the Trinity must clearly be approached with even more caution.  The thirteenth-century poet Pierre de Peckham, perhaps inspired by Augustine's interpretation of the ten strings of the psaltery as representing the Ten Commandments, remarks that three strings of the harp, vibrating 'in unity',

Sount par accord come la trinité
(Sound in accord as the Trinity).

...
Yet it is hard to give evidence of this particular use of the triad as an image of the Trinity in Renaissance composition.  Until the sixteenth century the theory of polyphonic composition considered triadic chords as complexes of two harmonic intervals.  Thus, though it is true that Walter Odington (fl. 1298-1316) already recognized the third as a consonant interval, and while it cannot be denied that the triad became a common phenomenon in three-part music from about 1300 onwards, the chord as an indivisible unit is only descried much later.  In his Synopsis musicae novae of 1612, Johannes Lippius says the following: &quot;The simple harmonic triad is the true and three-in-one sounding root of all the most perfect and complete harmony found in the world ... and the image and shadow of that great divine mystery, which is to be adored, the Unitrinity.&quot;  If we further take into account that triads occur as often in settings of texts dealing with the Trinity as they do in settings of other texts, it becomes apparent that any possible symbolic purpose of the major and minor third will not be easy to prove.

Bradley Broadhead, a PhD in Theology from McMaster Divinity College, in his 2014 journal article The Triune Triad: A Musical Analogy Concerning the Trinity and Humanity published in Volume 3 of Imaginatio et Ratio: A Journal of Theology and the Arts attributed the same Johannes Lippius (1585-1612) to make the first definite connection between the musical triad to the Trinity:

From Bach to Messiaen, theologically minded composers have contemplated the Trinity from a musical perspective.² Part of this tradition is employing the major triad as an analogy for the Trinity. An early precursor³ is found in the autobiography of Ignatius of Loyola (1491—1556) which describes a moment when his “understanding began to be elevated so that he saw the Most Holy Trinity in the form of three keys.”⁴ What exactly his contemplations consisted of we can only speculate on, but his experience serves as a pretext for further exploration. A more definite connection between the major triad and the Trinity is found in the work of Johannas Lippius (1585–1612). He was a musical theorist and theologian whose theological insights impacted his conception of the major triad, contributing in turn to the theory of inversion “that stands as the foundation of the modern approach to music.”⁵

How properties of the Trinity are represented in the musical properties of a chord
One major aim of his paper is to

build my analogy on the (tantalizingly) brief remarks of Lippius in his work, Synopsis of New Music, that imply how each note of the major triad corresponds to a person of the Trinity.  This correspondence can easily be inferred by the way he uses the vocabulary of Trinitarian relations to describe how these notes relate to one another.⁸ I expand upon his remarks below in the sections on each person of the Trinity. The fruit of this investigation in turn aids an exploration of the economic Trinity⁹ in relation to salvation history by means of a musical thought experiment. Finally, this experiment culminates in a musical depiction of participation in the divine nature.

Quotes related to Lippius from the sections of Dr. Broadhead's paper:
The Father:

Turning to the major triad, Benito Rivera makes a convincing case that Lippius has Gregory’s conception of the Trinity in mind when Lippius describes the major triad in Synopsis of New Music.12 According to Rivera, “for him the basis [the root of the triad] is the source from which the chord arises.”¹³ At the source of the modern conception of the major triad as a single unit is also the notion of one note giving rise to the other notes of the triad in a way that parallels the Father’s place as the source of the Trinity.¹⁴

The Son:

According to Lippius, “the ultima or summa [the fifth of the triad] . . . is “begotten” by the prima [the root of the triad].¹⁹

The Spirit:

What has been said about the Son and the Father in no way diminishes the relations between them and the Spirit, but the relationship is different because the Father begets the Son, while the Spirit proceeds from the Father in a way that does not entail sonship. Eastern interpreters of the Trinity have been content to note that Scripture distinguishes between the Son and the Spirit,²⁶ while Western interpreters have argued that the Spirit proceeds from the Father
and the Son (i.e. filioque), making the procession of the Spirit unique.²⁷ Looking at the major triad through the lens of the Trinity, Lippius asserts that the root and the fifth “‘co-spirate’ in a perfect and masculine sonority, and then one media [the third] ‘proceeds’ from them and connects them with its milder sweetness. . .”,²⁸ in line with the Western understanding of the procession of the Spirit. What Lippius hears in a subjective sense (it is difficult to objectively determine “masculine sonority” and “milder sweetness”), I hope to affirm by means of a more concrete illustration.

Trinity, Space, and Perichoresis:
Lippius's comparison of the major triad to the Trinity was further developed by
Dr. Broadhead and by Dr. Jeremy Begbie, a professionally trained musician and a professor of theology who wrote the award winning 2007 book Resounding Truth:

While visual representations of the Trinity are useful in some respects, a musical representation has a threefold advantage: first, it is invisible, second, it involves sound waves and air, which connotes the biblical ambiguity between wind and spirit ( רוח in the Old Testament and πνεύμα in the New Testament),³⁷ and third, it allows for distinction in a shared space without conflict or compromise. This third point in particular is useful in terms of understanding the unity and distinctions of the Trinity. Begbie asks,

What could be more apt than to speak of the Trinity as a three-note chord, a resonance of life; Father, Son, and Spirit mutually indwelling, without mutual exclusion, and yet without merger, each occupying the same space, “sounding through” one another, yet irreducibly distinct, reciprocally enhancing, and establishing one another as other?³⁸


Other sections:
Dr. Broadhead then continued his Trinitarian thought experiment by considering how the chords and their overtone series can further symbolize the following:

Fall and Redemption
Incarnation and Redemption
Participation in the Divine Nature

Conclusion:

The major triad is a rich resource for contemplating the nature of the Trinity and God’s interaction with humanity. The constructs created in this paper illustrate a wide range of the various doctrines concerning the Trinity and humanity, including the relations between members of the Trinity and aspects of the fall, redemption, and participation. As an analogy, it avoids Sabellianism by showing how the three persons interrelate with one another and it avoids Tritheism by affirming the Father as the source. Finally, the functions of the notes in the major triad provide a parallel for the unique operations of the persons of the Trinity.

Broader comparison of Trinity with music
Another extensively researched journal article A Perfect Chord: Trinity in Music, Music in the Trinity by Dr. Chiara Bertoglio (a classical pianist with a PhD in music performance practice as well as MA in Systematic and Philosophical Theology), published in a 2013 special issue of Religions, Music and Spirituality, surveys the history of Western music (including references to the Church Fathers) of how &quot;music help us to “say” and to “understand” something of the ineffable and unattainable mystery of the Trinity&quot; in various ways represented by the sections of her article:

2. The Liturgy of Trinitarian Love: how human participates in the liturgy of Trinitarian love (we as musical instrument)
3. The Harmony of Creation, the Harmony of the Creator: how the order and harmony of creation are expressed in music
4. God: the Lord of Time: Homage to the Trinity through the ternary rhythmic mensural notation
5. A &quot;Polyphonic&quot; God: Counterpoint between cantus firmus and the higher parts as an icon of the Trinity
6. A &quot;Harmonious&quot; God: Trinitarian analogies of the chord which is based on the Western tonal system, which in turn is based on the physical properties of sound in the first 6 harmonics.  This is OP's topic and she also  mentioned Lippius:

Already during the Ars-Nova period, the interval of third starts to appear among the allowed consonances, probably in consequence of the influence of British music: at first as passage note (i.e., as a non-consonant, or not totally consonant interval, which could be tolerated between two consonant notes), and later as an “imperfect” consonance ([36], p. 321). It was not before the 16th century, however, that the concept of “triad chord” was established⁹. It is perhaps interesting to consider here the German theorist Johannes Lippius (1585–1612), who perfectly summarized the concept of his time, as the result of the progressive intensifying of an awareness coming from the preceding centuries.¹⁰ For Lippius, the triad (“trias harmonica perfecta”) is “imago et umbra magni mysterii divinæ solum adorandæ Unitrinitatis” ([55]; cf. [56], pp. 40–49). This same concept has been developed in recent times by Paolo Venturino in a series of deep, fruitful and thought-provoking observations on the Trinitarian symbolism of the triad ([57], pp. 67ff; cf. [58]).¹¹
Footnotes:
⁹ Up until then, actually, the three notes forming the triad were not conceived as a self-standing “harmonic” entity proper,
but rather as the juxtaposition of two consonant harmonic intervals (cf. [54], p. 188).
¹⁰ He was the first to formalise the concept of chord inversion, according to which the chords “C-E-G”, “E-G-C” and “GC-
E” are three versions of the same triad.
¹¹ The argument maintained by Venturino is part of a wider discussion, aiming at demonstrating the presence and the
theological value of a particular temperament of keyboard instrument created by Johann Sebastian Bach. According to
Venturino, the composer ciphered his tuning system in the autograph title-page of the Well-Tempered Keyboard I (1722). We are omitting here, in a simplistic way, the complex acoustic/mathematical implications of Venturino’s argument; however, it is interesting to quote here some of his statements concerning the Trinitarian values of the triad.



Her treatment in section 6, the OP's topic, is consistent with and complements what Dr. Bradley Broadhead explored in his journal article referred to above.
Resources for further study

A 1977 English translation of Lippius's 1612 Synopsis musicae novae by Benito V. Rivera can be found in a book Synopsis of new music = Synopsis musicae novae published by Colorado College Music Press reviewed in the Journal of Music Theory here.

In contrast, for examples of how music had been used to portray evil, including the use of the tritone chord please see the notes of Dr. William Renwick's presentation The Portrayal of Evil in Music  in a 2001 symposium.

Book chapter Canon and Imitation as Musical Images of the Three Divine Persons of 1994 book Symbolic Scores: Studies in the Music of the Renaissance by Dutch musicologist Willem Elders.