From ce4613814f199f9e0a2e8a102cbfe1d9677e5f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E6=B5=A6=20=E7=9F=A5=E4=B9=9F=20Matsuura=20Tomoy?= =?UTF-8?q?a?= Date: Sun, 29 Oct 2023 18:14:14 +0900 Subject: [PATCH] [obsidian] vault backup: 2023-10-29 18:14:14[ --- content/Bytebeat.md | 73 +++++++++++++++++++ ...¢ã‚¢ãƒ¼ãƒˆãƒ»ãƒ—ログラミング2 リーディングリスト.md | 30 +++++++- content/授業ã«é–¢ã‚るメモ.md | 4 +- content/音楽プログラミング言語.md | 4 +- 4 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 content/Bytebeat.md diff --git a/content/Bytebeat.md b/content/Bytebeat.md new file mode 100644 index 00000000..768bec5e --- /dev/null +++ b/content/Bytebeat.md @@ -0,0 +1,73 @@ +#programming #music #sound + + + +[Algorithmic symphonies from one line of code -- how and why?(2011)](http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html) + + +https://youtu.be/tCRPUv8V22o + +Bytebeatã¯2011å¹´ã«[[viznut]]ãŒYoutube上ã®å‹•ç”»ã§å…¬é–‹ã—ã€è‡ªèº«ã®ãƒ–ログã®è§£èª¬ãªã©ã§åºƒãŒã£ã¦ã„ã£ãŸã€çŸ­ã„プログラムã§ã‚ªãƒ¼ãƒ‡ã‚£ã‚ªã‚’生æˆã™ã‚‹æŠ€æ³•ã€‚ + +[Algorithmic symphonies from one line of code -- how and why?(2011)](http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html) + +ãã®å¾Œã€Webブラウザ上ã§ã‚‚åŒæ§˜ã®ã‚³ãƒ¼ãƒ‰ã‚’実行ã§ãる環境ãŒã„ãã¤ã‹èª•ç”Ÿ + +[HTML5 Bytebeat](https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html) + +[Bytebeat Composer](https://sarpnt.github.io/bytebeat-composer) + +--- + +Bytebeatã¯å…ƒã€…次ã®ã‚ˆã†ãªC言語ã®ãƒ—ログラムã§ä½œã‚‰ã‚Œã¦ãŸã€‚ + +```c +main(t){for(;;t++)putchar(((t<<1)^((t<<1)+(t>>7)&t>>12))|t>>(4-(1^7&(t>>19)))|t>>7);} +``` + +ã“ã®C言語ã®ã‚³ãƒ¼ãƒ‰ã¯æ¥µé™ã¾ã§åœ§ç¸®ã•ã‚Œã¦ã„ã‚‹ã®ã§ã‚‚ã†ã¡ã‚‡ã£ã¨ä¸å¯§ã«æ›¸ãã¨ã“ã†ãªã‚Šã¾ã™ã€‚ + +```c +int main(int t){ + for(;;t++){ + putchar(((t<<1)^((t<<1)+(t>>7)&t>>12))|t>>(4-(1^7&(t>>19)))|t>>7); + } +} +``` + +ã“れをLinuxã®ã€æ˜”ãªã‚‰`/dev/dsp`ã€ä»Šãªã‚‰`aplay`ã®ã‚ˆã†ãªãƒ‘イプã§ç›´æŽ¥éŸ³å£°æ³¢å½¢ã‚’æµã—è¾¼ã‚ã‚‹ã‚‚ã®ã‚’使ã£ã¦éŸ³ã‚’鳴らã—ã¦ã„ãŸã€‚ + +macOSã§ã‚„ã‚ã†ã¨ã™ã‚‹ãªã‚‰ã€`ffmpeg`ã«ä»˜å±žã™ã‚‹`ffplay`ã§æ¬¡ã®ã‚ˆã†ãªã‚³ãƒ¼ãƒ‰ã§æ›¸ã‘ã‚‹ + +```sh +program | ffplay -f u8 -i pipe:0 -ar 44k -ac 1 +``` + +ã©ã†ã›ãªã‚‰C言語使ã‚ãšã«ãƒ‡ãƒ¼ã‚¿ã‚’生æˆã—ãŸã„ãŒã€ã‚·ã‚§ãƒ«ã‚¹ã‚¯ãƒªãƒ—トã§ç›´æŽ¥ãƒã‚¤ãƒŠãƒªã‚’扱ã†ã®ã¯æ­»ã¬ã»ã©ã ã‚‹ã„(`printf`コマンドや`bc`ã§ã‚ã‚Œã“ã‚Œã™ã‚Œã°ä¸å¯èƒ½ã§ã‚‚ãªã„ãŒã€çµå±€ãƒ•ã‚¡ã‚¤ãƒ«ã‚’一度経由ã—ãªã„ã¨åŽ³ã—ã„) + +ã®ã§ã€Node.jsã§ã‚„ã‚‹ã¨ã“ã†ã„ã†æ„Ÿã˜ã§ã§ãã‚‹ + +```js +const sample_rate = 8000; +const seconds = 1; +const length = sample_rate * seconds; +//メインã®æ›²ã®ç”Ÿæˆéƒ¨ +const bytebeat = t => + (((t >> 10 ^ t >> 11) % 5) * t >> 16) * ((t >> 14 & 3 ^ t >> 15 & 1) + 1) * t % 99 + ((3 + (t >> 14 & 3) - (t >> 16 & 1)) / 3 * t % 99 & 64); +let t = 0; + +const mainProcess = () =>{ + const data = Uint8Array.from({ length: length }, + (v, _t) => { + const res = bytebeat(t); + t += 1; + return res + } + ); + process.stdout.write(data); +}; +//å ´åˆã«ã‚ˆã£ã¦ã¯ã‚¤ãƒ³ã‚¿ãƒ¼ãƒãƒ«ã‚’å°‘ã—短ãã—ãªã„ã¨ãƒ‡ãƒ¼ã‚¿ä¸è¶³ã§è½ã¡ã‚‹ã“ã¨ã‚ã‚Š +setInterval(mainProcess,seconds / 1000.0); +``` + +ã“ã‚ŒãŒã†ã¾ãã„ãã®ã¯Javascriptã®æ•´æ•°å¤‰æ›å‡¦ç†ãŒ32bitã«ãªã£ãŸã‚Šã™ã‚‹ãŸã‚ãªã®ã ãŒã€è©³ã—ã„ã“ã¨ã¯[授業資料](https://teach.matsuuratomoya.com/docs/2023/mediaart-programming2/4/)ã«æ›¸ã„ãŸã€‚割愛ã™ã‚‹ã¨3238年間を超ãˆãªã‘ã‚Œã°é€£ç¶šå†ç”Ÿã—ã¦ã‚‚大丈夫ã¨ã„ã†ã“ã¨ã«ãªã‚‹ã£ã½ã„。 \ No newline at end of file diff --git a/content/メディアアート・プログラミング2 リーディングリスト.md b/content/メディアアート・プログラミング2 リーディングリスト.md index 6c3991db..1536c5c4 100644 --- a/content/メディアアート・プログラミング2 リーディングリスト.md +++ b/content/メディアアート・プログラミング2 リーディングリスト.md @@ -33,4 +33,32 @@ https://nickm.com/poems/concrete_perl/index.html SFPC_Malware_Anthology.zip A collection of boundary-pushing software art. by Todd Anderson 2023-02-07 -https://rhizome.org/editorial/2023/feb/07/sfpc_malware_anthologyzip/ \ No newline at end of file +https://rhizome.org/editorial/2023/feb/07/sfpc_malware_anthologyzip/ + +Scrapism + +https://scrapism.lav.io/ + +[[è°·å£æšå½¦]]ã•ã‚“ã®Study + +- http://okikata.org/study/test79/ å¾è¼©ã¯çŒ«ã§ã‚ã‚‹ã®åœ§ç¸® +- http://okikata.org/study/test77/ マラルメ + + +## キーワード + +[[具体詩]] [[コンクリート・ãƒã‚¨ãƒˆãƒªãƒ¼]] + + +## 雑ãªã‚¢ã‚¤ãƒ‡ã‚¢ + +Code poetry + +- é’空文庫ã‹ã‚‰ãƒ©ãƒ³ãƒ€ãƒ ã«ä½•ã‹ã‚’è½ã¨ã—ã¦ä½¿ã† +- ランダムãƒã‚¹ã ã‘ã§ã§ãる何㋠+- ç½®ãæ›ãˆã ã‘ã§ã§ãる何㋠+- ブラウザ拡張ã§ã§ãる何ã‹ï¼ˆèª­ç‚¹ã‚’全部!!ã«ç½®ãæ›ãˆã‚‹ã¿ãŸã„ãªã‚„ã¤ï¼‰ +- NLPç³»(npmã®ä½¿ã„方解説ã¤ã„ã§ã«) + - kuromoji使ㆠ+ - word2vec + - diff --git a/content/授業ã«é–¢ã‚るメモ.md b/content/授業ã«é–¢ã‚るメモ.md index 1e53e962..d8dfb583 100644 --- a/content/授業ã«é–¢ã‚るメモ.md +++ b/content/授業ã«é–¢ã‚るメモ.md @@ -1 +1,3 @@ -[[メディアアート・プログラミング2 リーディングリスト]] \ No newline at end of file +[[メディアアート・プログラミング2 リーディングリスト]] + +[[Bytebeat]] \ No newline at end of file diff --git a/content/音楽プログラミング言語.md b/content/音楽プログラミング言語.md index d3fbb006..62e21001 100644 --- a/content/音楽プログラミング言語.md +++ b/content/音楽プログラミング言語.md @@ -17,4 +17,6 @@ [[Cranelift]] -[[竹内関数ã§éŸ³æ¥½]] \ No newline at end of file +[[竹内関数ã§éŸ³æ¥½]] + +[[Bytebeat]] \ No newline at end of file