Skip to content

Instantly share code, notes, and snippets.

View stupidpupil's full-sized avatar
💭
I may be slow to respond.

A Watkins stupidpupil

💭
I may be slow to respond.
View GitHub Profile

I note that I've done most of my actual file and audio processing under either macOS or Linux, where I'm much more familiar with the scripting tools. I might not be able to help you as much I'd like.

General advice for trying to make a voice pack

I'd suggest taking a look at my voicepack template or at least Kregano's tutorial that it's based off.

Why? Well, Kregano's tutorial covers using a script (by robojumper) that fixes several problems with the built-in approach to voice 'banks', and my template then tries to help you avoid having to decide what to name bits of code and stuff.

If you do try my template, I suggest calling your project and your mod something like 'SlickSlothGrenadierVoice' or something (without spaces, and the same name for the project and mod) otherwise it ends up even more confusing in places...

Getting CoH2 sound files into XCOM 2

class ZeteticCharacterVoice_ZetBastila extends XComCharacterVoice;
struct EventMap
{
var() Name EventName;
var() array<Name> FallbackNames;
var() array<Name> SoundCueNames;
};
@stupidpupil
stupidpupil / recolour.sh
Created December 22, 2018 11:37
Recolouring a film using ffmpeg and magick
ffmpeg -i original.mp4 "original_frames/$filename%04d.png"
for infile in original_frames/*.png; do
convert "$infile" -color-matrix '0.6 -0.2 0.1 -0.4 0.4 0.4 -0.4 0.5 0.4' -modulate 180% "new_frames/$(basename "$infile")"
done
ffmpeg -y -i new_frames/%04d.png -r 25 -pix_fmt yuv420p out.mp4
@stupidpupil
stupidpupil / bnf_name.peg
Last active August 8, 2018 19:33
BNF Name PEG
bnf_name <-
("Gppe " form "_" product_name_word (" "* (ratio / quantity / modifier / product_name_word))*) /
((product_name_word " "?)+ "_" (" "* (!form product_name_word))* " "* form (" "* (ratio / quantity / modifier))*)
;
product_name_word <- r'[^\s_]+' ;
ratio <- (quantity / number) ("/" / ";") (ratio / quantity / unit / number);
@stupidpupil
stupidpupil / GalliumOS on Edgar.markdown
Last active September 23, 2025 13:07
Guide to installing GalliumOS on an Acer Chromebook 14" (CB3-431) 'Edgar'

GalliumOS on Edgar

This document sets out how I installed GalliumOS 2.1 on a new Acer Chromebook 14" (CB3-431) 'Edgar' in April 2017. I installed GalliumOS on the internal eMMC storage, but left Chrome OS in place (allowing dual-booting).

It is meant to be an easy-to-follow and particularly thorough (if repetitive) guide, but I make no warranty that it will work correctly for you. It will wipe all data on your Edgar.

I have tried to provide references for each section; see the GalliumOS wiki guide to chrx installation for an overview of the general process.

⚠ Caution: There have been reports of Edgars' speakers overheating, due to a malfunction of the audio hardware, when booted into anything other than Chrome OS. I have not experienced this, and it seems to be believed that this will not now occur under GalliumOS. More information can be found in the comments for the [GalliumOS Braswell Platform Validation

function plotIsOnAnIsland(pPlot)
local canGoOnLand
canGoOnLand = function (pStartingPlot, iDirection, iDistance, iDirectionConstraint)
if iDirectionConstraint == nil then
iDirectionConstraint = iDirection
end
local directionMeetsConstraint = function(dir)
@stupidpupil
stupidpupil / usr.sbin.hostapd
Last active September 12, 2017 00:04
hostapd Debian AppArmor profile
#include <tunables/global>
/usr/sbin/hostapd {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_admin,
capability net_raw,
network packet,
network raw,
@stupidpupil
stupidpupil / alfa.rb
Created January 10, 2017 22:33
A script for spelling out strings using macOS's `say` command
#!/usr/bin/env ruby
# A script for spelling out strings using macOS's `say` command.
# Uses the NATO/ICAO spelling alphabet, mostly.
# Mapped to spellings that produce the desired effect, specifically with the Fiona voice.
# Didn't use phonemes as these are not reliably available for recent (Nuance) voices.
# TODO: Use ICU to get Unicode character names
mapping = {
'a' => 'alfa',
@stupidpupil
stupidpupil / pre-commit.sh
Last active September 1, 2016 00:32
Beancount git pre-commit hook
#!/bin/sh
git stash --quiet --keep-index --include-untracked
bean_check_err=`bean-check main.beancount 2>&1 >/dev/null`
git stash pop --quiet --index
error_lines=`printf "$bean_check_err" | wc -l | awk {'print $1'}`
if [ $error_lines -eq 0 ]; then
echo "\\033[32mBean-check passed! 💰\\033[0;39m"
@stupidpupil
stupidpupil / keybase.md
Last active August 27, 2016 20:13
Keybase proof

Keybase proof

I hereby claim:

  • I am stupidpupil on github.
  • I am stupidpupil (https://keybase.io/stupidpupil) on keybase.
  • I have a public key ASDrdrqkxDCuh0QfHB9aKB6FAFsbD7XGnwoauKin2JGNego

To claim this, I am signing this object: