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
# 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 |
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
# 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 |
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
# 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") |
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 pygame | |
import numpy as np | |
import time | |
class audioServer(): | |
channel = None | |
def __init__(self): |
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
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)) |
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
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) |
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 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): |
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 pyaudio | |
import alsaseq | |
import numpy as np | |
CHUNKSIZE = 1024*2 # fixed chunk size | |
# initialize portaudio | |
p = pyaudio.PyAudio() | |
stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, frames_per_buffer=CHUNKSIZE) |
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
# WSGI:n perus kirjasto | |
from wsgiref.simple_server import make_server | |
# Tätä funktiota kutsutaan aina, kun selain haluaa sivun | |
# environ: yleistä tietoutta: mitä sivua kysyttiin, millainen vempain jne jne jne | |
# start_response: funktio, jolla kerrotaan WSGIlle palautetun kaman tyyppi ja mahdolliset virheet | |
ilmoittautuneet = [] |
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 pyaudio | |
import numpy as np | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 1 | |
RATE = 44100 | |
CHUNK = 1024 | |
audio = pyaudio.PyAudio() |
OlderNewer