Skip to content

Instantly share code, notes, and snippets.

View tomoyanonymous's full-sized avatar
🐈
meow

松浦 知也 Matsuura Tomoya tomoyanonymous

🐈
meow
View GitHub Profile
@tomoyanonymous
tomoyanonymous / path.js
Created March 20, 2015 16:02
Max/MSPでアプリ化しても使えるカレントディレクトリを吐き出すjsオブジェクト用ファイル
inlets = 1;
outlets = 1;
autowatch = 1;
function patchPath()
{
var patchPath = this.patcher.filepath;
var patchName = this.patcher.name + '.maxpat';
if(patchPath != patchName){
@tomoyanonymous
tomoyanonymous / dualmono2stereo.sh
Created July 17, 2016 12:01
Protoolsで出てきたデュアルモノラルファイルをステレオに変換する便利な奴
#Protoolsで出てきたデュアルモノラルファイルをステレオに変換する便利な奴
mkdir merged
array=($(find ./ -name '*.L.wav'))
outdir="merged"
for obj in "${array[@]}"; do
echo $obj
lwav=$obj
@tomoyanonymous
tomoyanonymous / norm_loudness.R
Last active September 28, 2016 05:52
sourceフォルダに48kHzのwavファイルを放り込むとdestにラウドネスノーマライズされて出てくるやつ(ITU−R BS1770,1771準拠)/ Loudness normalize 48kHz wav files from 'source' into 'dest'(based on ITU−R BS1770,1771)
library(tuneR)
library(signal)
if(!is.na(commandArgs(T)[1])){
isPrenormalize = commandArgs(T)[1] == "-normalize"
}else{
isPrenormalize=FALSE
}
@tomoyanonymous
tomoyanonymous / make_ogpimage.sh
Last active March 17, 2018 10:41
画像をOGP用(1200*630)に変換するやつ
#ファイル名、backgroundとかは適当に設定してくれ
echo "test.jpeg" | xargs -I{} bash -c 'convert -resize 1200x630 {} ogp_{} && convert -background white -gravity center -extent 1200x630 ogp_{} ogp_{}'
@tomoyanonymous
tomoyanonymous / scrapism-2.ipynb
Created September 25, 2018 16:46
SFPC scrapism week 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomoyanonymous
tomoyanonymous / Scrapism_week3.ipynb
Last active October 2, 2018 17:30
Scrapism Week3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomoyanonymous
tomoyanonymous / nlp-basic.ipynb
Created October 9, 2018 18:01
Scrapism-week4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
cd `dirname $0`
IFS='
'
for file in $(find content -type f -name index.*md ); do
echo $file
cppath=`echo $file|sed -E 's!(.*)/(.*\..*)!\1!g' `
for grep in $(cat $file | grep -e "JPG" -e "jpg" -e "png" -e "svg" -e "" ); do
echo "grepped $grep"
img=`echo $grep| sed -E 's!(.*)(\(| |"|/)(.*)(\.)([a-zA-Z]{3,4})(.*$)!\3\4\5!g' `
@tomoyanonymous
tomoyanonymous / reversedelay.dsp
Last active February 4, 2022 10:54
Reverse Delay written in Faust
declare name "reversedelay";
declare version "1.0";
declare author "Tomoya Matsuura";
declare license "MIT";
declare copyright "(c)Tomoya Matsuura 2019";
import("stdfaust.lib");
MAX_DELAY = 48000;
phasor_phase(dtime,phase)= ((os.lf_rawsaw(dtime)+phase)% dtime) :int; //phase shift in sample
indexphasor(dtime,phase) = phasor_phase(dtime*2,phase)<: <=(dtime),(*(-1)+dtime*2),_ : select2; //folded triangle
@tomoyanonymous
tomoyanonymous / closuretest.cpp
Last active November 11, 2019 08:45
memo: llvm mapping of lambda functions, closures and capture objects in clang++
#include <stdio.h>
int main(){
int a = 540;
float b = 460.1;
auto fun = [&](int x){
putchar(a);
putchar((int)b);
putchar(x);
};
fun(1);