画像1

Attractor II #1

Akihiko YAMAZAWA
00:00 | 00:00
言語:COBOL 音源:SoundFont(Harp)
 
2枚の翼という名前があるアトラクターをプロットするためのデータをプログラムで生成し、10000個の(x,y) の値を2つのパートの音列にマッピングしています。

Attractor II
https://yamazawa.bandcamp.com/album/attractor-ii


[データ生成プログラム]

program-id. attractor2.

data division.
working-storage section.
01 i pic 9(6).
01 a pic s9v999999.
01 b pic s9v999999.
01 x0 comp-2.
01 x1 comp-2.
01 y0 comp-2.
01 y1 comp-2.
01 ad pic x(20).

procedure division.
display '2mai no tsubasa' upon syserr
display 'a=' upon syserr no advancing accept ad compute a = function numval(ad)
display 'b=' upon syserr no advancing accept ad compute b = function numval(ad)
compute x0 = 0.1 compute y0 = 0
perform varying i from 1 by 1 until i > 10000
compute x1 = y0 + a * x0 + (5 * x0 ** 2) / (1 + x0 ** 2) + 1 - 0.2 * function exp(-y0 ** 2)
compute y1 = -b * x0 + 5 * (-1 ** i)
display x1 ' ' y1
compute x0 = x1 compute y0 = y1
end-perform
exit program.

この記事が気に入ったらサポートをしてみませんか?