Logo image
Algorithmic garments: encoding and scanning musical patterns in textile
Thesis   Open access

Algorithmic garments: encoding and scanning musical patterns in textile

Radha Kallahalla
Master of Science (M.S.), Drexel University
Jun 2026
DOI:
https://doi.org/10.17918/00011482
pdf
Kallahalla_Radha_202630.96 MBDownloadView
mpg
Kallahalla_Radha_2026_Suppl1176.87 MBDownloadView
Video (supplemental) This video shows the decoder scanning all six main prototypes in real time Open Access Open Access (License Unspecified)

Abstract

Algorithmic textiles E-textiles Optical decoding Pentatonic scale Thread embroidery Computer Vision Music
This thesis builds and tests a complete pipeline for encoding musical information into a textile structure and recovering it as sound through optical scanning, with no embedded electronics. Visual patterns generated through code carry musical parameters in their geometry, are fabricated onto a physical surface, and are decoded back into music by a computer vision system that reads the textile through a camera. Two patterns were developed in p5.js using wave superposition. Pattern P1 uses the C Major Pentatonic scale; P2 uses the D Minor Pentatonic and adds variable line spacing for note duration and alternating color families for voice assignment across two differently equalized instrument samplers. In both patterns, vertical line position encodes pitch, line thickness encodes rhythm value and velocity, and curvature at the scanned point produces small pitch adjustments and velocity boosts. A toggleable grid overlay generates harmonic dyads at line-grid intersections. The patterns were physically fabricated as 12 x 12 cm samples using thread embroidery, stitched over a printed guide on a felt base, and flat FDM 3D printing in white PLA with a 0.4 mm nozzle, hand-painted after printing. Laser cutting was tested and abandoned because fine upper-register lines were damaged by thermal spread. A directional garment prototype was developed separately in CLO 3D to show what an encoded wearable might look like at body scale, though it was not part of the encode-decode pipeline. A browser-based decoder processes a live webcam feed of each physical sample and outputs music using the same audio engine as the digital sketches. It classifies pixels by HSV hue ranges, maps pitch relative to the detected pattern extent, and applies the same curvature, velocity, and rhythm rules as the original p5.js code. Sixteen scanning sessions were conducted across six main prototypes and two supplementary freehand samples using a fixed five-point scanning protocol. The vertical pitch gradient was preserved in every prototype, and grid-based harmonic encoding survived fabrication across all samples, with dyad intervals consistent with the defined harmony rules for both patterns. Thread embroidery produced a systematic one-step upward pitch shift at the center position, likely due to compression from hand stitching along the paper template. The 3D-printed P1 sample showed high-register anomalies on one scan path, attributed to the 0.4 mm nozzle's minimum width, which produced visually thicker upper lines than the digital source specified. Line thickness and color showed greater degradation across fabrication methods than vertical position did. The results confirm the pipeline is operational and that vertical position encoding is the most durable of the encoded parameters across both fabrication methods. The main limiting factor is fabrication precision rather than anything in the system's design. Access to a digital Jacquard loom or higher-precision cutting equipment would reduce positional and thickness errors associated with hand stitching and FDM printing and enable more rigorous testing of the remaining encoded parameters. Supplementary Material: A video compilation is included as a supplementary file. It shows the decoder scanning all six main prototypes in real time: the digital P1 and P2 baselines, the thread-embroidered samples, and the 3D-printed samples, all with and without grid mode, as well as the two freehand unencoded prototypes. The video demonstrates how the musical output changes across fabrication methods and scan paths. Keywords: algorithmic textile, e-textiles, wave superposition, pentatonic scale, computer vision, FDM 3D printing, thread embroidery, optical decoding, p5.js, Tone.js.

Metrics

6 File views/ downloads
6 Record Views

Details

Logo image