تنغيم

TANGHIM

A hardware instrument for Arabic maqām music

The Tanghim prototype seen from the front on black sand, powered: record red, play green, sequencer steps gold and cyan, three keyboard controls purple, the navigation buttons and the slider stars in yellow, cyan and green
Tanghim from the rear, angled: USB-C, the six CV and gate jacks, MIDI in, out and thru, and the four 6.35 mm audio jacks, the panel lit behind them
The rear: USB-C, CV and gate, MIDI, audio. Renders of the prototype's 3D model; the lights are an illustration (record red, play green, steps in gold and cyan, keyboard controls purple): nothing has run on the instrument yet.

تنغيم, tanghīm: giving a voice its melody. An instrument that plays the maqāmāt in their own tunings, with a step sequencer, a keyboard, sliders that tune and a small screen.

Prototype in development · nothing manufactured yet

The drawings

The front and the rear

Hidden-line drawings of the current prototype, from its 3D model. The 3D viewer shows it from every side, in each of its boxes.

The front

the panel, the headphones and the card slot
Tanghim, the front: outline drawing (MX + TL16, pla_mix box, keycap Option 1 Flat) Tempo · Volume RV16 tempo, RV15 volume (Alps RK09K, 9 mm) LED windows an RGB LED under each star: visual feedback for the sliders 8 sliders 45 mm, centre detent (RV1 - RV8): tuning and sequencer notes 6 control knobs RV9 - RV14 Function · Patterns the left column's upper keys: SW17 function, SW18 patterns Record · Play SW19 record, SW20 play (Cherry MX, RGB LED per key) Phones 3.5 mm headphone output, front Sequencer / keyboard 8 x 2 16 Cherry MX keys (SW1 - SW16), an RGB LED in each OLED screen 1.54 in, 128 x 64 (SSD1309) 6 encoders ENC1 - ENC6, push to click 6 navigation buttons control / navigation: Lakeview TL16 RGB (SW25 - SW30) 6 keyboard controls keyboard / sequencer: octave up / down; the others to be defined microSD card slot, front

The rear

audio, MIDI, CV and gate, USB-C
Tanghim, the rear: outline drawing (MainMXTL16TRS, pla_mix box) USB-C USB-C 5 V power in, USB MIDI and data CV IN GATE IN CV OUT 1 GATE OUT 1 CV OUT 2 GATE OUT 2 CV / gate 6 mini jacks, 3.5 mm: CV and gate, in and out IN OUT THRU MIDI IN / OUT / THRU, 3.5 mm TRS, type A OUT L OUT R IN L IN R Audio 4 x 6.35 mm (Neutrik NMJ6HCD2): stereo out L / R, stereo in L / R

The instrument

Everything on the panel is for playing

Tanghim is a desktop instrument in a box of 250 × 176 mm (the panel). Its sliders set the tuning of each degree and the notes of the sequencer, with a light under each one to show where it stands; its keys play and step through patterns; its knobs shape the sound; its screen shows where you are. At the rear it speaks to the studio: audio, MIDI, CV and gate, USB.

On the panel

  • 16 keys in 2 × 8 · the sequencer and the keyboard, a light in each
  • Function · Patterns · Record · Play
  • 6 keyboard controls · octave up and down, and more
  • 8 sliders · tuning and sequencer notes, an RGB light under each
  • 6 control knobs · Tempo · Volume
  • 6 encoders and 6 navigation buttons
  • A 1.54 in screen, 128 × 64

At the rear

  • Audio · stereo out and stereo in, 6.35 mm jacks
  • MIDI · in, out and thru, 3.5 mm TRS (type A)
  • CV and gate · in and out, six 3.5 mm jacks
  • USB-C · power, and USB MIDI with a computer

At the front

  • Phones · 3.5 mm headphone output
  • microSD · the card slot

TanghimOS

The software inside the instrument

TanghimOS is Tanghim's own software: the maqām theory at its heart, the sound engines, the sequencer, MIDI and the screen's interface, written in C++ for the instrument. The same core is tested on a computer, against reference answers, before it plays a note.

The maqām engine

  • 28 historical tuning systems · from al-Mawṣilī (850), al-Kindī and al-Fārābī to al-Ṣabbāgh and Allami (2025)
  • 145 maqāmāt and 44 ajnās · their ascending and descending forms
  • Transposition that keeps each tuning's own intervals
  • Modulation, and 193 suyūr · the melodic paths of al-Shawwā, al-Ḥilū and al-Ṣabbāgh

Playing and the studio

  • A step sequencer · patterns and Euclidean rhythms
  • MIDI in and out · the maqām's tuning sent to other instruments: MPE, MIDI Tuning Standard, pitch bend
  • A screen that speaks Arabic and Latin

Our sound: physical modelling

The heart of our own work: instruments of the maqām rebuilt as physics, strings, bodies and pipes, tuned by the maqām itself.

Watarوتر

The oud · strings and body

Our research on the oud: the risha plucks paired strings, digital waveguides, while six open courses ring in sympathy, all through the body of a real oud: its recorded impulse response, and resonators set from the measured modes of an oud soundboard.

Built and heard on the computer.

Kasabقصب

The pipe · reeds and bores

Pipes and reeds modelled as air columns: the wind instruments of the maqām as physical models, beside the strings of Watar.

In research.

The building blocks

Strings, tubes, resonating bodies

Digital waveguides, Karplus-Strong strings and modal resonators: the parts the engines are made of, each playing the maqām's own pitches, never rounded to twelve equal steps.

FM on the tanghīm

Ratios from the tuning

FM synthesis whose operator ratios come from the tuning itself: the intervals of the maqām become the timbre's harmonics.

Processing

Proposed for every engine

Filter · reverb · delay · chorus · sample-rate and bit reduction · distortion.

Built on DiArMaqAr

Tanghim's knowledge of the maqām comes from DiArMaqAr, the Digital Arabic Maqām Archive, by Dr. Khyam Allami with Ibrahim El Khansa at the Music Intelligence Lab, American University of Beirut.

The data is theirs. The tuning systems, ajnās, maqāmāt and suyūr that Tanghim plays are DiArMaqAr's, read from their archive, with the sources it documents for each one.

The code is ours. Their algorithms (the pitch tables, the transpositions, the modulations) inspired TanghimOS's maqām engine: we studied them and wrote our own from scratch, in C++, for the instrument. No line of DiArMaqAr's code is in Tanghim. We check our engine against DiArMaqAr's own answers.

What we add. The instrument around the theory: the sound engines above, from the physical modelling of the oud and the pipe to FM on the tuning, the sequencer, and playing the maqām live, on keys, sliders and MIDI.

DiArMaqAr's data is published under CC BY-NC-SA 4.0; the tables Tanghim derives from it keep that licence.

In development. TanghimOS runs in our tests on a computer; it has not yet run on the instrument.

Words

واعلم أن كل صوت له نغمة وصفية وهيئة روحانية، خلاف صوت آخر، وأن الهواء من شرف جوهره ولطافة عنصره يحمل كل صوت بهيأته وصفته، ويحفظها لئلا يختلط بعضها ببعض، … إلى أن يبلغها إلى أقصى مدى غاياتها عند القوة السامعة، لتؤدّيها إلى القوة المتخيلة … وذلك تقدير العزيز الحكيم

— إخوان الصفا وخلّان الوفاء

“Know that every sound has its own tone, its own quality and a spiritual form, unlike any other sound; and that the air, by the nobility of its substance and the subtlety of its element, carries each sound with its form and its quality, and keeps them so that they do not mix with one another … until it brings them to the farthest reach of their course, at the faculty of hearing, which passes them on to the faculty of imagination … That is the decree of the Mighty, the Wise.”

The Brethren of Purity (Ikhwān al-Ṣafāʾ), Rasāʾil, 10th century. English: our translation.