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
int val = 123; // 値を代入 | |
cout << "val: " << val << endl; // 値を表示 | |
cout << "&val: " << &val << endl; // 値が格納されているアドレスを表示 | |
int* ptr; // ポインタを作成 | |
ptr = &val; // ポインタにアドレスを格納 | |
cout << "ptr: " << ptr << endl; // 値が格納されているアドレスを表示 | |
cout << "*ptr: " << *ptr << endl; // ポインタに格納された値を表示 | |
int* intPtr = new int(); // Int型値を格納する領域をメモリーに新規生成 |
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
function setup() { | |
createCanvas(windowWidth, windowHeight); | |
colorMode(HSB, 360, 100, 100, 100); | |
locationX = width / 2; | |
locationY = height / 2; | |
velocityX = random(-50, 50); | |
velocityY = random(-50, 50); | |
} | |
function draw() { |
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
#include "ofApp.h" | |
void ofApp::setup() { | |
} | |
void ofApp::update() { | |
for (int i = 0; i < location.size(); i++) { | |
location[i] += velocity[i]; | |
if (location[i].x < 0 || location[i].x > ofGetWidth()) { | |
velocity[i].x *= -1; |
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
#include "ofApp.h" | |
void ofApp::setup() { | |
} | |
void ofApp::update() { | |
for (int i = 0; i < location.size(); i++) { | |
location[i] += velocity[i]; | |
if (location[i].x < 0 || location[i].x > ofGetWidth()) { | |
velocity[i].x *= -1; |
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
#include "ofApp.h" | |
void ofApp::setup() { | |
locationX = ofGetWidth() / 2.0; | |
locationY = ofGetHeight() / 2.0; | |
velocityX = ofRandom(-10, 10); | |
velocityY = ofRandom(-10, 10); | |
} | |
void ofApp::update() { |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Webcam Image Classification using a pre-trained customized model and p5.js</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<!-- Teachable Machine実行のためいろいろなJSライブラリーを読み込み --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.min.js"></script> | |
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js" type="text/javascript"></script> | |
</head> |
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
( | |
SynthDef("superdown", { | |
arg out = 0, sustain=1, gate = 1, amp = 1, freq, pitch1 = 0.3333333, voice = 800, clipAmount = 0.01, pan, decay=0; | |
var carFreq = freq; | |
var modFreq = freq * pitch1; | |
var modEnv = EnvGen.ar(Env.adsr(0.001, 0.2, 0.5, 0.0, peakLevel: voice), timeScale:sustain); | |
var pitchenv = EnvGen.kr(Env.new(levels: [1, 0], times: [2], curve: [-5]), timeScale:sustain, doneAction:2); | |
var mod = SinOsc.ar([modFreq, modFreq * 1.01]) * modEnv; | |
var car = SinOsc.ar((carFreq + mod) * pitchenv); | |
var env = EnvGen.ar(Env.pairs([[0,0],[0.1,1],[0.2,1-decay],[0.95,1-decay],[1,0]], -3), timeScale:sustain, doneAction: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
// 関数の定義、値の出力 | |
{"Hello World"}.value; | |
// 関数の定義、音の出力(Sin波) | |
{SinOsc.ar()}.play; | |
// Sin波の周波数の指定 (220Hz) | |
{SinOsc.ar(220)}.play; | |
// 左右2chに |
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
#Requires AutoHotkey v2.0 | |
;; | |
;; An autohotkey script that provides emacs-like keybinding on Windows | |
;; | |
;; global constants | |
DEBUG_MODE := 0 | |
;; global variables |
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
/* | |
* startup.scd - SuperDirt setup | |
* | |
*/ | |
s = Server.local; | |
s.reboot { | |
// s.options.device = "ASIO : ASIO Fireface USB"; | |
s.options.sampleRate = 96000; | |
s.options.numBuffers = 1024 * 256; // increase this if you need to load more samples |
NewerOlder