lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Dear Bruno,

I think Lua is a good choice for such a task. A few thoughts :
* Lua is actually embedded in a few audio softwares as a language for their API : Reaper for example (but also Renoise). There is a very friendly community on the , they may help you (called ReaScript discord). While their use of Lua is probably not the same as the one you're planning, it's still a good starting point.
* The MIDI reference is stable. In order to retrieve inputs from a MIDI keyboard (assuming it's plugged as USB device), you only need to read from a serial port and interpret incoming bytes. I know, it may sound a bit complex but it's actually quite a trivial task if you use a bitwise operators library. You also need serial input. If you want to do it this way (the hard way), you should read the MIDI protocol reference first !
* Targetting Raspberry will definitely be easier than mobile OS (Android). For mobile OS's, you will probably need to make an application involving another language - or use Corona.
I hope this helps. I'm an audio nerd and Lua big fan, so happy to talk about that !

Electroacoustic composer & computer music designer
+33 6 77 20 98 41

From: Bruno Dumoulin <>
To: Lua mailing list <>
Subject: Re: Coding a musical game using MIDI
Date: 17/01/2023 10:58:21 Europe/Paris

You're making good point Bill and my instinct are also telling me to stay away from the JS jungle...

Here's my first gut response to the guy on the Qt forum who pointed me the JS route...
"Thanks for your reply. I have spent some time exploring the html/_javascript_ route... but gosh does that langage and it's clever multiple programming paradigms feel annoyingly confusing. I feel totally clueless about building an efficient and elegant software architecture in JS and there are so many people out there publishing tons and tons of very poorly written js code, it feels like a jungle to try and find something inspiring to learn from. I have yet to find inspiring learning sources for JS. I even purchased a few books and read some online o'reilly books... but even in the books, the coding does not feel elegant and efficient at all...

So unless I find some inspiring learning material, I'd much rather stay far away from JS...

Lua is a pleasure to read and write, it's elegant and readable, the only other language that felt as elegant to write was Ruby...
So I'd rather spend my learning time exploring stuff based on C/C++ (or maybe go back to Ruby? or possibly Python?)

Moreover, I'd like to play my game mostly offline... so I can cut off all external stimulation and concentrate on the music..."

And then the guy on the Löve forum offered some js help using p5.js...

I would like the game to be both fun to play and fun to write. I mean I'm interested in this project helping me learn BOTH music and efficient coding... I'm cautious about choosing the easy route : "protoype it in 5 mins using libraries you don't really understand", because that generally results in porrly written code that doesn't scale. I'd rather go slower, build simple things that I fully understand, and create a code base I can build on in time... I have tons of ideas for little games to help me progress in music, I'd like my code to be reusable...

Choosing which langage to use is the first and very important step... and the liveliness existing projects and support of the community is an huge part.

I feel in love with Lua straight away. Coding my first pong using Löve/Lua was such a nice learning experience...  I thought "let's code my musical game in Löve/Lua"... but I got stuck soooo fast... needing an external synth, not being sure what route to go... It feels a little scary that there is not a lot of audio development in Lua yet. I don't feel stro,ng enough in my coding skills to "open the way"... I found Peter Billam's page of various audio libraries in Lua and I reached out to him, he has not answered yet.

So I guess my question comes down to: how much interest/support is there in the Lua community to develop audio stuff? You guys sound nice... Are you interested in exploring with me?
Felipe's nibble stuff feels like a good place to start :-)

Le mar. 17 janv. 2023 à 09:59, bil til <> a écrit :
If you want to support the thing from "coding level" (e. g. you write
a C/C++ software and need scripting support), I would strongly
recommend Lua... (I used JS ca. 20 years in a large software system,
and I was VERY glad when I discovered Lua two years ago, now changing
all to Lua - as far as I know JS is not "really supported" any more by
MS for new applications - it seems to have become to large and

But as see it more from "application side" as I see it, you have to
check in which world you get best support for your application... .