Skip to content

Instantly share code, notes, and snippets.

@ashitani
ashitani / irig_pad_layout.js
Last active January 7, 2023 09:29
Logic Pro X MIDI script to change iRig PADS key layout. / iRig PADSのレイアウトを変更するための Logic Pro X のMIDIスクリプト。
/*
Logic Pro X MIDI scripter script to change iRig PADS key layout.
*/
// functions
var notetable={"C":0,"C#":1,"Db":1,"D":2,"D#":3,"Eb":3,"E":4,"F":5,"F#":6,"Gb":6,"G":7,"G#":8,"Ab":8,"A":9,"A#":10,"Bb":10,"B":11};
function notename(name){let n = notetable[name.slice(0, name.length-1)];let o = name.slice(-1); return o*12+24+n;};
// ------------------------------------
// Device keymaps
@ashitani
ashitani / dearpygui_opencv.py
Created December 29, 2021 14:44
DearPyGUIとOpenCVのテスト。中央付近の平均値をプロットするようにした。
import dearpygui.dearpygui as dpg
import array
import cv2
import numpy as np
image_width = 320
image_height = 180
average_rect = (60,120,120,200) # y0,y1,x0,x1
def update_image(img):
@ashitani
ashitani / threebody.py
Created August 4, 2019 08:57
Simulation for the three-body problem
from vpython import *
import math
import numpy as np
class Bodies:
def __init__(self,num=3):
self.t = 0
self.fps = 30
self.dt = 1.0/(self.fps)

pybind11の簡単な使い方

install

pip install pybind11

usage

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashitani
ashitani / lightning.ipynb
Last active January 31, 2016 05:21
lightningという可視化ライブラリを試してみます。
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashitani
ashitani / interactive.ipynb
Last active January 31, 2016 05:23
ipywidgetというJupyterでUIを使えるライブラリを使ってみました。
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#from sympy.interactive import printing
#printing.init_printing()
from sympy import *
var("a,x")
eq1=2*x**2+3*x+1
plot(eq1)