Skip to content

Instantly share code, notes, and snippets.

@ryrun
ryrun / PitchPhrases.lua
Last active December 19, 2015 19:39
create phrases for pitching (Renoise)
-- create phrases to pitch sample
-- get current insturment and selected sample
local instrIndex = renoise.song().selected_instrument_index
local smplIndex = renoise.song().selected_sample_index
local instr = renoise.song().instruments[instrIndex]
local basenote =instr.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][smplIndex].base_note
-- how many steps
local steps = 12
@ryrun
ryrun / ipmx.el
Last active August 29, 2015 14:15
get IP and MX of a domain with Emacs
; get ip and mx
(let ((domain "mydomain.com"))
(switch-to-buffer-other-window "*temp*")
(erase-buffer)
(setq www (format "www.%s" domain))
(setq ip "")
(setq mx "")
(setq ret-val (call-process "ping" nil t nil domain "-n" "1"))
(if (equal ret-val 0)
(progn
@ryrun
ryrun / SFZ2XRNI.lua
Last active February 25, 2023 10:29
Simple converter for renoise 3.1 to convert sfz files to xrni
files = renoise.app():prompt_for_multiple_filenames_to_read({"*.sfz"},"SFZ files to convert")
--check for files
if table.getn(files)>0 then
for key,value in pairs(files) do
outputfile = value:match("^(.*)\.[sS][fF][zZ]+$")
renoise.app():load_instrument_multi_sample(value)
renoise.app():save_instrument(outputfile)
end
renoise.app():show_message(table.getn(files) .. " instruments converted.")
else
@ryrun
ryrun / avenger_vstpreset_gen.php
Created February 16, 2017 19:10
Convert VST Avenger .avgr Patches to VSTi patches .fxp in PHP
<?php
$path = ""; //add your avenger expansion path here
$dir = scandir( $path );
$dir = array_diff($dir,["." , ".." ]);
//all expansions
foreach($dir as $exp) {
$presetpath = $path . $exp . "\\presets\\";
$presettypes = scandir($presetpath);
@ryrun
ryrun / avenger_vstpreset_gen.el
Created February 18, 2017 21:09
Convert VST Avenger presets to fxp with emacs elisp
(require 'bindat)
;;; put your avengers content path here
(setq avenger-content-path "")
(mapcar (lambda (filename)
;; show current patch in message buffer
(message filename)
;; read file
@ryrun
ryrun / bitwigpresetgen.el
Last active May 1, 2021 15:34
It generates Bitwig presets (.bwpreset), Renoise .xrni patches and Komplete Kontrol .nksf Patches of vst instrument patches (.fxp) with automatically generated meta data. Its written for windows and uses 7z to compress the fxp patch for bitwig and renoise patches. Other implementation as PHP scripts: https://github.com/ryrun/PHPBitwigPresetGen
;;; https://github.com/jhorology/gulp-bitwig-rewrite-meta/blob/master/gulp-bitwig-rewrite-meta.coffee
(require 'bindat)
;;; gen for komplete kontrol
(defun create-nksf (fxp id devicefilename devicecreator presetname category tags bank comment)
(setq vstname (substring devicefilename 0 -4))
;;load fxp
(let ((coding-system-for-read 'binary))
(setq fxp (substring
(with-temp-buffer
@ryrun
ryrun / gist:c6817b8c76d2a43ef670bd2c2e25a73a
Created June 19, 2017 07:04
Simple fix for sha1 error, when using git on samba shares
git config --add core.createobject link
@ryrun
ryrun / randomsteamwallpaper.cmd
Created August 20, 2017 16:36
Use a random steam screenhot as desktop background
@echo off
rem Initialize values
set /A a=16807, s=40
rem APA Modification: use current centiseconds for initial value
for /F "tokens=2 delims=," %%a in ("%time%") do if "%%a" neq "00" set /A s=1%%a %% 100
setlocal EnableDelayedExpansion
rem replace *** witht the correct numbers, where the screenshots are located
@ryrun
ryrun / simple_openproject_api_calls.php
Created February 12, 2020 08:29
Using OpenProject API in PHP, some exmaples
<?php
/**
The current openproject api is missing some exmaples. This is what i got working in PHP.
*/
function _request( $req, $postdata = false, $requesttype = 'POST' )
{
$ch = curl_init();
if ( preg_match( '~^/api/v3(.*)~', $req, $temp ) ) {
$req = $temp[ 1 ];
}
@ryrun
ryrun / autoreload.js
Last active March 3, 2020 10:15
Simple auto reload page on change, Live edit / Live preview
//pretty dirty autoreload script
var lastMod = [];
var files = [window.location.href];
var countReq = 0;
var hidden = false;
function __autoreload() {
var checkfiles = true;
if (document.hasFocus()) {
checkfiles = false;