• choose theme
  • Greenwich Mean Time GMT

    pygamer nanoloop clone pt i

    I'm working on a clone of Oliver Wittchow's nanoloop for the Adafruit PyGamer.

    The prototype was written in CircuitPython, which is a lovely language, but it doesn't (yet) have support for the kinds of audio things I want to do.

    It was helpful to use it to lay out the shape of the state object, and the controls and the UI.

    The audio was unuseable, so I've rewritten it in C++.

    It's coming along very well.

    There are 4 sound channels available for use, using the fab Teensy Audio Library:

    • square
    • pulse
    • sawtooth
    • noise

    The **e**nv**e**lop**e** menu item let's you change the attack, decay, sustain volume, amplitude and panning of your note block with cute visual indicators of each property.

    There is a filter and a delay feature, and each channel can play at full speed, half speed or quarter speed. You can alter the bpm in the second menu.

    It's a lot of fun.

    The plans for the next session (this evening?) are:

    • add a pitchbend envelope (for the **m**od menu item)
    • add UI for delay and filter
    • use the neopixel array on the base of the PyGamer to indicate the current bar (the loop plays for 4 bars, things on /2 or /4 speed play twice or once during that time)

    Future plans are to introduce pattern chaining, pattern-length (per-channel), using square curves for attack and decay and chords (positive integer intervals).

    The code is very bad and available here:

    https://git.snoot.club/chee/bleepbloopmachine

    It's already starting to diverge from nanoloop, and I hope it will continue to forge its own identity until it can stand strong as its own independent interesting instrument.

    Greenwich Mean Time GMT

    Snootclub Matรฉ

    an overnight recipe

    Ingredients

    • handful brown sugar
    • handful white sugar
    • 1 lemon, sliced
    • ~120g yerba mate
    • ~litre still water
    • ~litre sparkling water

    Directions

    1. squeeze the lemon slices into the bottom of a litre jar with a tight lid, iโ€™ve used a kilner
    2. add the handfuls of sugar, and stir until dissolved
    3. drop the lemon slices and yerba matรฉ in
    4. fill the jar with the still water, (you might need to put the lid on and shake it to soak the tea, so you can fill it to the top)
    5. put it in the fridge for 8-12 hours or overnight
    6. strain the liquid through a cheesecloth (or a sieve will do, the pieces are quite big) and mix 50/50 with sparkling water
    7. serve in large glasses with ice

    โ€” chee (hi@chee.party)

    Greenwich Mean Time GMT

    using /dev/gpiomem on archlinux arm

    imagine you have a raspberry pi running arch linux arm, and you want to use the python library RPi.GPIO.

    that requires a /dev/gpiomem device, which is a hacky /dev/mem derivative that allows you to access the gpio pins without being root. which is important if you want to also be able to access a normal userโ€™s dbus session, or anything else where youโ€™d like to not be root while running the python.

    arch linux arm uses raspberrypiโ€™s kernel fork, but doesnโ€™t set up the gpiomem device the way itโ€™s needed for RPi.GPIO to work.

    Add a gpio user

    as root, create a gpio user

    groupadd gpio
    usermod -aG gpio alarm # alarm is the name of the default archlinuxarm user

    setup udev

    Make a file called /etc/udev/rules.d/pins.rules and put this in it:

    SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
    SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
    SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
    

    you may also wish to append this line, if youโ€™re going to need spi access too:

    SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"

    reboot

    reboot, run the python, no root,

    Greenwich Mean Time GMT

    gameboy printer

    I got a broken gameboy printer off ebay for a few pounds. i resoldered all its joints and cleaned it with vinegar and alcohol.

    that made the light come on, but the link port was badly damaged too. i managed to fix it by prying all the pins into the right shape with a pair of pliers and squeezing them around a folded up piece of a ripped up Something For You card.

    we were in a pawn shop just before new lockdown, and they had a gameboy camera for sale

    photos of abe and chee coming out of the gameboy printer

    โ€” chee (hi@chee.party) 2020-11-18

    Greenwich Mean Time GMT

    snootauth

    can i tell you about this thing i wrote? it involves ssh and cookies and the setuid and setgid bits.

    itโ€™s called snootauth.

    what is it?

    itโ€™s a way for sites on snootclub to verify a snootclub user.

    how does it work?

    it is hosted at /auth on any snoot site that wants auth.

    abe.snoot.club/auth/chee showing link labeled โ€œlistenโ€, and an ssh command to run

    when you, a user, click the listen in the browser, it starts a GET request which makes the server open a unix socket thatโ€™s owned by your user in /snoot/auth/socks/{your-uid}.sock.

    there is an ssh server running on port 2424, which has ForceCommand set to a program called succeed.

    the ssh command being run in a terminal. โ€œThank-you, you can return to your browser now.โ€

    when you run the ssh command, succeed(1) writes the word "success" to the socket belonging to your user then exits.

    Web browser saying โ€œThank-you! Enjoy your cookieโ€

    In the http server, listenโ€™s GET request handler receives the "success" in the socket and returns, setting a cookie for you on the snoot subdomain you are on.

    Devtools showing the cookie set for this subdomain.

    and now on the server, there is a file that belongs to the snoot user whose site you are on that contains your token:

    ls -l showing file permission abe:snootauth

    itโ€™s also read-writeable by the snootauth program, so it can delete or replace tokens when the user logs out or reauthenticates.

    so now the server code for the snoot whose site you are on can check any cookies it receives against the token in /snoots/auth/sessions/{their-name}.{my-name} โ€” chee (hi@chee.party) 2020-11-17