Add Rhythm
In this tutorial, you'll learn to work with timing and duration to create rhythmic patterns.
Objective
Create a simple rhythmic melody using different note lengths.
Prerequisites
- Completed Build a Major Scale
- Understanding of beat-based timing
Understanding Time in RMT
Time in RMT Compose is based on:
| Property | Description | Unit |
|---|---|---|
| tempo | Beats per minute | BPM |
| startTime | When a note begins | Seconds |
| duration | How long a note plays | Seconds |
Beat Duration Formula
// Duration of one beat in seconds
beatDuration = 60 / tempo
// In RMT expression (preferred shorthand):
beat(base)
// Or equivalently:
60 / tempo(base)At 120 BPM: 60/120 = 0.5 seconds per beat
Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote))Note Duration Reference
| Note | Beats | Expression |
|---|---|---|
| Whole | 4 | beat(base) * 4 |
| Half | 2 | beat(base) * 2 |
| Quarter | 1 | beat(base) |
| Eighth | 0.5 | beat(base) * (1/2) |
| Sixteenth | 0.25 | beat(base) * (1/4) |
| Dotted quarter | 1.5 | beat(base) * (3/2) |
| Triplet | 1/3 | beat(base) * (1/3) |
Step 1: Set Up the BaseNote
- Open RMT Compose
- Click the BaseNote (orange circle)
- In the Variable Widget, scroll down to the bottom and click "Clean Slate" to remove all notes except the BaseNote
- Verify the BaseNote settings are what you want:
- frequency: e.g.
440(A4) - tempo: e.g.
120(120 BPM)
- frequency: e.g.
Step 2: Create the Beat Duration Helper
First, understand the beat duration expression:
// This expression equals one beat duration
beat(base)We'll use this as the base for all durations.
Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote))Step 3: Create a Rhythmic Pattern
Let's create: Quarter - Eighth - Eighth - Half
Note 1: Quarter Note
- With the BaseNote selected, in "Add Note / Silence" section, select "Note", click "Create Note"
- Select the new note and set Frequency:
base.f(root) - StartTime:
base.t - Duration (1 beat):
beat(base)Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote))Note 2: First Eighth Note
- Add note after Note 1 (select Note 1, use "At End")
- Frequency:
base.f * (9/8)(Re) - StartTime:
[1].t + [1].d - Duration (0.5 beats):
beat(base) * (1/2)Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote)).mul(new Fraction(1, 2))Note 3: Second Eighth Note
- Add note after Note 2 (select Note 2, use "At End")
- Frequency:
base.f * (5/4)(Mi) - StartTime:
[2].t + [2].d - Duration (0.5 beats):
beat(base) * (1/2)Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote)).mul(new Fraction(1, 2))Note 4: Half Note
- Add note after Note 3 (select Note 3, use "At End")
- Frequency:
base.f * (3/2)(Sol) - StartTime:
[3].t + [3].d - Duration (2 beats):
beat(base) * 2Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote)).mul(new Fraction(2))Verification
- Click Play
- You should hear: short - quick quick - looong
- Total duration: 1 + 0.5 + 0.5 + 2 = 4 beats (one measure at 4/4)
Visual Check
In the workspace:
- Note 1 is medium width
- Notes 2 and 3 are half as wide
- Note 4 is twice as wide as Note 1
Using Duration Quick Controls
Instead of typing expressions, use the Variable Widget duration presets:
Select a note
Find the duration row
Click the note-length icon buttons:
- Whole note (4 beats)
- Half note (2 beats)
- Quarter note (1 beat)
- Eighth note (1/2 beat)
- Sixteenth note (1/4 beat)
Use the dot buttons (
.or..) for dotted notes:- Single dot = 1.5× duration
- Double dot = 1.75× duration
Exercises
Exercise 1: Different Tempo
- Change BaseNote tempo to
60(60 BPM) - Play - the rhythm is the same but slower!
- The relationships are preserved
Exercise 2: Syncopation
Create an off-beat accent:
- Make Note 2 start half a beat late
- Make Note 1 duration 1.5 beats
- Overlap creates syncopation
Exercise 3: Triplets
Create triplet rhythm (3 notes in the space of 2):
// Triplet duration (1/3 of a beat)
beat(base) * (1/3)Legacy JavaScript syntax
new Fraction(60).div(module.findTempo(module.baseNote)).mul(new Fraction(1, 3))Exercise 4: Rest Simulation
Create the effect of a rest:
- Make a note's duration shorter than the gap before the next note
- Or: create a silent note (set a very low frequency that won't be heard)
Chaining Rhythms
For complex rhythms, use note references:
// Note 5 starts when Note 4 ends
[4].t + [4].dThis creates a chain where timing flows automatically.
Legacy JavaScript syntax
module.getNoteById(4).getVariable('startTime')
.add(module.getNoteById(4).getVariable('duration'))Save Your Module
- Menu > Save Module
- Name it
rhythmic-pattern.json
What You Learned
- How tempo, startTime, and duration relate
- Creating different note lengths
- Chaining notes for sequential rhythm
- Using quick controls for duration
Next Steps
- Note Dependencies - Create smarter timing chains
- Working with Measures - Add measure structure
- Combine rhythm with chords for fuller arrangements