Automatic Music Transcription of Six Thai Musical Instruments
Thaphon Chinnakornsakul*, Computer Science, Kasetsart University
Bangkok, Thailand, thaphon.c@ku.th
Atipong Wamaloon*, Computer Science, Kasetsart University
Bangkok
Somchoke Ruengittinun*, Computer Science, Kasetsart University
Bangkok, Thailand, somchoke.r@gmail.com
Worasait Suwannik*, Computer Science, Kasetsart University
Bangkok, Thailand, worasait.suwannik@gmail.com
* Corresponding author
Abstract — Automatic music transcription (AMT) converts recordings into note events, but the resulting notes do not determine how a different ensemble should perform the music. This work addresses this next stage. The proposed system accepts audio or MIDI, identifies musical voices and sections, selects material, assigns it to six Thai target instruments, and produces validated musical notation (notes and playing instructions) before synthesizing one audio track per instrument (a stem). Its deterministic rules define a contemporary computational transformation rather than traditional arranging for the piphat, the classical Thai ensemble of mallet percussion, oboe, and drums. We evaluate the pipeline in three stages: transcription, notation construction, and rendering. On all 909 songs of the POP909 MIDI dataset, melody-transfer F1 reached 86.2% with 79.6% melody coverage. On real-audio URMP, 43 of 44 excerpts completed; AMT note F1 was 60.4%, while arrangement F1 was 35.6%. All 20 BabySlakh excerpts completed, with corresponding F1 values of 49.8% and 27.4%. The arrangement results indicate substantial disagreement between audio-derived and reference-MIDI notation decisions. Renderer tests produced deterministic, unclipped output; pitch error across 61 target keys had a median of 1.23 cents and a 95th percentile of 7.12 cents. These results establish structural agreement and software conformance; because no listening test was conducted, perceived sound quality and cultural authenticity remain unevaluated.
Automatic music transcription converts audio into note events and, for multi-instrument systems, source-instrument
labels [1]. Target assignment additionally requires voice selection, timing, tuning, and register decisions. We study
this downstream transformation into musical notation for a fixed target ensemble. The target ensemble comprises six Thai musical instruments drawn from the piphat ensemble [2], [3], including ranat ek, khong wong yai, pi nai, ching, taphon, and klong that (Table I). The generated notation is not claimed to follow traditional ensemble arranging. This boundary matters because Thai musical notation is context-dependent [2], while measured tunings vary in absolute pitch and step size [4], [5]. Prior work addresses melody identification and musical structure [6], [7], [8]. This paper makes three contributions. (1) A deterministic pipeline that converts audio or MIDI into validated musical notation for six Thai instruments, with every source note traced in an audit ledger. (2) Six sound engines that render the notation into one audio track per instrument. (3) A stage-separated evaluation that distinguishes transcription error, intentional omission during arrangement, end-to-end arrangement agreement, and renderer conformance. Fig. 1 separates processing from evaluation; Fig. 2 shows a real ensemble for context. We ask: RQ1, how much labeled
melody and supporting material does the core retain on symbolic pop music? RQ2, how much does real-audio
transcription alter the notation relative to a reference-MIDI path? RQ3, how does the same comparison behave for
controlled synthetic audio? RQ4, do the sound engines obey notation constraints and rerender repeatably?
Figure 1. Audio and MIDI share the same analysis, target-notation, and rendering stages. The lower Evaluation box uses dashed links to distinguish transcription checks, conversion checks, and audio rendering checks.Figure 2. A piphat ensemble in Bangkok, circa 1963, showing ranat and khong wong in performance. The photograph illustrates the instrument family; it is not the exact six-instrument configuration simulated here.
Table 1. THE SIX THAI TARGET INSTRUMENTS AND THEIR ROLES IN THE PROPOSED SYSTEM
Instrument
Type
Role in this system
Ranat ek
Treble xylophone, 21 wooden bars
Main melodic grid
Khong wong yai
Circle of 16 tuned gong bosses
Lower reinforcement of the main line
Pi nai
Quadruple-reed oboe, six finger holes
Counterline or selected source phrases
Ching/chap
Small cymbals
Establishes the metrical cycle
Taphon
Two-headed barrel drum played by hand
Energy-driven rhythmic accompaniment
Klong that
Pair of large barrel drums played with sticks
Strong accents and percussion passages
II. RELATED WORK
Automatic music transcription. Multi-instrument AMT models estimate note events together with source-instrument labels [1]; they output what was played, not how a different ensemble should play it.
Melody and structure in symbolic music. Melody-bearing channels in MIDI can be identified with dynamic programming over measures [6] or with convolutional models on symbolic scores [7], and music structure analysis segments pieces into sections [8]. We adapt these ideas to select material for target parts.
Thai music representation. Thai notation conventions are context-dependent [2], and measured Thai tunings vary in absolute pitch and step size [4], [5], so a fixed equal-step model cannot be assumed.
Instrument sound synthesis. Excitation–resonator models are standard in sound synthesis [11], and reed instruments have dedicated digital models [12].
To our knowledge, these components have not been combined into a pipeline that assigns transcribed music to a Thai target ensemble.
III. FROM SOURCE NOTES TO TARGET PARTS
A. From audio to normalized voices
MuScriptor Medium [1] estimates note onset, offset, pitch, and source instrument. Normalization then handles tempo and meter maps, PPQN or SMPTE timing, sustain, program changes, overlapping notes, and incomplete note-offs. A logical source is a track–channel–program span. Polyphonic sources are separated with a directed note graph whose edge costs include pitch distance, temporal gap, overlap, metrical position, contour, and continuity. Voice analysis distinguishes a source track from a melodic line inside that track [6], [7]. Exact duplicates are merged for analysis while their source identifiers remain in the audit ledger. Section boundaries first follow markers and tempo or meter changes. If these do not describe the form, bar-level novelty is computed from pitch-class content, contour, density, and instrumentation, with repetition and local homogeneity limiting spurious cuts. These adapt segmentation principles reviewed in [8]. The notation calls its metrical unit a room; this is a project term rather than a universal Thai-notation claim. Onsets and durations are quantized to four slots per room without changing event order.
B. Melody, texture, and tonal analysis
Candidate voices are scored from note density, inter-onset intervals, pitch and duration prominence, velocity, monophony, continuity, repetition, and metrical salience. Prior work uses dynamic programming to identify melody-bearing MIDI channels across measures [6]. For each room, a segmental dynamic program chooses one candidate or an explicit NONE state. Its transition cost discourages arbitrary source switching but falls at rests and weak boundaries. NONE is favored when material is silent, chordal, or lacks a dominant melodic source; up to two dissimilar high-ranked paths are retained as secondary material.
For each section, tonal analysis tests all 12 tonic classes against the seven degrees of the selected tuning profile. Sustained notes and cadential positions receive greater weight; unnecessary tonic changes incur a penalty. The MIDI key signature provides a prior. Selected notes are mapped to the nearest target degree and octave, with pitch and timing changes recorded. This permits modulation without assuming a universal equal-step Thai tuning model [4], [5].
C. Arrangement and musical notation
Ranat plays the main grid, reinforced by khong at a lower level. Secondary paths become independent parts. Source-derived texture replaces absent main material; unused source notes may bridge short gaps. These are intentional arrangement choices rather than duplicate transcription.
Pi uses only notes from a suitable monophonic source path. Depending on its rests, motion, and relation to the main line, it supplies a counterline or takes selected source phrases while ranat carries the complement. Register is chosen over the phrase rather than independently per note. Articulation follows source timing: connected changes are legato, repeated onsets are tongued, and long lines receive an explicit circular-breath cue instead of an invented rest. No decorative pi notes are composed.
Percussion is a metrical accompaniment rather than a direct remapping of MIDI drum pitches. Ching/chap establishes the room cycle; taphon is enabled by aggregate energy or percussion evidence; klong that marks stronger source-drum evidence and percussion-only passages. Pattern length always covers its section and MIDI drums influence energy and accent placement. These rules are deterministic contemporary heuristics, not named traditional nathap or a claim of expert-approved Thai arranging. The audit ledger assigns every input note to represented or arrangement_omitted; dropped remains zero. Because the method deliberately selects and layers material, neither full source-note coverage nor a one-to-one source/target event relation is expected.
The UTF-8 .piphat format records Thai solfege degrees ด ร ม ฟ ซ ล ท, octaves, note timing, playing instructions, and percussion patterns. A line contains eight rooms of four slots; - sustains, . rests, and parentheses subdivide a slot. This project notation is not a replacement for traditional performance notation [2]. Before output is saved, the notation is formatted as .piphat text, parsed back, validated against slot structure and instrument playability, and compiled into the event timeline used for rendering; any failure stops the run.
Figure 3. Notation instructions and stored response data jointly drive the simulated gesture that produces each instrument stem.
Table 2. NOTATION INSTRUCTIONS AND SOUND ENGINES
Target
Stored representation and runtime response
Ranat ek
Denoised impulse responses measured for 15 bars are extended deterministically to 21 pitches. A mallet impulse is convolved with the selected response.
Khong wong yai
Frequency, amplitude, phase, decay/T60, geometry, and attack values describe 16 bosses; a mallet transient excites damped inharmonic modes.
Pi nai
Registers, 24 tones, and six-hole fingerings follow [10]. Our spectral engine adds expressive controls and reed/bore-inspired coupling [12].
Taphon
Seven hand strokes select head contact, muting, pitch glide, coupled circular-membrane modes, and shell response.
Ching/chap
Open and closed contacts combine a collision transient, metallic modes, and contact-dependent damping.
Klong that
High, low, or paired padded-mallet strikes excite loaded-membrane clusters, pitch relaxation, body response, and opposite-head coupling.
D. Simulated performance and sound
Each note event specifies instrument, pitch or stroke, timing, velocity, and playing instructions. Pi also specifies fingering, tongue contact, pressure, and breath, informed by documented playing techniques [10]. All sound engines read the same event timeline. Fig. 3 summarizes the runtime path from note events and stored response data to an instrument stem. Table I describes the six implemented engines. Ranat is the only audio-domain response model; the remaining engines store numeric acoustic parameters. The common excitation–resonator organization follows established sound-synthesis practice [11], but they are not physical models calibrated against recordings of the target instruments. A continuous pi phrase is rendered in one pass so oscillator phase, pressure, airflow, vibrato, and breath noise survive note boundaries. Each event or phrase is synthesized once into an instrument stem; one normalization gain is shared by all stems and their master.
Table 3. CORPORA AND THE STAGE EACH ONE EXAMINES
Corpus
N
Input
Purpose
POP909
909
MIDI
melody and source-role retention
URMP
44
real audio
transcription loss before arrangement
BabySlakh
20
synthetic audio
controlled audio–MIDI comparison
Probes
61
note events
pitch and renderer conformance
IV. EVALUATION
The evaluation follows the four checks in the lower box of Fig. 1: transcription, conversion, end-to-end arrangement, and sound rendering. Table III lists the corpus used for each check.
Table 4. SYMBOLIC MIDI RETENTION ON POP909. VALUES ARE MACRO-AVERAGED F1 AND COVERAGE (%) WITH 95% BOOTSTRAP CI.
Corpus
MIDI runs
Melody-transfer F1 (%)
Melody coverage (%)
POP909
909/909
86.2 [84.9–87.5]
79.6 [78.1–81.1]
Table 5. AUDIO-PATH FIDELITY BY CORPUS. EACH RESULT IS MACRO F1 [95% BOOTSTRAP CI]. ARRANGEMENT F1 MATCHES SECTION, ROOM, SLOT, AND MAPPED DEGREE
Corpus
Audio runs
AMT note F1 (%)
Arrangement F1 (%)
URMP
43/44
60.4 [52.8–67.4]
35.6 [28.4–42.7]
BabySlakh
20/20
49.8 [44.6–54.7]
27.4 [21.1–33.6]
A. Protocol
POP909 provides all 909 symbolic pop arrangements with labeled MELODY, BRIDGE, and PIANO tracks [13]. It tests the core arrangement without MuScriptor. URMP supplies 44 duet-to-quintet performances with real mixture audio and aligned note annotations [14]. BabySlakh supplies 20 aligned synthetic mixtures as a controlled diagnostic [15], [16]. URMP and BabySlakh use 30 s from the first reference onset. Their reference-MIDI and audio-derived paths are placed on the same 120-BPM absolute-time grid before target arrangement. Every failure remains in the completion denominator. Table II summarizes the role of each test set.
For matched events m, precision is P=m/n_pred, recall is R=m/n_ref, and F_1=2PR/(P+R), where n_pred and n_ref are the predicted and reference event counts. Corpus results are macro means of item-level F1 values. An AMT note match requires onset agreement within 50 ms and pitch agreement within 50 cents; onset–offset matching also requires offset agreement within the greater of 20% of reference duration and 50 ms, using mir_eval [17]. The arrangement F1 in Table IV compares multisets of section, room, slot, and mapped degree between the reference-MIDI and audio-derived arrangements. This coarse metric summarizes end-to-end structural agreement at the target-notation stage. We also report stricter target onset–pitch, onset–offset–pitch, and target-instrument-conditioned F1. Target events use maximum-cardinality one-to-one matching with a 50-ms onset tolerance and exact target degree plus octave. These are structural diagnostics: they may penalize a musically valid change in melody selection, section-dependent tonal mapping, or intentional ranat–khong layering. They are not listening-quality measures. POP909 also reports labeled-role coverage, omission, pitch/timing displacement, playability, and source-free pitched events.
To separate the stages, AMT compares transcribed notes with annotated reference notes; conversion retention compares represented source-note IDs with the MIDI notes supplied to the arranger. Retention is 100n_retained/n_input; omission is its complement when every input note is accounted for. Thus, omitting 2 of 100 notes is 2%, whereas omitting 2 of 50 is 4%. These are illustrative counts, not experimental results. Layered target parts do not increase the retained source-note count. Intentional omission is distinct from processing failure. Arrangement F1 compares two completed arrangements and is an end-to-end diagnostic, not an isolated conversion-loss percentage or a quantity to subtract from AMT F1. Results describe the frozen evaluation artifacts supplied with this paper, not subsequent interactive development trials.
The two audio paths are independent. The reference-MIDI path is completed even when transcription fails, and the audio-derived path reuses a transcription only when the audio checksum, MuScriptor Medium revision, and decoding settings match. Instrument-aware AMT uses a declared mapping from source labels to GM families; target-instrument-conditioned F1 instead asks whether matched target events use the same Thai instrument. The latter therefore measures target-part agreement in addition to onset and pitch agreement. Canonical test passages cover six instruments, pitch, duration, velocity, articulation, pi continuity, deterministic rerendering, and stem summation. Each corpus is summarized separately by macro mean, median, and a 10,000-resample bootstrap 95% confidence interval. Tables III and IV separate symbolic retention from audio-path fidelity so that each numeric column has one meaning. Completed items over total items make each denominator explicit. Undefined values remain missing.
V. Results and Discussion
AMT unmatched-reference rates (100(1-R); onset–pitch matching) average 39.6% on 43 successful URMP items and 56.0% on 20 BabySlakh items. Separately, conversion intentionally omits 20.4% of labeled melody notes on average over 909 POP909 MIDI inputs. These percentages use different input populations and cannot be added. Table III isolates symbolic-MIDI retention. On POP909, melody-transfer F1 is 86.2% (95% CI 84.9–87.5), and melody coverage is 79.6% (78.1–81.1). The two measures answer different questions: F1 checks whether source melody notes occupy matching room–slot–degree positions, whereas coverage counts how many labeled melody notes are represented. Bridge coverage is 57.7% (95% CI 56.3–59.0), and piano coverage is 14.3% (13.8–14.8). Source-free pitched events and playability violations both have a mean of 0.0. RQ1: On symbolic pop MIDI, the core retains most labeled melody (79.6% coverage, 86.2% F1) but keeps only 57.7% of bridge and 14.3% of piano notes, so supporting material is selectively reduced. Table IV compares the two audio corpora using the same two stage-specific columns. For URMP, AMT note F1 is 60.4% and arrangement F1 is 35.6%; for BabySlakh the values are 49.8% and 27.4%. These F1 values should not be subtracted because their matching rules differ. The notation results instead show how often the complete audio path reproduces the coarser room–slot–degree decisions made from reference MIDI. Mean F1 for target onset–pitch, onset–offset–pitch, and instrument-conditioned matching is 13.8%, 9.6%, and 9.8% on URMP, and 8.4%, 3.6%, and 5.8% on BabySlakh. Agreement decreases when timing, octave, and target instrument must also match. All 44 URMP reference-MIDI paths produced valid musical notation. The audio path completed for 43; one four-player excerpt produced no note events and is retained as a transcription failure. All 20 BabySlakh paths completed. RQ2: Real-audio transcription substantially alters the notation: on URMP, arrangement F1 between the audio-derived and reference-MIDI paths is 35.6%, falling to 13.8% when exact target onset and pitch must match. RQ3: Controlled synthetic audio does not reduce this gap: on BabySlakh, arrangement F1 is 27.4%. Neither result establishes that one arrangement is musically preferable. Across 61 pitched target keys, median and 95th-percentile pitch error is 1.23 and 7.12 cents. Median pi legato-boundary RMS continuity is 0.966, with 0 detected clicks. All probe waveform samples are finite, no clipping is detected, repeated renders are identical, and stems sum to the master. RQ4: Yes. The engines respect notation constraints (median pitch error 1.23 cents, no clipping, no clicks) and rerender identically. This is an engineering conformance result, not a quality judgment.
VI. Limitations
POP909 is symbolic pop, URMP is Western chamber music without percussion, and BabySlakh is synthetic. These corpora do not include matched recordings of the six Thai target instruments, and the study does not include a listening test or assessment by Thai music experts. Objective note and renderer checks therefore cannot establish naturalness, cultural authenticity, or listener preference. Future work should collect licensed target recordings, evaluate Thai and non-Thai repertoire separately, and use Thai musicians and listeners to assess part assignment and sound quality.
VII. CONCLUSION
The proposed system converts audio-derived notes into musical notation and simulated performances for six Thai instruments. For RQ1, symbolic input preserves most labeled melody while selectively reducing supporting parts. For RQ2 and RQ3, audio transcription is the main source of disagreement: arrangement agreement with the reference-MIDI path is 35.6% on real audio and 27.4% on synthetic audio. For RQ4, the renderer is accurate in pitch and fully repeatable. These findings do not establish perceived quality or traditional arranging validity; these require evaluation by Thai musicians.
References
[1] S. Rouard, M. Krause, A. Roebel, C.-J. Simon-Gabriel, and A. Défossez, “MuScriptor: An open model for multi-instrument music transcription.” arXiv:2607.08168, 2026. doi: 10.48550/arXiv.2607.08168.
[2] S. Eambangyung, G. Schwörer-Kohl, and W. Purahong, “Manual conversion of Sadhukarn to Thai and western music notations and their translation into a rhyme structure for music analysis,” Data, vol. 7, no. 11, Art. no. 150, 2022, doi: 10.3390/data7110150.
[3] M. Wisuttipat, “Pimai pipat: Trace of musical culture,” Fine Arts Journal: Srinakharinwirot University, vol. 25, no. 2, pp. 67–82, 2021, Available: https://so01.tci-thaijo.org/index.php/jfofa/article/view/242027
[4] J. Rahn, “‘Equiheptatonic’ tuning in Thai classical music: Strict propriety and step sizes,” Music & Science, vol. 2, 2019, doi: 10.1177/2059204318802505
[5] N. Wisuttipat, “Relative nature of Thai traditional music through its tuning system,” International Journal of Creative and Arts Studies, vol. 2, no. 1, pp. 86–97, 2015, doi: 10.24821/ijcas.v2i1.1441.
[6] Z. Jiang and R. B. Dannenberg, “Melody identification in standard MIDI files,” in Proc. SMC, Málaga, Spain, 2019, pp. 65–71. Available: https://www.cs.cmu.edu/~rbd/papers/melody-identification-midi-smc2019.pdf
[7] F. Simonetta, C. Cancino-Chacón, S. Ntalampiras, and G. Widmer, “A convolutional approach to melody line identification in symbolic scores,” in Proc. ISMIR, Delft, The Netherlands, 2019, pp. 924–931. Available: https://archives.ismir.net/ismir2019/paper/000114.pdf
[8] O. Nieto et al., “Audio-based music structure analysis: Current trends, open challenges, and applications,” Trans. Int. Soc. Music Inf. Retr., vol. 3, no. 1, pp. 246–263, 2020, doi: 10.5334/tismir.54.
[9] S. J. Carlquist, “Piphat ensemble in Bangkok, Thailand.” Botanical Research Institute of Texas, The Portal to Texas History, 1963. Available: https://texashistory.unt.edu/ark:/67531/metapth1673228/
[10] S. Saeng-arun, “Pi Nai,” The Double Reed, vol. 46, no. 1, pp. 53–58, 2023. [Online]. Available: https://www.idrs.org/wp-content/uploads/2023/05/Pi-Nai-rev1_web.pdf
[11] J. O. Smith III, Physical audio signal processing: For virtual musical instruments and audio effects. W3K Publishing, 2010. Available: https://ccrma.stanford.edu/~jos/pasp/
[12] P. Guillemain, “A digital synthesis model of double-reed wind instruments,” EURASIP Journal on Applied Signal Processing, vol. 2004, no. 7, pp. 990–1000, 2004, doi: 10.1155/S1110865704402194.
[13] Z. Wang et al., “POP909: A pop-song dataset for music arrangement generation,” in Proc. ISMIR, 2020, pp. 38–45. Available: https://program.ismir2020.net/static/final_papers/89.pdf
[14] B. Li, X. Liu, K. Dinesh, Z. Duan, and G. Sharma, “Creating a multitrack classical music performance dataset for multimodal music analysis: Challenges, insights, and applications,” IEEE Trans. Multimedia, vol. 21, no. 2, pp. 522–535, 2019, doi: 10.1109/TMM.2018.2856090.
[15] E. Manilow, G. Wichern, P. Seetharaman, and J. Le Roux, “Cutting music source separation some Slakh: A dataset to study the impact of training data quality and quantity,” in Proc. IEEE WASPAA, 2019, pp. 45–49. doi: 10.1109/WASPAA.2019.8937170.
[16] E. Manilow, G. Wichern, P. Seetharaman, and J. Le Roux, “BabySlakh.” Zenodo, dataset, 2019. doi: 10.5281/zenodo.4603844.
[17] C. Raffel et al., “mir_eval: A transparent implementation of common MIR metrics,” in Proc. ISMIR, 2014, pp. 367–372. Available: https://archives.ismir.net/ismir2014/paper/000320.pdf