Posts

Showing posts with the label Code

Rust Never Sleeps

Image
Go brought me to a shuddering stop. I think I may have had some environment issues because I had some early install problems. These seem to be tricky to fix, so I may come back to Go later. Meanwhile, I've been trying Rust, learning from " The Rust Programming Language ", AKA "The Rust Book." So far, the experience has been as easy as Arduino and C/C++ was when I started that journey 8 years ago. Challenging, but steady progress. And in sorting out a problem with my Rust installation, I may have hit upon the solution to my Go installation issues, too. Looks like Homebrew language installs might be a little problematic. Maybe my Homebrew install is buggered. Will come back to that, too, but after my Rust learning. So, I'm as far as Chapter 2, "Programming A Guessing Game," where the reader is guided through constructing a command line guessing game. It has been a surprisingly easy experience. Rust has a syntax like C but feels... "easier....

Refusing to Give Up - Here I Go... Again

Image
I can't help it. The state of social media, its centralisation, its blatant disregard for all but the thinnest veneer of "privacy", the manipulation of the proletariat. I simply can't give up on creating some form of timeline-based microblog that is peer-to-peer, has persistant data for as long as the user keeps it live, serverless, securely encrypted and addressbook based. My programming skills need to level up a long way from where I'm at, though. Enter Go, Google's language, but open, standardised, apparently low-level capable and as cross-platform as C, yet simpler than C or Javascript. Early playing around with it has been very interesting, it doesn't break my brain, like JS, it seems to, by way of its module achitecture ("libraries"), less arcane and less aimed at professionals than C and seems to have broad support, but I still have a long way to go, and to that end, FreeCodeCamp just dropped a beginners Go course in in my inbox. Fingers...

Quantise Pulse Period Timing to MIDI Note Numbers

Image
My top secret guitar pedal is NOT a guitar synth, but it does output MIDI notes... Well, it will output MIDI notes, velocity and channel data when it's actually developed, but it's not a synth. It's still in a crude, analog prototype iteration right now. No, it's not a guitar synth, but the idea is audacious and groundbreaking. Nope. Still not telling. There's loads of stuff it already does, combining more than just guitar, to create... Nah, still not telling! Cruel, aren't I? Be patient. However, tonight, I can proudly say that MIDI note numbers can be "quantised" from period timing. Schmidtt trigger, edge detection, the pulseIn() function, a lookup table... IN 12 FREAKIN' LINES OF CODE! Mathematically, elegantly et voila! MIDI notes can be made to happen. In a sim, so far. On the command line. But those 12 lines of code will actually cut down to about 8, in an actual "pedal." Yeah, there's heaps else to do, too, but this t...

Retronome

Image
F*** it, the name's probably taken, but I don't care. I'll cross that bridge if I come to it. Retronome is an Arduino metronome, not too dissimilar to a certain Dr Rhythm from Boss, like, the idea is a classic 70s DR box. Anyway, I've "built" one on Wokwi and coded it up. Still some basic features to add, and some code to make more readable, but hey, it's a start. I could buy one from my fave music store, but where would be the fun in that? Besides, any coding and electronics build is a valuable exercise in practice, just like playing your songlist... at home... alone. Which brings me to my reason for making Retronome, I need to practice to a clock, get my songs at a right tempo, get my feels tighter, but right. (Half time the metronome, play to the 2 and 4, develop your swing.) So, bleep, blip, blip, blip, bleep, blip, blip, blip. Get the code, as it grows, here.

Learning C++

Image
Screw Javascript. I already have a basic grounding in C/C++ through Arduino, so I've racked up a queue of youtube tutorials on C++ programming, starting with FreeCodeCamp's "Learn C++ in 31 Hours." You read that right. I'm a handful of chapters from Pointers, that scares me a bit, they break my brain a lot. On the plus side, this guy is a pretty good tutor, so far, and has clarified a few things for me, and cleared up some better practices. I'm learning a bit about my Mac, too. (M1 Macs, being ARM powered, don't do long double float point numbers. Too bad if you need to count stars in the milky way and store terrabytes of data on each... meh.) I have quite a bit of respect for the Arduino platform basing their language on a subset of C++, it's enough C for beginners, and provides a really good, baremetal grounding in the language, but it also has a good subset of the pluspluses and OOPs, too, for people who want to reshape the universe in code. Wel...