Skip to content

Instantly share code, notes, and snippets.

@chimanaco
chimanaco / TidalCycles.md
Last active September 15, 2020 07:42
TidalCycles practice

20200914

Rhythm in rhythm

d1 $ sound "bd:20 [glitch:6 [glitch:4 glitch:3]] [~ bd:20] hc"

Repeat

d1 $ sound "bd*2 [cp*2 hc*4]"
;; Example: Replicator
(defn path/replicator
[xform n path]
(->> (reduce #(conj % (mat2d/* (last %) xform))
[(mat2d/ident)]
(range (dec n)))
(map #(path/transform % path))))
:start-sketch
(background "aliceblue")
(defn mile
{:unit "mi"
:inverse (fn [mi] [(/ mi 1.6)])
}
[km]
(* km 1.6)
)
(background "pink")
; (+ 1 2)
; (prn (/ 1 2 3 4))
; (prn [1 0 0 1 86 -76.6875])
(def mod ^(assoc (meta mod) :inverse (fn [ret [a b]] [(mod ret b) b])) mod)
(defvar pos [-182 -150.6875])
// Switch Mode
Ctrl + 3 = Cut Mode
Ctrl + 4 = Edit Mode

// Split Clip
Ctrl + \

// Join  Clip
Alt + \
@chimanaco
chimanaco / tdsw-200614.md
Last active June 14, 2020 03:10
Code for TDSW workshop titled TouchDesigner 028 Remote lighting control via the internet

Example 1

op('Reset').run()

Example 2

op('Reset').run()
def main_pipeline(data, style_transform_path, width, height):
    output = data

    if torch.no_grad():
        # Get webcam input
        img = data

        # Free-up unneeded cuda memory
 torch.cuda.empty_cache()
@chimanaco
chimanaco / vscode-shortcut.md
Last active February 23, 2021 03:33
Visual Studio Code short cut

VS Code shortcuts for me

Copy line down/up

Shift + Alt + Up/Down

Go to end of line

End, Ctrl + End

Go to start of line

@chimanaco
chimanaco / Imagemagick.md
Last active December 24, 2020 18:37
ImageMagick

Use magick convert instead of convert in ImageMagick7 on Windows if you don't add change a PATH.

Resize to 512x512 in a 'square' folder

$ magick mogrify -resize 512x512 *.jpg -path ../512 *.jpg

convert all jpg(1280x720) to 720x720 in a 'square' folder

$ magick mogrify convert *.jpg -crop 720x720+280+0 -path ../square *.jpg $ magick mogrify -gravity center -crop 720x720+0+0 -path ../square *.png

Divide file into 2 files (left and right)

Run with Variables

op('text_switch').run(0)

index = args[0]
op('switch1').par.index = index

Run with Delay

op('Save').run(delayFrames = 60 )