How to Program MIDI: Complete Guide to Piano Roll & Drum Patterns
What Is MIDI Programming — and What Beginners Actually Want to Know
Most people searching for "how to program MIDI" are really asking: "Can I make music without knowing how to play an instrument?" and "Which software do I even use?" This guide answers both questions directly.
The short answer: you absolutely can learn MIDI programming without any instrumental background. All you need is a DAW (or a browser-based tool) and a basic understanding of the piano roll. By the end of this article, you'll be able to: ① enter a melody line, ② program a chord progression, and ③ build a drum pattern — all on your own.
MIDI Basics: What You Need to Know Before You Start
What Is MIDI — and How Is It Different from Audio?
MIDI stands for Musical Instrument Digital Interface. It's a data format that records performance information — which note was played, how hard, and for how long.
Unlike audio files such as MP3 or WAV, which store actual sound waveforms, MIDI is more like sheet music — it contains instructions, not sound. This gives you two major advantages: you can change the tempo without any loss in audio quality, and you can swap out instruments freely at any time.
What You Need to Get Started
- A DAW (Digital Audio Workstation): GarageBand (free on Mac/iOS), Cakewalk by BandLab (free on Windows), Reaper (paid), or a browser-based option
- A sound source (instrument plugin): Software instruments in VST or AU format, your DAW's built-in sounds, or GM/SoundFont (SF2) libraries
- A MIDI keyboard (optional): Handy to have, but you can do everything with just a mouse
If you'd rather skip the setup entirely, LA Studio's browser-based MIDI editor and piano roll lets you start programming right now — no installation required.
How to Use the Piano Roll: Core Operations
Understanding the Piano Roll Layout
The piano roll is a visual MIDI editor where the vertical axis represents pitch and the horizontal axis represents time — essentially a keyboard laid on its side.
- Vertical axis (Y-axis): Higher notes at the top. Pitch names like "C4 (middle C)" and "A4 (440 Hz)" are labeled on the left
- Horizontal axis (X-axis): Time flows left to right, with a grid showing bars and beats
- Notes (colored blocks): The left edge marks when the note starts, the width indicates its duration, and the vertical position indicates its pitch
- Velocity (bar graph at the bottom): Represents how hard each note is struck, on a scale of 1 to 127
Adding, Deleting, and Moving Notes
- Add a note: Select the pencil tool and left-click anywhere in the piano roll to place a note
- Resize a note: Drag the right edge of a note to make it longer or shorter. Notes snap to the grid (quarter notes, eighth notes, etc.) automatically
- Move a note: Switch to the selection tool (arrow) and drag the note up/down to change its pitch or left/right to shift its timing
- Delete a note: Use the eraser tool or select the note and press Delete
- Copy and paste: Drag to select multiple notes, copy (Ctrl+C), and paste (Ctrl+V) to duplicate patterns quickly
Quantize: Snapping Notes to the Grid
Quantize is a feature that automatically corrects note timings to the nearest grid position — perfect for cleaning up anything that landed slightly off.
- Setting the quantize value to "1/16" aligns everything to the nearest sixteenth note
- Full quantization can sound robotic, so combine it with a humanize function (which adds subtle random variations) to keep things feeling natural
Programming Melodies and Chords: Step-by-Step
How to Enter a Melody (Step Input)
Rather than recording in real time, beginners are better off using step input — placing notes one at a time with the mouse. It's slower but far more precise.
- Create a new MIDI track in your DAW and assign an instrument (e.g., piano)
- Open the piano roll and set your snap to "1/8" (eighth notes)
- Left-click at beat 1 on the C4 row to place your first note
- Continue placing notes — E4, G4, and so on — to build your melody
- To change a note's length, drag its right edge. To make it a whole note, stretch it to fill four beats
- Hit play to check how it sounds, and adjust anything that feels off
How to Program Chord Progressions
Chords are created by stacking multiple notes at the same horizontal position. For a C major chord, place C4, E4, and G4 all starting at the same beat.
- C Major: C – E – G
- G Major: G – B – D
- A Minor: A – C – E
- F Major: F – A – C
The classic pop progression I–V–vi–IV (C – G – Am – F) is built from exactly these four chords, one per bar. Once you've programmed them, loop the sequence to create a backing track foundation.
How to Program Drums in the Piano Roll
Understanding the MIDI Drum Map
The trickiest part of programming drums is figuring out which MIDI note triggers which drum sound. Under the GM (General MIDI) standard, the assignments are:
- C1 (note 36): Bass drum (kick)
- D1 (note 38): Snare drum
- F#1 (note 42): Closed hi-hat
- A#1 (note 46): Open hi-hat
- A1 (note 45): Low tom
- C2 (note 48): Mid tom
- A2 (note 57): Crash cymbal
Many DAWs include a dedicated drum map view that displays instrument names like "Kick" and "Snare" instead of note names. For a full reference, see the General MIDI standard on Wikipedia.
Building a Basic 4/4 Drum Pattern
It helps to think of a 4/4 bar in terms of 8 steps (eighth notes) or 16 steps (sixteenth notes). A classic rock beat looks like this:
- Kick drum: Place on beats 1 and 3 (C1 row)
- Snare: Place on beats 2 and 4 (D1 row)
- Hi-hat: Place on every eighth note — eight evenly spaced notes across the bar (F#1 row)
Just those three elements give you a solid, functional rock beat. From there, you can add tom fills and sixteenth-note hi-hat patterns to build more dynamic grooves.
Adjusting Velocity for a More Human-Sounding Kit
If your programmed drums sound robotic, the culprit is almost always identical velocity values on every note. Real drummers never hit with exactly the same force twice.
- Vary hi-hat velocities irregularly — something like 80, 90, 75, 95 across consecutive hits
- Set accented notes (like downbeats) to around 100–120, and weaker hits to 60–80
- Most DAWs have a randomize velocity function that can add natural variation automatically
3 Tips to Level Up Your MIDI Programming
1. Import Existing MIDI Files and Study Them
There are thousands of free MIDI files available online. Load a song you love into your DAW and study how the chords are voiced, how drum velocities are shaped, and how the arrangement is structured. It's one of the fastest ways to improve. Sites like BitMidi offer a large library of free downloads.
2. Match Your BPM and Snap Settings to the Track
A lot of frustration in MIDI programming comes down to incorrect snap settings. If you're trying to place sixteenth-note phrases but your snap is set to "1/4" (quarter notes), the notes won't land where you want them. Get in the habit of setting your snap to "1/8", "1/16", or "1/32" depending on how fine the details are.
3. Start with a Short Loop and Perfect It
Don't try to write a full song on day one. Instead, focus on completing one solid two-bar loop. A drum pattern, a chord progression, and a one-phrase melody — that's genuinely enough to sound like music. You can refine and expand everything later.
Free Tools for MIDI Programming: A Quick Comparison
Here's a look at the most popular free options:
- GarageBand (Mac/iOS): The go-to for Apple users. Intuitive interface with a built-in step sequencer. Not available on Windows
- Cakewalk by BandLab (Windows): A formerly paid, professional-grade DAW that went completely free. Includes a full-featured piano roll and drum grid editor
- LMMS (Windows/Mac/Linux): A cross-platform free DAW with a visual beat editor that's great for beginners
- LA Studio (browser): A fully browser-based DAW — no installation needed. Includes a piano roll, MIDI editor, and support for SoundFont (SF2) and GM sounds. Free to use with no sign-up required
If you want to jump in right now without installing anything, LA Studio's editor runs entirely in your browser.
Frequently Asked Questions
Q: Can I program MIDI without a MIDI keyboard?
A: Absolutely. Mouse-based step input in the piano roll works perfectly well on its own. A MIDI keyboard is useful for real-time recording, but it's not required — especially when you're starting out. Begin with mouse input and add a keyboard later if you want to.
Q: Do I need drumming experience to program drum parts?
A: Not for basic patterns. The kick-on-1-and-3, snare-on-2-and-4, eighth-note hi-hat formula is all you need to produce beats that work in pop and rock. When you're ready to write more complex fills or syncopated rhythms, watching real drumming performances online is a great way to pick up ideas fast.
Q: Why does my MIDI playback sound out of time?
A: There are two likely causes: ① notes haven't been quantized and are sitting slightly off the grid, or ② the BPM doesn't match what you intended. Try applying 1/16 quantize to your notes and double-check your tempo setting. If you're using your computer's built-in audio output rather than an audio interface, latency (playback delay) could also be a factor.
Q: How do I enter chords in the piano roll?
A: Just stack multiple notes vertically at the same horizontal position. For a C major chord, place C4, E4, and G4 all starting at beat 1. You can click to add each note on top of the others. A quick workflow: place one note, then copy it and change the pitch, or Shift-click to add notes without deselecting what's already there.
Q: Can I export my MIDI programming as an MP3 or audio file?
A: Yes. Use your DAW's export or bounce function to render the project as WAV or MP3. Keep in mind that MIDI itself contains no audio — the sound comes from whichever instrument plugin or sample library you've assigned. The quality of your export depends heavily on the quality of those sounds, so choosing good instruments matters.
Wrap-Up: Start Simple, Build from There
The most important principle in MIDI programming is not trying to be perfect from day one. Learn the core piano roll operations (placing, moving, and resizing notes), build one basic kick-snare-hi-hat drum pattern, and program a four-chord backing. Those three steps alone give you a complete musical skeleton.
Velocity nuances, drum fills, and advanced chord voicings can all come later — once the fundamentals feel natural. A great first exercise: try recreating just the first four bars of a song you love.
If you want to start experimenting right now without installing anything, LA Studio's browser-based DAW is ready to use instantly — no account or download needed.