diff --git a/content/blog/2023/10-27-big-builder/index.md b/content/blog/2023/10-27-big-builder/index.md index 21d6709..d0b5aa3 100644 --- a/content/blog/2023/10-27-big-builder/index.md +++ b/content/blog/2023/10-27-big-builder/index.md @@ -3,6 +3,7 @@ title: Big Builder date: 2023-10-27 tags: - computers + - ci/cd --- I finally set up CI/CD with Forgejo/Gitea. diff --git a/content/blog/2024/01-05-big-builder-arduino/index.md b/content/blog/2024/01-05-big-builder-arduino/index.md new file mode 100644 index 0000000..b50f00b --- /dev/null +++ b/content/blog/2024/01-05-big-builder-arduino/index.md @@ -0,0 +1,97 @@ +--- +title: "Arduino, Big Builder, and Make" +date: 2024-01-05 +tags: + - computers + - ci/cd +--- + +Last night, +I got Big Builder building Arduino sketches. + +Big Builder is my Continuous Integration / Continuious Development (ci/cd) +solution for forgejo/gitea. +It's nothing revolutionary, +it's just a container with a bunch of pre-installed software, +and the gitea `act_runner` with a configuration to *not* try and use docker. +This means my builds are pretty quick, +and my network use is very low, +since I already have the tools I need to build stuff, +and don't have to download mulitple OS images every time I do a build. + +## Automating embedded systems builds + +Arduino, it turns out, +has been including command-line build tools for a long time now. +Since I'm using Debian's Arduino package, +I get the older, poorly-documented `arduino-builder`. +But the newer `arduino-cli` has better documentation, +that helped me understand how to use the older command. + +Using `arduino-builder` lets me keep the source code structured +in a way that makes sense to amateur developers: +they can just load it up in the IDE and not worry about my automation. +But it also lets me automate builds on my forgejo server, +and use the command-line to build everything, +the way I've been doing since the 80s. + +Here's what I wound up with, +to build a Leonardo image: + +```sh +mkdir -p build/cache +arduino-builder \ + -build-path $(pwd)/build/ \ + -build-cache $(pwd)/build/cache/ \ + -fqbn arduino:avr:leonardo \ + -hardware /usr/share/arduino/hardware/ \ + -tools /usr/share/arduino/tools/ \ + -compile MockBand.ino +``` + +This results in `build/MockBand.ino.hex`, +which can then be given to `avrdude` to flash my board. +Easy! + +---- + +For the mockband project, +I also needed to specify a custom USB VID/PID and a CPP definition. +After reading a lot of forums posts and code, +I discovered I could easily do this with `arduino-builder`, +with the `-prefs=` flag. +This allows you to override settings in `boards.txt`, +which is apparently what Arduino uses to build a gcc flags list. + +Here's a trimmed-down version of what I implemented: + +```sh +mkdir -p build/cache +arduino-builder \ + -build-path $(pwd)/build/ \ + -build-cache $(pwd)/build/cache/ \ + -fqbn arduino:avr:leonardo \ + -hardware /usr/share/arduino/hardware/ \ + -tools /usr/share/arduino/tools/ \ + -prefs="build.extra_flags=-DUSB_VID=0x1bad -DUSB_PID=0x0004 -DCDC_DISABLED" \ + -compile MockBand.ino +``` + +--- + +My final step was to write a `Makefile` to do all this. +Since the build step is just one (long) command, +and the `-prefs` could easily use per-target variables, +`make` was an obvious tool. +Adding a target to run `avrdude` was simple enough, too. + +I no longer need the Arduino IDE at all, +but the project still works with it! + +The result was a +[Makefile](https://git.woozle.org/neale/mockband/src/commit/63bd0672500631b8c47f24f041693e642ab32533/Makefile) +which can compile, flash, and package +all three variants of the build. +It's 43 lines long, +including blank lines. + diff --git a/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/index.md b/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/index.md new file mode 100644 index 0000000..491f276 --- /dev/null +++ b/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/index.md @@ -0,0 +1,67 @@ +--- +title: The State of Homebuilt Rock Band Drums +date: 2024-01-15 +tags: + - rockband +--- + +There are currently at least four efforts to get a working Rock Band drum kit: + +## Mad Catz (mature) + +Based on the vendor ID sent by the USB devices, +I think Mad Catz is the company that made most of the +officially licensed Rock Band instruments. +They're still selling something that takes MIDI input, +and outputs signals to look like a Rock Band 2 drum kit. + +The converter plus a decent entry-level kit will cost about $500, +and probably provides a very nice feel. +You can also use the drums by themselves or as a MIDI controller. + + +## Mockband Drums (stable) + +![mockband drums and guitars](mockband.jpg) + +Using a $33 drum toy from Amazon ($25 on sale), +you can build a tabletop drum kit. +I've been playing on it for the last month +and the experience is comparable to the Rock Band 1 kit I had 10 years ago. +It's okay, but not fantastic. + +This requires some soldering, +but all the development is done. +If you're crafty, +you can probably have this working in an afternoon. + +https://git.woozle.org/neale/mockband + + +## Polybar Drum Kit (in development) + +Some of the polybar people are working on a from-scratch 3d printed drum kit. +So far it seems they're trying to use piezos to read drum hits, +which could mean it will send some kind of velocity information. +Although probably not super accurate, +and I haven't yet seen a game that uses it, +this would be closer to the official Rock Band drum kit. +When it's closer to finished, +it will probably use the santroller firmware +(see below). + +As far as I know, +all development on this is happening on Discord, +so there's no URL to add here. + + +## Santroller (stable?) + +Sanjay9000, +the person who was made a very nice packaged version of a Rock Band guitar controller firmware, +has released a new firmware that claims to support drums as well. +This is made to replace the firmware in an official Rock Band drum kit, +but will probably be what the Polybar effort uses, +because so much effort has been put into making the firmware easy to set up. + +https://santroller.tangentmc.net/ diff --git a/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/mockband.jpg b/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/mockband.jpg new file mode 100644 index 0000000..5492d5f Binary files /dev/null and b/content/blog/2024/01-15-state-of-homebuilt-rock-band-drums/mockband.jpg differ