Skip to content

Instantly share code, notes, and snippets.

View tancredi's full-sized avatar

Tancredi Trugenberger tancredi

View GitHub Profile
@tancredi
tancredi / remade-cut.svg
Last active March 5, 2024 20:11
remade-cut
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tancredi
tancredi / downsize-assets.js
Created July 18, 2022 12:03
Downsize retina assets (Node.js) script
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */
const { join, basename, dirname } = require('path');
const Jimp = require('jimp');
const glob = require('fast-glob');
const color = require('cli-color');
@tancredi
tancredi / resize
Created July 15, 2022 12:29
Image resize script
#!/usr/bin/env node
const color = require('cli-color');
const Jimp = require('jimp');
const [inputFile, resizeInput, outputFile] = process.argv.slice(2);
const usage = () => {
console.log(
color.red(
@tancredi
tancredi / Pioneer DDJ-200 Alternative.midi.xml
Last active July 16, 2022 10:42
DDJ-200-alternative-mappings
<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.0.0+">
<info>
<name>Pioneer DDJ-200 (Alternative)</name>
<author>Dan Giddins, Frank.Breitling at gmx.de, Geovanni Pacheco</author>
<description>2-deck USB and Bluetooth MIDI controller with support for 4-deck mode.</description>
<forum>https://mixxx.discourse.group/t/pioneer-ddj-200-mapping/18259</forum>
<manual>pioneer_ddj_200_alternative</manual>
</info>
<controller id="DDJ-200 ALT">
@tancredi
tancredi / game-controller-sampler.hid.js
Created December 25, 2021 19:41
Custom joystick as sampler controls - Mixxx HID controller mappings
const GC = {
stopOnRelease: false,
};
const MAP = {
TOP_L: [6, 1], // 0, 1
TOP_R: [6, 2], // 1, 2
TRIGGER_L: [6, 4], // 2, 4
TRIGGER_R: [6, 8], // 3, 8
@tancredi
tancredi / griffin-powermate-library-control.hid.js
Created December 25, 2021 03:43
Griffin PowerMater as library wheel & preview button - Mixxx HID controller mappings
const THROTTLE = 50;
const GPM = { lastMove: null, previewToMiddleOnLoad: false };
const GROUPS = { PREVIEW: "[PreviewDeck1]" };
const MAX_POSITION = 1.14;
GPM.init = function (id) {
GPM.controller = new HIDController();
GPM.id = id;
GPM.registerInputPackets();
GPM.registerOutputPackets();
@tancredi
tancredi / midi-ino.ino
Last active December 25, 2021 03:37
MIDI-Ino - An Arduino custom MIDI controller with Mixxx mappings
#include <USB-MIDI.h>
USBMIDI_CREATE_DEFAULT_INSTANCE();
const float K_MAX = 690;
const float K_THRESHOLD = 1;
const byte K_PINS[5]= { A0, A1, A2, A3, A4 };
const byte L_PINS[5]= { 2, 3, 4, 5, 6 };
const byte B_PINS[5]= { 9, 10, 11, 12, 13 };
@tancredi
tancredi / griffin-powermate-fx-knob.hid.js
Last active December 22, 2021 15:23
Griffin PowerMater as FX knob - Mixxx HID controller mappings
const GPM = { friction: 10, deck: 0 };
GPM.init = function (id) {
GPM.controller = new HIDController();
GPM.id = id;
GPM.controller.activeDeck = 1;
GPM.registerInputPackets();
GPM.registerOutputPackets();
GPM.registerCallbacks();
};
@tancredi
tancredi / make-thumbs
Created November 10, 2020 18:17
Recursive bash ImageMagick thumbnail generation tool
#!/bin/bash
declare -a EXTS=("jpg" "jpeg" "png" "gif")
DEBUG=0
WIDTH=100
HEIGHT=100
OUT_DIR=""
SUFFIX=""
INPUTS=()
#include <HSBColor.h>
#include <Adafruit_NeoPixel.h>
#define BUTTON_PIN 3
#define MODES_COUNT 7
#define LED_PIN 6
#define LED_COUNT 4
int mode = 0;
bool modeButtonPressed = false;