Skip to content

Instantly share code, notes, and snippets.

View yo-to's full-sized avatar

Yosuke Toyota yo-to

View GitHub Profile
@yo-to
yo-to / GIST_test.md
Last active March 6, 2019 12:44
test

ファイルの編集のテスト

@yo-to
yo-to / webaudio_test0005
Last active January 1, 2016 14:49
Mac用 Firefox 26、Chrome 31 で音を鳴らす (メロディを奏でる〜修正版)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Web Audio API - test</title>
<script>
window.AudioContext = window.AudioContext ||
window.webkitAudioContext ||
window.mozAudioContext;
@yo-to
yo-to / webaudio_test0004
Last active December 30, 2015 14:39
Mac用 Firefox 25.0.1 のスクラッチパッドで音を鳴らす (矩形波、メロディを奏でる)
var ctx = new AudioContext();
var vol = ctx.createGain();
vol.gain.value = 0.2; // 0.0 - 1.0
vol.connect(ctx.destination);
osc_freq = new Array(0, 262, 294, 330, 349, 392, 440);
melody = new Array(
1, 2, 3, 0, 1, 2, 3, 0, 5, 3, 2, 1, 2, 3, 2, 0,
1, 2, 3, 0, 1, 2, 3, 0, 5, 3, 2, 1, 2, 3, 1, 0,
@yo-to
yo-to / webaudio_test0003
Last active December 30, 2015 14:29
Mac用 Firefox 25.0.1 のスクラッチパッドで音を鳴らす (矩形波、3つの音を連続で)
var ctx = new AudioContext();
var vol = ctx.createGain();
vol.gain.value = 0.2; // 0.0 - 1.0
vol.connect(ctx.destination);
osc = new Array(3);
osc_freq = new Array(262, 277, 330);
for(i=0; i<3; i++) {
osc[i] = ctx.createOscillator();
@yo-to
yo-to / webaudio_test0002
Last active December 30, 2015 14:19
Mac用 Firefox 25.0.1 のスクラッチパッドで音を鳴らす (矩形波、周波数 330Hz)
var ctx = new AudioContext();
var osc = ctx.createOscillator();
osc.type = 'square';
osc.frequency.value = 330;
var vol = ctx.createGain();
vol.gain.value = 0.2; // 0.0 - 1.0
osc.connect(vol);
vol.connect(ctx.destination);
osc.start(0);
osc.stop(1.5);
@yo-to
yo-to / webaudio_test0001
Last active December 30, 2015 14:09
Mac用 Firefox 25.0.1 のスクラッチパッドで音を鳴らす (矩形波、デフォルトの周波数)
var ctx = new AudioContext();
var osc = ctx.createOscillator();
osc.type = 'square';
var vol = ctx.createGain();
vol.gain.value = 0.2; // 0.0 - 1.0
osc.connect(vol);
vol.connect(ctx.destination);
osc.start(0);
osc.stop(1.5);