This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
import sounddevice as sd | |
import speech_recognition as sr | |
print(sd.query_devices()) # Displays all audio devices | |
patience = 0.1 | |
sample_rate = 44100 # CD-quality sample rate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based on this site https://github.com/smacke/pressure-softbody | |
float r = 10; | |
float grav = 1100;//gravity | |
float resolution = 30; | |
float dt = 0.01; | |
float mouseR = 200; | |
Softbody softbody; | |
void setup(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float boff; | |
void setup(){ | |
//size(1920, 1080, P3D); | |
fullScreen(P3D); | |
perspective(1, float(width)/float(height), 1.0, 60000.0); | |
} | |
void draw(){ | |
boff += 0.01; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coding Rainbow | |
// Daniel Shiffman | |
// http://patreon.com/codingtrain | |
// Code for: https://youtu.be/JcopTKXt8L8 | |
int leavesCount = 10000; | |
float pointSize = 10; | |
float lineWeight = 4; | |
float max_dist = 100; | |
float min_dist = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"name":"Liyue Battle Theme","type":"composed","bpm":400,"pitch":"C","version":3,"folderId":null,"data":{"isComposed":true,"isComposedVersion":true,"appName":"Genshin"},"breakpoints":[0],"instruments":[{"name":"Lyre","volume":90,"pitch":"","visible":true,"icon":"border","alias":"","muted":false},{"name":"Lyre","volume":90,"pitch":"","visible":true,"icon":"circle","alias":"","muted":false},{"name":"Lyre","volume":90,"pitch":"","visible":true,"icon":"line","alias":"","muted":false}],"columns":[[0,[[9,"1"],[19,"1"]]],[0,[]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[8,"1"]]],[0,[[9,"1"]]],[0,[[11,"1"]]],[0,[[19,"1"]]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[8,"1"]]],[0,[[9,"1"]]],[0,[[11,"1"]]],[0,[[19,"1"]]],[0,[[8,"1"]]],[0,[[19,"1"],[9,"1"]]],[0,[]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[9,"1"]]],[0,[]],[0,[[8,"1"]]],[0,[[9,"1"]]],[0,[[11,"1"]]],[0,[[19,"1"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float obstacleD = 250; | |
float obstacleW = 50; | |
float obstacleSpeed = 2; | |
float framePpipe = 200; | |
float forbiddenArea = 100; | |
float pulseVelocity = -10; | |
float g = 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//snake game | |
//make with queue | |
int cellSize = 25; | |
int wN, hN;//horizontal number of cell, vertical number of cell | |
ArrayList<PVector> history = new ArrayList<PVector>();//history of snake position | |
ArrayList<PVector> apples = new ArrayList<PVector>(); | |
PVector dir = new PVector(1, 0); | |
int speed = 10; | |
int score = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int diskN = 6;//number of disk | |
ArrayList<Step> steps = new ArrayList<Step>(); | |
int[][] disks = new int[3][diskN]; | |
int diskW, diskH; | |
int index = 0; | |
void setup(){ | |
size(1000, 500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage img; | |
float r;//kaleidoscope radius | |
float angle = radians(45);//" angle | |
float imgAngleOff = 0;//offset angle when uv mapping | |
void setup(){ | |
size(500, 500, P3D); | |
r = height/2; | |
img = loadImage("FujiPD.jpg"); | |
noStroke();textureMode(NORMAL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cell{ | |
int i, j; | |
float x, y; | |
int type; | |
boolean dead; | |
Cell(int i, int j){ | |
this.type = (int)random(4); | |
this.i = i; | |
this.j = j; |
NewerOlder