James Munns (Twitter Archive)
bitshiftmask.bsky.social
James Munns (Twitter Archive)
@bitshiftmask.bsky.social
100 followers 2 following 4.1K posts
A twitter archive of @bitshiftmask Owned by @jamesmunns.com on bluesky
Posts Media Videos Starter Packs
In case folks are still moving over, reminder I'm over there too, still doing all the electronics, embedded, rust, and protocol stuff I've always been doing :)
📣 Second episode of the "Self-Directed Research Podcast" with me and @fasterthanlime is now up! This episode is "BBQueue - Going Just Far Enough with Generics"!

Links to Apple Podcasts and Spotify below :D

https://sdr-podcast.com/episodes/bbqueue/
Thanks to @tweedegolfbv for sponsoring the first episode!
The first episode of the "Self-Directed Research Podcast" with me and @fasterthanlime is now up! The podcast is a weekly deep dive, and this first episode is Amos exploring what they got right, and what they got wrong, when it comes to Rust build...
Hey, just a rememinder: I'm pretty active over on the other site, and as of today, you no longer need an invite to sign up!

It would be cool to see more Rust and Embedded folks over there.
I have 4 more bsky invites for mutuals, reply or shoot me a DM if you need one.
Reminder, you can find me in a bunch of other places here: https://jamesmunns.com/contact/

Cohost and Bluesky are my favs right now, and Matrix is always a good choice.

If you find anywhere that has a bunch of embedded and/or rust folks there, lemme know :D
About + Contact
jamesmunns.com
Update, added bluesky to my list of websites. Find me there if you'd like. (I don't have invites)

Still most active on Cohost and Matrix. Full list of places to find me in the linked tweet.
I updated my website with all of the other services you can find me on. Do me a favor: if we aren't mutuals somewhere else, follow me on one of these, or shoot me an email and just say hi!

Never hesitate to reach out.

https://jamesmunns.com/contact/
About + Contact
jamesmunns.com
Nope, that’s it. That’s the line. I’m off twitter now. Follow me over at <a href="http://cohost.org/jamesmunns," class="hover:underline text-blue-600 dark:text-sky-400 no-card-link" target="_blank" rel="noopener" data-link="bsky">http://cohost.org/jamesmunns, or shoot me an email. I’m not hard to find.
We are living in a golden age of case studies, if nothing else.
For no reason at all, if you haven't heard of "Chesterton's Fence" before, this might be an interesting, topical read.

In particular, it's important to understand systems (and how and why they came to be, for better or worse), before changing them.

https://fs.blog/chestertons-fence/
Attention Required! | Cloudflare
fs.blog
Continuing my sleep deprived audio hacking, figuring out how to calculate Euclidean Rhythms, but very efficiently:

https://cohost.org/jamesmunns/post/276695-a-simpler-way-to-cal
A simpler way to calculate Euclidean Rhythms
Euclidean Rhythms [https://dbkaplun.github.io/euclidean-rhythm/] are a cool way to generate beat patterns, originally shown to me by @jjbbllkk. There's a paper (pdf) [http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf] that describes a way to calculate it, by shuffling the beats and rests to make sure they are well spaced. There IS a rust crate that does this, but it follows the paper's methods fairly directly, which requires a bunch of SmallVecs, and I don't love it: https://github.com/padenot/euclidian-rythms/blob/3c72f37ff8a6c1b7897fdc783e52fabe8eb45dc8/src/lib.rs#L5-L72 [https://github.com/padenot/euclidian-rythms/blob/3c72f37ff8a6c1b7897fdc783e52fabe8eb45dc8/src/lib.rs#L5-L72] Instead, I have hit the problem with loops and bit math, which allows me to handle the problem much more comfortably on embedded systems: pub struct Euc32 { interval: u32, data: u32, } impl Euc32 { pub fn new(hits: u32, interval: u32) -> Option<Euc32> { if hits == 0 { return Some(Euc32 { interval, data: 0 }); } if (hits > 32) || (interval > 32) || (hits > interval) { return None; } let mut ctr = 0u32; // TODO: There's probaby a *math* way to do this without // a loop, but whatever while ctr < interval { ctr += hits; } let mut data = 0; for i in 0..interval { if ctr >= interval { data |= 1 << i; ctr -= interval; } ctr += hits; } Some(Euc32 { interval, data }) } } This gives me the results I expect: test euc::test::sevens ... 0: [.......] 1: [x......] 2: [x..x...] 3: [x.x.x..] 4: [x.x.xx.] 5: [xx.xxx.] 6: [xxxxxx.] 7: [xxxxxxx] ok test euc::test::thirteens ... 00: [.............] 01: [x............] 02: [x.....x......] 03: [x...x...x....] 04: [x..x..x..x...] 05: [x..x.x..x.x..] 06: [x.x.x.x.x.x..] 07: [x.x.x.x.x.xx.] 08: [x.xx.x.xx.xx.] 09: [xx.xx.xx.xxx.] 10: [xxx.xxx.xxxx.] 11: [xxxxx.xxxxxx.] 12: [xxxxxxxxxxxx.] 13: [xxxxxxxxxxxxx] ok
cohost.org
James Munns on cohost
Moving up in the world, now I can encode "Mary had a little lamb". Code for this is below the fold. ---------------------------------------- use mididemo::bar_to_midi; use minijam::scale::Pitch; use thursday::{Length, bars::BarBuf}; fn main() { // Input notation let mary = [ (Length::Quarter, Some((Pitch::E, 4))), // Ma (Length::Quarter, Some((Pitch::D, 4))), // ry (Length::Quarter, Some((Pitch::C, 4))), // had (Length::Quarter, Some((Pitch::D, 4))), // a (Length::Quarter, Some((Pitch::E, 4))), // lit (Length::Quarter, Some((Pitch::E, 4))), // tle (Length::Quarter, Some((Pitch::E, 4))), // lamb (Length::Quarter, None), // (Length::Quarter, Some((Pitch::D, 4))), // lit (Length::Quarter, Some((Pitch::D, 4))), // tle (Length::Quarter, Some((Pitch::D, 4))), // lamb (Length::Quarter, None), // (Length::Quarter, Some((Pitch::E, 4))), // lit (Length::Quarter, Some((Pitch::E, 4))), // tle (Length::Quarter, Some((Pitch::E, 4))), // lamb (Length::Quarter, None), // (Length::Quarter, Some((Pitch::E, 4))), // Ma (Length::Quarter, Some((Pitch::D, 4))), // ry (Length::Quarter, Some((Pitch::C, 4))), // had (Length::Quarter, Some((Pitch::D, 4))), // a (Length::Quarter, Some((Pitch::E, 4))), // lit (Length::Quarter, Some((Pitch::E, 4))), // tle (Length::Quarter, Some((Pitch::E, 4))), // lamb (Length::Quarter, Some((Pitch::E, 4))), // its (Length::Quarter, Some((Pitch::D, 4))), // fleece (Length::Quarter, Some((Pitch::D, 4))), // was (Length::Quarter, Some((Pitch::E, 4))), // white (Length::Quarter, Some((Pitch::D, 4))), // as (Length::Half, Some((Pitch::C, 4))), // snow ]; // Load into a Bar Buffer let mut bbuf = BarBuf::new(); for (len, note) in mary { match note { Some((pitch, oct)) => bbuf.push_note_simple(len, pitch, oct).unwrap(), None => bbuf.push_rest_simple(len).unwrap(), } } // Write to midi file bar_to_midi(&bbuf, "mary.mid", 150, Some(1)).unwrap(); }
cohost.org
Been hacking on some stuff for my generative synth, primarily how to build/store musical notes.

I also wired it up so it can:

A: generate midi of the stored contents
B: you can use a tool (MuseScore) to dump the midi to music notation

This is mary had a little lamb
wait why are the bluechecks actually blue and not white now?

it's still the same for both paid and "classic" verified accounts.

(this is rhetorical, I know none of it actually makes sense)
Credit to @1lexxi for sharing this on cohost :D
Someone made an RV32I VM for the 8051, which means you can write Rust binaries that target RV32I, and run them on an 8051.

That's just, whew. Is it a good idea? I have no idea! Is it badass? Yes, very much so.

https://github.com/cyrozap/rv51
GitHub - cyrozap/rv51: A RISC-V emulator for the 8051 (MCS-51) microcontroller.
A RISC-V emulator for the 8051 (MCS-51) microcontroller. - cyrozap/rv51
github.com
alt text (I guess I do have to explain it): someone has used a fourier series of rotating divs to simulate the HTML marquee element. In practice, this causes an eggbug to scroll from right to left (a little twitchy/bouncy), then the series swings it down and back right to reset)