emotion_profile.py — MIDI 감정 프로파일 분석 엔진

MIDI 파일의 악보 정보(tempo, velocity, note density, interval, chroma)를 heuristic하게 분석하여 5축 감정 값을 계산한다.

5축 감정

AxisScore RangeKey Heuristics
Serenity0-100Slow tempo (-30), low vel_stdev (-15), low NPM (-15), consonant (-10), major (-10), legato (-10)
Warmth0-100Medium tempo (-20), rich vel_stdev (-15), moderate NPM (-10), consonant (-15), major (-10)
Transcend0-100Slow tempo (-15), wide vel_stdev (-15), long duration (-15), multi-track (-15), wide range (-10), minor (-10)
Tension0-100High vel_mean (-15), dissonant (-15), minor (-15), high NPM (-10), extreme tempo (-10), complex (-10)
Joy0-100Fast tempo (-20), major (-15), consonant (-10), high vel_mean (-10), staccato (-10)

3 Operations

OpMeaningFormula
Project투영 (작품의 감정 강도)min(100, 60 + gate_score // 5)
Mirror미러링 (듣는 이의 공명)min(100, 50 + tempo_bpm // 4)
Manipulate조작 (감정 유도력)min(100, 30 + track_count * 8)

Consonance

협화음 판별 (interval class 기준):