Skip to content

Instantly share code, notes, and snippets.

import pygame
import numpy as np
def eventGenerator(eventcode, bufferSize): # Event loop; wait while PyGame is OK, yield to the signal generator when pygame asks for signal
# Buffer
for chunk in range(bufferSize):
from PIL import Image
import numpy as np
import random
from multiprocessing import Pool
def f(taajuus):
w = (512 * np.sqrt(3))*2
h = (512 + np.sqrt(3)*128)*2
data = np.zeros((h, w, 3)).astype(np.float32)
from PIL import Image
import numpy as np
import random
w = h = 1024
data = np.zeros((h, w, 3), dtype=np.uint8)
parallellism = 2048
point = np.random.rand(parallellism).reshape((parallellism//2,2))
import pygame
import numpy as np
import time
class audioServer():
channel = None
def __init__(self):
# Blender addon sorcery
bl_info = {"name": "Audionodes", "description":"Create complex soundscapes in real time using nodes.", "author":"Roope Salmi, Théo Friberg", "version":(0,1), "blender":(2,77,0), "location":"Node Editor > Sound Icon > Add new", "warning":"Very much alpha, may blow up in your face.", "category": "Node", "tracker_url":"https://github.com/nomelif/Audionodes/issues", "wiki_url":"https://github.com/nomelif/Audionodes"}
import bpy
import numpy as np
import time
from bpy.types import NodeTree, Node, NodeSocket, NodeSocketFloat
@nomelif
nomelif / setup.py
Last active November 30, 2016 16:34
# Setup parameters to work in userspace
import sys
import os
import tempfile
import urllib.request
get_pip = urllib.request.urlopen("https://bootstrap.pypa.io/get-pip.py").read()
sys.argv.append("--user")
# Vaatii pip-asennukset
# sudo pip install PyAudio
# sudo pip install SpeechRecognition
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
r.adjust_for_ambient_noise(source) # Kuuntelee sekunnin ja yrittää päätellä taustamelun tason
@nomelif
nomelif / OSL Mason.c
Last active December 8, 2019 20:18
Osl brick shader
// Copyright (c) 2016 Théo Friberg
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE O