The Harmonics  is probably earlier than the Tetrabiblos. Although Ptolemy is well known for his astronomy and astrology, he was also one of the ancient sources for theories of harmony.
The work studies this universal field of knowledge for which music and geometry are considered subsets. Much of the material in Harmonics is exclusively concerned with music, including setting up exact number ratios for the different modes.
The Harmonics Book III applies his previous exposition of intervals, scales, and ratios to ethics and psychology, and to astronomy and astrology. Unfortunately, some of Book III has been lost to us. In Chapter 9 of Book III, Ptolemy presents the astrological aspects and their ratios to one another. Curiously, in this presentation Ptolemy does not use degree numbers for the aspects. Instead, he considers the twelve zoidia as discrete units and the whole number relationships between them that yield moriai and epimoriai. This discussion might have fit better into the Tetrabiblos Book I, within his treatment of the qualities and relationships between whole zoidia.
Ptolemy’s Digression: Astrology’s Aspects and Musical Intervals
Statement of the Problem
This essay addresses a problem in the development and continuity of astrology: how do astrologers, past and present, account for the astrological aspects? Aspects are the means by which a planet or position (Ascendant, Lot of Fortune) has contact from another planet or other planets. Once an astrologer has designated planet or a position to answer a question posed to the astrological chart, aspects to the designated position provide information to answer a question and determine an outcome.