This file contains hidden or 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 torch | |
import sys | |
import math | |
from odak.learn.wave import propagate_beam, generate_complex_field, wavenumber, calculate_phase, calculate_amplitude, quadratic_phase_function | |
from odak.learn.tools import save_image, convolve2d | |
from odak.tools import check_directory, shell_command | |
from tqdm import tqdm | |
def generate(resolution, delay, distance=0.15, wavelength = 532e-9, pixel_pitch = 8e-6, propagation_type='TR Fresnel'): |
This file contains hidden or 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
''' | |
This is tested with an Ubuntu 19.10. I tested this script with %60 volume and a Bistee Smart WiFi Bulb E26 7W RGBW --> https://smile.amazon.com/gp/product/B07YDKD274/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 | |
(1) Assuming that you set the default input device on your machine as monitor of your soundcard (check input devices in `pavucontrol`). | |
(2) Assuming that you installed sounddevice, flux_led using pip3: sudo pip3 install sounddevice, flux_led . | |
(3) make sure that you set the ip address of your smart bulb correctly. Check ip_address line in this script. | |
(4) Simply run this script to make your light dance! | |
(5) If the light transition isn't good as you want, try playing with kd and kp variables in below. | |
''' | |
import sounddevice as sd |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
__author__ = ('Kaan Akşit') | |
__version__ = '0.1' | |
# Importing necessary libraries. | |
try: | |
import sys,glob,time,copy | |
import numpy as np |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
__author__ = ('Kaan Akşit') | |
__version__ = '0.1' | |
# Importing necessary libraries. | |
try: | |
import sys,time,os,datetime,logging | |
from kivy.logger import Logger |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
__author__ = ('Kaan Akşit') | |
try: | |
import sys,time | |
from array import array | |
from jnius import autoclass | |
from jnius import cast |