Humans are wired to spot patterns. Our ancestors survived by recognizing various footprints to avoid danger and find food, spots and dots on fur, rotational patterns of petals, cycles of the sun, moon, stars and repeating seasons, tides, and weather.

人間はパターンを見つけるようにできています。祖先たちは、様々な足跡を認識して危険を避けたり、食料を見つけたり、動物の毛皮の斑点や模様、花びらの回転パターン、太陽・月・星の周期、季節の移り変わり、潮の満ち引き、天候の変化などを理解したりして生き延びてきました。

Repeating patterns are fundamental to design and art. We see them everywhere, like in the repeating columns of ancient buildings, brick patterns, glass tiles on skyscrapers, and street pavements. Checkers, stripes, and other repeating motifs appear universally in decoration and textiles. Musicians create structure through rhythms, phrases, and chord cycles.

繰り返しのパターンはデザインや芸術の基本要素です。古代建築の柱列、レンガの模様、高層ビルのガラスタイル、街路の舗装など、周りにはパターンが溢れています。チェック柄、縞模様、その他の繰り返しのモチーフは装飾や織物に普遍的に見られ、音楽家たちはリズムや、フレーズ、コード進行を通じて音楽の構造を組み立てます。

Patterns are powerful vocabulary. Following patterns makes things predictable. It is often relaxing and comforting, but intense rhythm can also bring energy and even trance. Breaking a predictable rhythm creates tension, drawing people's attention, and going back and forth between tension and familiar patterns is a way to drive a song or a story.

パターンは力強い表現手段です。パターンに従うことで物事は予測可能となり、多くの場合、安らぎとリラックスをもたらす一方で、強烈なリズムはエネルギーや陶酔感を生み出すこともできます。予想通りのリズムを壊すことで生まれる緊張感によって注意を引いたり、緊張と馴染みのあるパターンを往復することが、楽曲や物語を展開させることができます。

<aside> 💡

This is an article to introduce various topics in Sketching with Code, illustrating the relationships between them and adding more context to provide a sort of overview. The articles are not in order of difficulty. Please just jump to whichever one interests you.

これは Sketching with Math and Quasi Physics 上の様々なトピックについて、それぞれの間の関係や概要を示したり、新たな文脈を加えたりするためのページです。難易度順には並んでいないので、興味のある記事から自由に読んでみてください。

</aside>

Repetition 繰り返し

At the basis of patterns is repetition. We recognize patterns because the same thing happens again and again.

パターンの基礎は繰り返しです。同じことが何度も起こるからこそ、私たちはパターンを認識できるのです。

There are many methods to create and handle repetitions mathematically and programmatically.

繰り返しを数学的にまたはプログラム的に作ったり扱う方法は数多くあります。

For example, modulo is basically a mathematical way of saying "count to $n$ then go back to one and repeat," which is just dividing a number by another number and taking the remainder. This is common in everyday life, like the time on a clock or the days of a week, and is a basis for many repeating patterns, such as repeating tiles and musical rhythms below.