TIGA ALPHABlog

← All articles

How Music AI Reads Notes: Tokens, Events and Representations

News ·

How Music AI Reads Notes: Tokens, Events and Representations

Language models work with tokens, small units of text such as words or parts of words. Many music AI systems work the same way, but music is not naturally a sequence of words. It has pitch, duration, loudness, timing, multiple voices and simultaneous notes. Before a model can learn from music, designers must decide how to turn it into a sequence of tokens. This step, called representation or tokenisation, has a large influence on what the model can learn and generate.

Why representation matters

A representation decides what information is kept and what is lost. If the tokens ignore dynamics, the model cannot learn about loudness. If timing is rounded to a grid, expressive rubato disappears. If chords are split into separate notes without a clear link, the model may struggle with harmony. Choosing a representation is like choosing a notation system: it shapes what can be expressed.

Common symbolic representations

Piano-roll grids

Music is divided into small time steps, and for each step the representation records which keys are pressed. This is simple and visual but creates long sequences with many empty steps.

Event-based tokens

Music is described as a series of events, such as "note on C4", "time shift 120 milliseconds", "velocity 64" and "note off C4". This captures expressive timing and dynamics and is widely used for performance modelling.

Bar and beat tokens

Some systems add tokens for bar lines and beat positions, helping the model learn metre and phrase structure.

Compound tokens

Several attributes, such as pitch, duration and velocity, are grouped into one combined token, shortening sequences.

Text-like notations

Some systems use compact text formats similar to folk-tune notations, which describe melodies with letters and symbols.

Dark ink-wash grand piano with the lid open

Audio representations

When models work with sound directly, representations differ. Audio may be converted into spectrograms, which show how frequencies change over time, or compressed into discrete codes by a neural audio codec. These codes act as tokens for audio generation models. Audio representations capture timbre and production details but make it harder to reason about individual notes.

Trade-offs designers consider

  • sequence length: finer detail means longer sequences, which require more computation
  • expressiveness: event-based tokens capture nuance but can be harder to edit or interpret
  • structure: bar and beat tokens help with form but may impose a rigid grid
  • instrument handling: multi-instrument music needs tokens to indicate which part each note belongs to

No single representation suits every purpose; each fits different goals. A system for generating lead sheets needs different detail from one that models a concert performance, and designers often test several formats before settling on one.

What this means for musicians

Understanding representations helps musicians interpret what AI tools can do. A tool built on grid-based data may produce rhythmically rigid results. One trained on performance events may capture expressive timing but struggle with notation. When a tool's output feels mechanical or loses certain details, the cause may lie partly in how the music was represented.

Representation and practice tools

Practice tools also rely on representations. When a digital piano sends MIDI data, each key press is recorded as an event with pitch, velocity and time. This detailed information allows feedback on timing and dynamics. With acoustic pianos, audio must first be converted into note events, which introduces some uncertainty.

A classroom activity

Teachers can show representation choices by writing a short melody in three ways: standard notation, a grid of boxes for each time step, and a list of events with note names and durations. Students can discuss what each format makes easy or hard to see. This builds understanding of both notation and AI concepts.

TIGA ALPHA uses note events from a connected digital piano, such as pitch, timing and velocity, to give learners feedback that reflects how each note was actually played.

FAQ

Q: What is a token in music AI?

A: A small unit, such as a note event or time shift, that a model processes in sequence.

Q: Why do representations matter?

A: They decide what musical information a model can learn, such as dynamics, timing or harmony.

Q: What is an event-based representation?

A: A sequence of events like note on, note off, velocity and time shift, capturing expressive performance.

Q: Do audio models use tokens too?

A: Many do, using codes produced by neural audio codecs or features derived from spectrograms.

Get started with TIGA ALPHA

TIGA ALPHA is an AI piano teaching app built by a Thai team, with lessons in 10 languages: Thai, English, Mandarin, Arabic, Japanese, Russian, Spanish, French, Hindi and Korean. Its CEO, Teacher Aum, has 20 years of experience in piano teaching, and that music teaching background shapes every lesson, while piano teaching with AI gives you feedback each time you play piano. Use it as an online piano lessons app for short daily sessions, follow it as a complete AI online piano course, or combine it with a piano course or piano learning course led by a teacher. Whether you want to learn piano from zero, learn piano online after a long break, learn music alongside your children or simply play music for fun, this online piano teaching application keeps your next step clear. New users get a 7-day free Premium trial, then US$24.99/month. Open the piano teaching app below and pick a first lesson that fits your week.

The way music is written down for a machine quietly decides what that machine can notice, so representation is where musical knowledge first enters an AI system.

Start learning free on TIGA ALPHA