# Blues / Ragas / Maqam Microtonal Pitch-Bend Tutor — MIDI 2.0, MPE and Scala .scl Encodings

Map world tunings — 7-limit just blues, Arabic maqamat (Rast/Bayati/Hijaz/Saba) on 24-EDO quarter tones, the 22-shruti table, gamelan slendro/pelog, 31-EDO, 53-EDO and the A440 harmonic grid — onto nearest-note + RPN fine tuning, MPE 14-bit bends at ±2/±24/±48/±96 semitones, MIDI 2.0 32-bit pitch bend, the MIDI 2.0 Pitch 7.9 note attribute, and a Scala .scl export.

> Canonical page: https://elysiatools.com/en/tools/blues-ragas-modes-microtonal-pitch-bend-midi-2-and-maqam-tuning-tutor

- **Category:** Media

- **Keywords:** microtonal, pitch bend, MIDI 2.0, MPE, maqam, shruti, raga tuning, gamelan slendro pelog, just intonation, 31-EDO, 53-EDO, scl file

## Overview

Encoding rules: every degree snaps to its nearest MIDI note; the deviation is expressed as (a) RPN 1 fine tuning (±100 cents over 14 bits, ≈0.0061 ¢/LSB — per-note under MPE because each note owns a channel); (b) an MPE 14-bit bend = 8192 × deviation-semitones ÷ bend-range (the MPE specification defaults to ±48 semitones per note and ±2 on the master channel, set via RPN 0); (c) a MIDI 2.0 32-bit pitch bend scaled from the 0x80000000 centre over the same range (the field is 32-bit — not 64-bit as sometimes quoted); (d) the MIDI 2.0 Note On attribute type 1 “Pitch 7.9”, an unsigned 7-bit semitone + 9-bit fraction fixed point (512 LSB per semitone), encoded from the note at or below the target. Shruti ratios follow Thakur (2015); maqamat are quantized to the Arabic 24-EDO system (live performance is freer); gamelan tunings differ per ensemble and the table gives survey approximations; the A440 grid uses cents = 1200·log₂(n/8). The .scl export follows the Huygens-Fokker format (implicit 1/1, ratio or cents lines, period last).

## Inputs

- **Tuning system** (select)
- **Root MIDI note (21-108)** (number): 60
- **A4 reference (Hz)** (number): 440
- **MPE pitch bend range (± semitones)** (select)
- **Write downloadable .scl file** (checkbox)

## When to use

- Mapping non-12-TET world music scales or just intonation systems to standard MIDI synthesizers, MPE controllers, and MIDI 2.0 engines.
- Calculating exact pitch bend offsets and RPN fine-tuning parameters to accurately perform quarter tones, shrutis, or microtonal intervals in a DAW.
- Generating and exporting microtonal scale definition files (.scl) formatted to Huygens-Fokker standards for virtual instruments.

## How it works

- Select a tuning system, such as 7-limit blues, 24-EDO maqamat, 22 shrutis, gamelan surveys, EDO divisions, or the A440 harmonic series.
- Set the root MIDI note (21–108), the reference frequency for A4 in Hertz, and the pitch bend range (±2, ±24, ±48, or ±96 semitones).
- Inspect calculated pitch deviations displayed as nearest MIDI notes, RPN 1 fine tuning, MPE 14-bit bends, MIDI 2.0 32-bit bends, and Pitch 7.9 fixed-point note attributes.
- Download a Huygens-Fokker compatible Scala .scl file containing the scale description, degree count, and explicit pitch ratios or cent values.

## Use cases

- Configuring MPE synthesizers with per-note pitch bends to play authentic 24-EDO maqam quarter-tone melodies.
- Setting up fine-tuning tables and MIDI 2.0 Pitch 7.9 attributes for Hindustani 22-shruti and just intonation ragas.
- Exporting Scala .scl files to retune software synthesizers to gamelan slendro, pelog, 31-EDO, or 53-EDO tuning systems.

## Frequently asked questions

### How are microtonal pitches encoded for MIDI 1.0 and MPE?

Each pitch snaps to the nearest standard MIDI note, with remaining cents deviation expressed as RPN 1 fine-tuning or 14-bit pitch bend messages scaled to the selected bend range.

### What is the MIDI 2.0 Pitch 7.9 attribute format?

It is an unsigned fixed-point note attribute using a 7-bit semitone value and a 9-bit fractional part (512 LSB per semitone), measured from the note at or below the target pitch.

### How is the MPE pitch bend value calculated?

The 14-bit bend value is computed as 8192 multiplied by the semitone deviation divided by the pitch bend range, offset from the center value 0x2000.

### What format does the exported tuning file use?

It generates a standard Huygens-Fokker Scala (.scl) file with scale metadata, interval counts, and exact fractional ratios or cent values with an implicit 1/1 root.

### How are Arabic maqam scales represented?

Maqamat such as Rast, Bayati, Hijaz, and Saba are mapped according to the theoretical 24-tone equal temperament (24-EDO) quarter-tone system.

## Related tools

- [MIDI 1.0 / MIDI 2.0 UMP Universal MIDI Packet, Channel Voice 2.0, SysEx 7/8-bit Wire-Protocol Decoder & Byte Counter](https://elysiatools.com/en/tools/midi-1-0-midi-2-0-ump-universal-midi-packet-cib-channel-voice-2-0-sysex-7-bit-8-bit-byte-counter): Decode a MIDI 1.0 bytestream (status bytes, running status, System Common / Real Time, System Exclusive) or a MIDI 2.0 Universal MIDI Packet stream — message types 0x0 Utility, 0x1 System, 0x2 MIDI 1.0 Channel Voice, 0x3 SysEx 7-bit, 0x4 MIDI 2.0 Channel Voice with 16-bit velocity and the 7.9 pitch attribute, 0x5 SysEx 8-bit / Mixed Data, 0xD Flex Data, 0xF UMP Stream — with per-packet field tables, byte/word/packet counts, reserved-field validation, SysEx continuation state machines, and MIDI 1.0 ⇄ UMP translation.
- [Podcast Chapter Marker Builder](https://elysiatools.com/en/tools/podcast-chapter-marker-builder): Build every podcast chapter format from one timecoded list: Podcasting 2.0 JSON + RSS tag, ID3v2.4 CHAP+CTOC burned into an MP3, Vorbis comments, mp4chaps, YouTube timestamps and SRT, with a per-player support matrix.
- [Chord Progression Roman Numeral Visualizer](https://elysiatools.com/en/tools/chord-progression-visualizer): Analyze a chord progression by key, Roman numerals, harmonic function, transposition, and cadence clues.
- [Audio Filler Word Removal Map](https://elysiatools.com/en/tools/audio-filler-word-removal-map): Combine a timestamped transcript with the audio to mark filler words (um, uh, 嗯, 那个…) and optionally mute or remove them.
- [Audio Melody Contour Extractor](https://elysiatools.com/en/tools/audio-melody-contour-extractor): Extract a dominant melody path from audio and export MIDI, note events, a pitch contour, SVG, and JSON in one ZIP.
- [Audio Vocal Range Finder](https://elysiatools.com/en/tools/audio-vocal-range-finder): Estimate the lowest and highest stable sung notes from an audio recording.
- [Convert Raw Pixel Buffer to JPEG](https://elysiatools.com/en/tools/raw-to-jpg): Convert a headerless raw pixel buffer file to a JPEG image. You must provide the image dimensions, channel count, and bit depth.
- [Convert Raw Pixel Buffer to PNG](https://elysiatools.com/en/tools/raw-to-png): Convert a headerless raw pixel buffer file to a PNG image. You must provide the image dimensions, channel count, and bit depth.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [MIDI Viewer Samples](https://elysiatools.com/en/samples/midi-viewer-samples): Sample MIDI file for the in-browser MIDI Viewer
- [Scala Language Samples](https://elysiatools.com/en/samples/scala): Essential Scala programming examples and functional programming concepts
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
