Skip to content

Instantly share code, notes, and snippets.

View argarak's full-sized avatar
🦆
Duck is the best. Everybody loves duck. Duck is in the mix. Duck is to the max.

Jakub Kukiełka argarak

🦆
Duck is the best. Everybody loves duck. Duck is in the mix. Duck is to the max.
View GitHub Profile
#!/bin/bash
for i in *.mid; do fluidsynth -g 0.4 -C no -R no -l -T raw -F - ~/soundblasterSF2/MSGS.sf2 "$i" | twolame -b 256 -r - "$i.mp3"; done
mkdir mp3s;
for i in *.mp3; do ffmpeg -i "$i" "mp3s/$i"; done
#
# bridge.py - weechat script which replaces irc message nickname with nickname
# given by #botb's new discord<->irc bridge
#
BRIDGE_IRC_NAME = "botbd"
CHANNEL_NAME = "#botb"
import weechat
#
# code for the botb entry "an extra cup of tea"
# F MAJOR
# http://battleofthebits.org/arena/Entry/an+extra+cup+of+tea/33279/
#
import struct
import wave
@argarak
argarak / j0cc_dvorak.patch
Created July 16, 2019 22:41
J0CC-Famitracker patch to change hardcoded qwerty key notes to dvorak
diff --git a/Source/FamiTrackerView.cpp b/Source/FamiTrackerView.cpp
index f35c7ab..dac6fd4 100644
--- a/Source/FamiTrackerView.cpp
+++ b/Source/FamiTrackerView.cpp
@@ -3358,46 +3358,46 @@ int CFamiTrackerView::TranslateKeyDefault(Keycode Key) const
// Convert key to a note
switch (Key) {
- case 50: KeyNote = NOTE_Cs; KeyOctave += 1; break; // 2 // // //
- case 51: KeyNote = NOTE_Ds; KeyOctave += 1; break; // 3
@argarak
argarak / phasebyte.min.txt
Last active July 15, 2019 23:49
phasebyte [++t]: bytebeat music, commented and minified versions
a=[.1,.05,.1,.2,.2,.1,.2,.1],b=[.05,.1,.15,.2,.15],c=[2,3,1,5,4,3,2,1,7,6,5,4],d=[[.2,.4,.1],[.4,.8,.5],[.6,1,.65]],e=1,f=[],(t>1300000?f=[0,0,0,0,0,0,0,6]:t>1150000?f=[0,0,0,0,0,0,10,6]:t>1000000?f=[0,0,8,0,2,0,10,6]:t>950000?f=[0,0,8,0,2,0,10,0]:t>750000?f=[16,4,8,4,2,10,10,0]:t>700000?f=[0,0,0,0,0,0,10,0]:t>600000?f=[16,4,8,4,2,10,10,0]:t>490000?f=[0,0,0,4,2,10,10,0]:t>430000?f=[0,0,0,4,2,10,0,0]:t>150000?f=[16,4,8,4,2,10,0,0]:t>110000?f=[16,4,8,0,2,0,0,0]:t>75000?f=[0,4,8,0,2,0,0,0]:t>50000?f=[0,0,8,0,2,0,0,0]:t>45000?f=[0,0,0,0,2,0,0,0]:t>30000?f=[0,0,0,0,1.5,0,0,0]:t>10000?f=[0,0,0,0,1,0,0,0]:t>0?f=[0,0,0,0,.5,0,0,0]:0),t>490000?g=[.5,.6,.3,.4,.1,.15,.4,.15]:g=[.35,.04,.2,.2,.45,.5,.4,.2],t>850000?e=1:t>750000?e=2:t>430000?e=1:t>365000?e=2:t>300000?e=1:t>250000?e=2:0,h=[6,5,4,3,2,1,0],t<1560000?(t>1500000?f[7]=h[int(t/16000)%h.length]:0):f[7]=0,-64+(32+sin(t*.01*(((t)*.001^3)%8))*(((t)*.001^3)%4)*f[0])+(32+random()*(((t)*.0005^3)%4)*f[1])+(32+random()*(((t)*.002^3)%2)*f[2])+(32+sin(t*(e/2)*a[int(t/4000)
@argarak
argarak / samplechop.py
Created April 24, 2019 15:54
audio utils
#!/usr/bin/env python3
# Use the --help option to list all the available options
import click
import numpy as np
from pydub import AudioSegment
# from https://github.com/jiaaro/pydub/issues/90
def match_target_amplitude(sound, target_dBFS):
@argarak
argarak / robotMain.ino
Created January 2, 2017 17:40
My old code for the robot rover Arduino project
/* Copyright 2017 Jakub Kukiełka */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
@argarak
argarak / getPlaylist.js
Last active January 2, 2017 17:44
Creates a m3u playlist file of the featured mods on The Mod Archive (modarchive.org), from the RSS feed.
// This is free and unencumbered software released into the public domain.
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@argarak
argarak / album-segregate.py
Last active October 23, 2016 17:29
Takes all the .ogg music files and creates directories based on their album metadata, then moves the file to that directory. It also creates a file named cover.jpg, which includes any cover art, if there is any.
# Copyright (c) 2016 Jakub Kukiełka
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without
# limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
# Software, and to permit persons to whom the Software is furnished to do so, subject to the following
# conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions
# of the Software.
@argarak
argarak / counter.c
Last active January 29, 2016 23:59
Simple C counter to save progress on tasks. Includes a progress bar. GNU/Linux only! (saves UNIX timestamp to /home/{user}/.config/counter/date).
/* Copyright 2016 Jakub Kukiełka */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* Unless required by applicable law or agreed to in writing, software */