## 2 Methodology for Jazz Standard Cross-Harmonization
### Data, Overview of Methods and Problem Formulation
\(M^{N\times 12}\) is the compatibility matrix of each individual chord (not chord group) with an underlying melodic segment, expressed as a 12-dimensional vector (column) that describes the expected melodic rPCP for each chord (row). More details about the construction and involvement of \(M\) are given in the following paragraph. In \(M\), the (initially zero-valued) 12-dimensional vector of each chord is obtained by adding an equal proportion of the rPCP distribution of the chord itself with the distribution of the rPCP of all the underlying melodic segments that this chord has harmonized in all the jazz standards of the database. The values of the 12-tuple that remain zero after this addition, are assigned large negative values (in the presented application, this value is \(-100\)). The intuition behind constructing \(M\) this way is to make each chord compatible with a melodic segment that either incorporates relative pitch classes of the chord itself, or other relative pitch classes that were present in melodic segments that the chord has harmonized in pieces of the dataset. The strong negative values assigned to the remaining rPCPs penalize decisively the existence of rPCPs that are not relevant (in the two above-mentioned ways) to the chord. This approach aims to eradicate the possibility of assigning chords to melodic segments that incorporate even a single relative pitch class that is irrelevant to them. The purpose of this matrix is to allow comparisons between the 12-dimensional vector of each chord with the 12-dimensional rPCP of each melodic segment to be harmonised through the formulation of an \"observations\" matrix, \(O^{N\times K}=M^{N\times 12}\ A^{12\times K}\). Negative values of \(O\), which are possible because of the large negative values of \(M\), are zeroed out. The comparison is reflected by the magnitude of the values of \(O^{N\times K}\) for the respective chord (row) and melodic segment to be harmonized (column). Since these values are obtained through the inner product between the rPCP of the melodic segments to be harmonized (columns of \(A\)) and the highly penalizing rPCP expected by each chord (rows of \(M\) wight large negative values), the large negative will create a negative inner product (or zero value in the final \(O\) matrix), even in the case of a single relative pitch class mismatch between the melody and the chord. Therefore, a chord is considered improbable (zero probability), even if a single relative pitch class of the melodic segment to be harmonized has not been encountered in the dataset for the chord under discussion, or if this relative pitch class is not among the relative pitch classes of the chord tones. It should be noted that chords with no appearance in the dataset (371 chords, or root-type pairs, appearing among the \(N=768\)), are also assigned a melody matching profile based only on their relative pitch class profile. This fact enables the employment of such chords, since they can be potentially matched with a melodic segment, while chord grouping can enable transitions to and from these chords, through the groups they belong to. The inclusion of new chords is arguably a positive component of the presented method. The fact that the possibility to add a new chord is based on its rPCP and on the transition probabilities of the group it belongs to is considered a result of common reasoning in musical terms: if the pitches of a new chord fit the melody and the chord group transitions allow its appearance, why not use it?