http://mohayonao.github.io/CoffeeCollider/
- "Run" でコードを実行
- "Stop" で停止
- "Link" でコードをリンク化 (保存)
- "Compile" コンパイル後のコード(JavaScript)を表示
- サンプルコード読み込み
| { | |
| "0": "-----", | |
| "1": ".----", | |
| "2": "..---", | |
| "3": "...--", | |
| "4": "....-", | |
| "5": ".....", | |
| "6": "-....", | |
| "7": "--...", | |
| "8": "---..", |
| ////////////////////////////////////////////////////////////////////////// | |
| ( | |
| // analog bubbles | |
| { | |
| f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function | |
| CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4) // echoing sine wave | |
| }.play) | |
| ////////////////////////////////////////////////////////////////////////// |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import numpy | |
| def find_homography(src, dst): | |
| # X = (x*h0 +y*h1 + h2) / (x*h6 + y*h7 + 1) | |
| # Y = (x*h3 +y*h4 + h5) / (x*h6 + y*h7 + 1) | |
| # |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import re | |
| import sys | |
| import math | |
| import array | |
| import random | |
| import itertools | |
| import collections |
http://mohayonao.github.io/CoffeeCollider/
| (function() { | |
| "use strict"; | |
| global.AudioContext = global.AudioContext || global.webkitAudioContext; | |
| global.OfflineAudioContext = global.OfflineAudioContext || global.webkitOfflineAudioContext; | |
| if (typeof global.AudioContext !== "undefined") { | |
| if (typeof global.AudioContext.prototype.createGain !== "function") { | |
| global.AudioContext.prototype.createGain = global.AudioContext.prototype.createGainNode; | |
| } |
| let audioContext = new AudioContext(); | |
| let sched = new WebAudioScheduler({ | |
| context: audioContext | |
| }); | |
| function metronome(e) { | |
| sched.insert(e.playbackTime + 0.000, ticktack, { frequency: 880, duration: 1.00 }); | |
| sched.insert(e.playbackTime + 0.500, ticktack, { frequency: 440, duration: 0.05 }); | |
| sched.insert(e.playbackTime + 1.000, ticktack, { frequency: 440, duration: 0.05 }); | |
| sched.insert(e.playbackTime + 1.500, ticktack, { frequency: 440, duration: 0.05 }); |
| var path = ""; | |
| var callback = function(array) { | |
| console.log(array.length); | |
| }; | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open("GET", path); | |
| xhr.responseType = "arraybuffer"; // IE9はこれが効かない. | |
| xhr.onreadystatechange = function() { |
| import neume, { scapi } from "neume"; | |
| const neu = neume(); | |
| const { mul, SinOsc } = scapi; | |
| const hello = neu.def("hello", () => { | |
| const freq = ctl("freq"); | |
| SinOsc(freq)::mul(0.2); | |
| }); |