Show HN: Modest – musical harmony library for Lua

This is a project I've been building in my spare time over the past few months. It's a library that provides methods for working with musical harmony ‒ intervals, notes, chords. For example, it can parse almost any chord symbol (Fmaj7, CminMaj9, etc) and turn it into notes, or it can identify a chord from a given set of notes.

I started this project with the idea of using formal grammar to parse chord symbols. I wanted to use it instead of a hand-written parser, which is the common approach among similar libraries. Lua caught my attention because of Lpeg, a Parsing Expression Grammar library that is both fast and easy to use. An additional motivation for using Lua was the lack of comparable libraries for it, even though the language is commonly used in audio programming.

However, despite being a Lua library, the project itself is written in Fennel — a "lispy" language that transpiles to Lua. Fennel has features that make writing code for the Lua platform much more pleasant: a concise syntax, macros, and destructuring — a feature Lua sorely lacks!

In the process, I definitely learned a lot about music theory, although my new knowledge is quite one-sided. By working on this library, I know a thing or two about types and structure of chords, but I learned almost nothing about their composition and transformation. Perhaps these will be the directions I explore next in the project.


Comments URL: https://news.ycombinator.com/item?id=42907765

Points: 18

# Comments: 2

https://github.com/esbudylin/modest

Létrehozva 25d | 2025. febr. 2. 13:10:08


Jelentkezéshez jelentkezzen be

EGYÉB POSTS Ebben a csoportban

Goodbye K-9 Mail
2025. febr. 27. 20:30:17 | Hacker news
Show HN: Ranked Search for Semi-Structured Data

We’ve been working on a search problem that requires querying both text and numbers simultaneously. For example, in a dataset of clothing items with descriptions and prices, a search for “slim pan

2025. febr. 27. 20:30:16 | Hacker news
Show HN: Wampy, interface addon for Linux-based Walkmans

Wampy is an interface addon for modern Linux-based Walkmans, which allows you to switch between standard interface and custom one using hardware Hold switch.

The project was born out of handful

2025. febr. 27. 20:30:14 | Hacker news
Show HN: Compiler Playground for energy-efficient embedded dataflow processor

Hi HN! My team at Efficient Computer (https://efficient.computer) and I are working on a new computer architecture and I am leading the team

2025. febr. 27. 20:30:13 | Hacker news