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
#!/usr/bin/env python | |
# usage : python any2wav.py <inputfile> <outputfile> | |
import sys | |
import struct | |
def uint2ToStr(x) : return struct.pack('<H',x) | |
def uint4ToStr(x) : return struct.pack('<I',x) |
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 winsound | |
import time | |
frq = [392, 587, 659, 740, 784, 880, 988, 1047, 1175, 1319, 1480, 1568] | |
note = [-3, 1, 2, 3, 5, 4, 4, 6, 5, 5, 8, 7, | |
8, 5, 3, 1, 2, 3, 4, 5, 6, 5, 4, 3, | |
2, 3, 1, 0, 1, 2, -2, 0, 2, 4, 3, 2, | |
3, 1, 2, 3, 5, 4, 4, 6, 5, 5, 8, 7, | |
8, 5, 3, 1, 2, 3, -1, 5, 4, 3, 2, 1, | |
-2, 1, 0, 1, 3, 5, 8, 5, 3, 1, 3, 5, 8] |
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
/* | |
* オーディオ入力からログスケールのスペクトルを描画 | |
* Processing 3.0.1 要Soundライブラリ | |
*/ | |
import processing.sound.*; | |
int bands = 256; // バンド数 | |
int average = 4; // 移動平均数 | |
float minrange = -50.0; // 表示最小振幅 [dBFS] |
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
/* | |
* オーディオ入力の声紋を表示 | |
* Processing 3.0.1 要Soundライブラリ | |
*/ | |
import processing.sound.*; | |
int bands = 256; // バンド数 | |
float minrange = -60.0; // 表示最小振幅 [dBFS] |
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
# it's fucking noise | |
import sys | |
import random | |
import time | |
ROW = 32 | |
COLUMN = 64 | |
def clear_window(): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# ISBNコードが羅列されたテキストファイル<isbn_code.txt>から所蔵データを取得して, | |
# カンマ区切りのテキストファイル<rec_data.txt>を出力します. | |
# --- プログラムの利用について --- | |
# このプログラムは国立国会図書館サーチ(NDL Search)APIを利用します. | |
# サーバへの過負荷を避けるために,本プログラムの継続的な利用は避けてください. | |
# NDL Search APIの利用については次のURLを参照してください. |
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
# Twitter APIを使って指定したIDのツイートを一括でFavoriteする | |
from requests_oauthlib import OAuth1Session | |
import json | |
CK = 'xxxxxxxxxxxxxxxxxxxxxxxxx' # Consumer Key | |
CS = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # Consumer Secret | |
AT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # Access Token | |
AS = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # Accesss Token Secert |
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 numpy as np | |
from scipy import signal | |
import matplotlib.pyplot as plt | |
import soundfile as sf | |
indata, infrq = sf.read("indata.wav") | |
impulse, impfrq = sf.read("impulse.wav") | |
outdata_0 = signal.convolve(indata[:, 0], impulse[:, 0], mode="full") | |
outdata_1 = signal.convolve(indata[:, 1], impulse[:, 1], mode="full") |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
# 差分法(陽解法,陰解法,Crank-Nicolson法)による1次元非定常伝熱解析 | |
import numpy as np | |
from numpy import matlib | |
from numpy import linalg | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import axes3d |
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 os | |
import sys | |
import wave | |
import numpy as np | |
in_file = "amenbrother.wav" # 入力ファイル | |
out_filename_detail = True # 出力ファイル名にパラメータをつける | |
in_bar = 1 # 入力データの小節数 | |
out_bar = 8 # 出力データの小節数 |
OlderNewer