Midi to redstone for a Create pipe organ?

Started by audiophage, Dec 29, 2023, 03:10 AM

Previous topic - Next topic
Hi, let me preface this by saying I have zero experience with Lua, and almost zero with coding in general. I'm just looking for some help with a build I'm working on.

I'm in the process of building a functional pipe organ using the Create mod. It uses redstone-controlled steam whistles tuned to 36 separate notes. I was looking to see if there was a streamlined way to play music with it without using a giant redstone contraption. I came across this mod and I was wondering how I might be able to play midi files through a computer. I'd need a way of firing at least 36 separate redstone wires. Ideally, the program could make use of the start and end of midi notes, because unlike note blocks, the steam whistles will make sound as long as they are powered. (I also really want to play Toccata and Fugue on it, and that song has notes that are held for a really long time.)

SquidDev

So the short/easy answer is someone has already done this, so if you're happy to reuse existing code, that's probably easiest!

That said, there's some improvements that could be made to that project. The existing code relies on having one computer controlling each whistle, which is pretty messy. If you've got Wired Redstone or MoreRed in your pack, you should be able to use bundled cables (and redstone.setBundledOutput) to control the whistles. This will still be a bit of a monstrosity, but means you only need to run 3 cables (each carries 16 signals). I built a simple piano using this approach, if that code is helpful.
GitHub | CC:Tweaked: A ComputerCraft fork | Plethora: A peripheral mod