- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| (ns tetris.core | |
| (:import (java.awt Color Dimension BorderLayout) | |
| (javax.swing JPanel JFrame JOptionPane JButton JLabel) | |
| (java.awt.event KeyListener)) | |
| (:use clojure.contrib.import-static deflayout.core | |
| clojure.contrib.swing-utils) | |
| (:gen-class)) | |
| (import-static java.awt.event.KeyEvent VK_LEFT VK_RIGHT VK_DOWN VK_UP VK_SPACE) |
| Add the script include-version-info.sh into a new run script build phase of your application target. The build phase | |
| should be located after the build phase "Copy Bundle Resources". |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
| /* OpenSimplex Noise in C# | |
| * Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19 | |
| * and heavily refactored to improve performance. */ | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Runtime.CompilerServices; | |
| namespace NoiseTest |
/****
A full script for creating a standalone app based on the current setup and config of a SuperCollider.app - tested with 3.7.0.
c Alberto de Campo 2016
HOW TO USE this:
| ///$(which true);FLAGS="-g -Wall -Wextra --std=c17 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $FLAGS "$THIS_FILE" -o "$OUT_FILE" || exit $?;exec bash -c "exec -a \"$0\" \"$OUT_FILE\" $([ $# -eq 0 ] || printf ' "%s"' "$@")" | |
| #include <stdio.h> | |
| int main() { | |
| printf("Hello world!\n"); | |
| return 0; | |
| } |
| SAMP : Singleton { | |
| classvar <>root, <>extensions, <>lazyLoading=true; | |
| var <paths, buffers, <channels, <foundRoot, <foundRootModTime, markersCache, atCache; | |
| var sortFunc; | |
| var metadata; | |
| *initClass { | |
| root = "~/Desktop".standardizePath; | |
| extensions = ["wav", "aiff", "aif", "flac", "ogg"]; | |
| } |
| ( | |
| SynthDef(\saw, { | |
| var env, sig; | |
| sig = Saw.ar( | |
| \freq.kr(440) * (\fmod.ar(0).midiratio * [-1, 1]), | |
| \amp.kr(1) | |
| ); | |
| env = Env.adsr(releaseTime: \release.kr(1)); | |
| env = env.kr( |
| // Only pull a value once per clock time - else, return the previous value | |
| PtimeClutch : FilterPattern { | |
| var <>delta; | |
| *new { | |
| |pattern, delta=0.0| | |
| ^super.new(pattern).delta_(delta); | |
| } | |
| embedInStream { |