Melodic Complexity¶
complexity_trans
¶
complexity_trans(score: Score) -> float | None
Calculate Simonton's complexity originality score based on 2nd order pitch-class transition probabilities derived from classical themes.
This function implements Simonton's (1984, 1994) measure of melodic originality using transition probabilities derived from analysis of 15,618 classical themes. Higher values indicate more original/unusual melodic transitions.
Parameters:
-
score(Score) –A Score object containing the melody to analyze. The score will be flattened and collapsed into a single sequence of notes ordered by onset time.
Returns:
-
float–Melodic originality score scaled between 0 and 10. Higher values indicate higher melodic originality. Returns 0 for empty scores or sequences shorter than 3 notes.
References
Simonton, D. K. (1984). Melodic structure and note transition
probabilities: A content analysis of 15,618 classical themes.
Psychology of Music, 12, 3-16.
Simonton, D. K. (1994). Computer content analysis of melodic
structure: Classical composers and their compositions.
Psychology of Music, 22, 31-43.
Source code in amads/melody/complexity_trans.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
complexity_ebm
¶
complexity_ebm(
score: Score,
method: ComplexityEBMOption = ComplexityEBMOption.OPTIMAL_MIX,
) -> float
Calculate the expectancy-based model of melodic complexity.
This function implements the complexity model from Eerola & North (2000), which can analyze either pitch-related components, rhythm-related components, or their optimal combination. The output is calibrated against the Essen collection (mean=5, std=1).
The miditoolbox version contains a bug in the optimal ('o') option, where the entropy of the pitch-class distribution (through pcdist1) was calculated as entropy of the interval distribution (through ivdist1).
Parameters:
-
score(Score) –A monophonic Score object containing the melody to analyze.
-
method(ComplEBMOption, default:OPTIMAL_MIX) –The method to use for complexity calculation: - ComplexityEBMOption.PITCH: pitch-related components only - ComplexityEBMOption.RHYTHM: rhythm-related components only - ComplexityEBMOption.OPTIMAL_MIX: linear combination of pitch complexity and rhythm complexity with predetermined weights (default; as to what it's supposed to be optimal in, that beats me...)
Returns:
-
float–Complexity value calibrated relative to the Essen Collection. Higher values indicate higher complexity. Returns 0 for empty scores or single notes.
References
Eerola, T. & North, A. C. (2000). Expectancy-Based Model of Melodic
Complexity. In Proceedings of the Sixth International Conference on
Music Perception and Cognition.
Schaffrath, H. (1995). The Essen folksong collection in kern format.
Source code in amads/melody/complexity_ebm.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |