ファイル: Desktop/test.scd
作業日: 2026-02-27
使用ツール: Claude Code (claude-sonnet-4-6)
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| import matplotlib_fontja | |
| import torch | |
| import torch.nn as nn | |
| # グラフの配色(見分けやすさを検証済みのパレット) | |
| C_BLUE = '#2a78d6' # 損失・確率バーの色 |
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 sys # コマンドライン引数(--record)の判定に使う | |
| import numpy as np # curl noiseを全粒子ぶん一括計算するために使う | |
| import py5 # py5(Processingのpython版)ライブラリを読み込む | |
| # --record付きで起動すると、フレームをPNG連番で保存して指定秒数で自動終了する。 | |
| # 保存後にffmpegで動画(H.265)に変換する想定(詳しくはREADME等を参照) | |
| RECORD = '--record' in sys.argv | |
| RECORD_FPS = 60 # 動画のフレームレート。draw()1回 = 動画の1フレームとして扱う | |
| RECORD_SECONDS = 15 # 書き出す長さ(秒) |
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
| font-family = "Jetbrains Mono Slashed" | |
| font-size = 16 | |
| background = #111111 | |
| background-opacity = 0.85 | |
| background-blur = true | |
| background-blur-radius = 100 | |
| macos-titlebar-style = transparent |
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 * as THREE from 'three'; | |
| import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; | |
| // ========== 3D Simplex Noise ========== | |
| // Stefan Gustavson のアルゴリズムに基づく実装 | |
| const F3 = 1.0 / 3.0; | |
| const G3 = 1.0 / 6.0; | |
| // 12方向のグラジェントベクトル |
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
| // FM変調合成 + Pbind サンプル | |
| // サーバーを起動 | |
| s.boot; | |
| Server.killAll; | |
| --- | |
| /* |
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
| // ===================================================================== | |
| // JITLib ライブコーディング | |
| // | |
| // 【JITLib の主要クラス】 | |
| // ProxySpace ─ ~ 変数を NodeProxy として管理する環境 | |
| // Ndef ─ サーバー側シンセの差し替え可能なプロキシ(音源・エフェクト用) | |
| // Pdef ─ イベントパターンの差し替え可能なプロキシ(Pbind 用) | |
| // Tdef ─ ルーティンの差し替え可能なプロキシ(Task/Routine 用) | |
| // | |
| // 【変数の設計】 |
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
| ( | |
| s.waitForBoot { | |
| // 倍音成分が時間と共に変化するFM楽器 | |
| SynthDef( | |
| \myFM, { | |
| // 引数: 出力バス, キャリア周波数, 音量, 周波数比, 最大モジュレーションインデックス | |
| // ADSR各パラメータ, ゲート(発音/消音の制御) | |
| |out=0, freq=440, amp=0.5, | |
| modRatio=1.5, modIndex=10, | |
| attack=0.01, decay=1.0, sustain=0.3, release=1.5, |
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
| // 倍音成分が時間と共に変化するFM楽器 | |
| ( | |
| SynthDef( | |
| \myFM, { | |
| // 引数: 出力バス, キャリア周波数, 音量, 周波数比, 最大モジュレーションインデックス | |
| // ADSR各パラメータ, ゲート(発音/消音の制御) | |
| |out=0, freq=440, amp=0.5, | |
| modRatio=1.5, modIndex=10, | |
| attack=0.01, decay=1.0, sustain=0.3, release=1.5, | |
| gate=1| |
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 yfinance as yf | |
| import matplotlib.pyplot as plt | |
| import matplotlib | |
| from datetime import datetime, timedelta | |
| import numpy as np | |
| from sklearn.linear_model import LinearRegression | |
| from sklearn.preprocessing import PolynomialFeatures | |
| from sklearn.metrics import r2_score, mean_squared_error | |
| from scipy import stats | |
| import pandas as pd |
NewerOlder