From fb5fcff943fd0e4d019551029b13086b7423c734 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 15 Feb 2025 13:05:36 +0530 Subject: Add polyrhythms music generation --- 5-polyrhythms/main.ua | 29 +++++++++++++++++++++++++++++ 5-polyrhythms/output.mp4 | Bin 0 -> 380215 bytes 5-polyrhythms/output.wav | Bin 0 -> 8467268 bytes README.md | 7 ++++++- 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 5-polyrhythms/main.ua create mode 100644 5-polyrhythms/output.mp4 create mode 100644 5-polyrhythms/output.wav diff --git a/5-polyrhythms/main.ua b/5-polyrhythms/main.ua new file mode 100644 index 0000000..7e184ce --- /dev/null +++ b/5-polyrhythms/main.ua @@ -0,0 +1,29 @@ +Dn ← 0.6 # duration of a Ch in seconds +Bar ← 6 # duration of a bar in seconds +V ← 0.2 # volume +S ← &asr # sample rate + +JoinB ← ∧(⊂°□):[] ⇌ +Silence ← ×0⇡⌊×S +Fade ← × ⇌ ÷⟜(⇡)⧻. +Tone ← ×V /+∿ ⊞× : ×τ ÷⟜(⇡⌊×)S +MkNotes ← JoinB ≡(□ ⊂ (Fade Tone Dn °□⊣:) Silence°□⊢.) + +ChRoot ← ∵({(↥0 -Dn ÷:⊙: Bar) [330]}◌) ⇡. +ChN₁ ← ∵({(↥0 -Dn ÷:⊙: Bar) [415]}◌) ⇡. +ChN₂ ← ∵({(↥0 -Dn ÷:⊙: Bar) [220]}◌) ⇡. +ChN₃ ← ∵({(↥0 -Dn ÷:⊙: Bar) [247]}◌) ⇡. +# [E, G#, B, D] +Ch₁ ← ∵({(↥0 -Dn ÷:⊙: Bar) [330 415 493 293]}◌) ⇡. +# [A, C#, E, G] +Ch₂ ← ∵({(↥0 -Dn ÷:⊙: Bar) [220 277 324 392]}◌) ⇡. +# [B, D#, F#, A] +Ch₃ ← ∵({(↥0 -Dn ÷:⊙: Bar) [247 311 370 440]}◌) ⇡. + +Bar₁ ← ++ (MkNotes ChRoot 10) (MkNotes ChN₂ 6) (MkNotes Ch₂ 4) +Bar₂ ← ++ (MkNotes ChRoot 10) (MkNotes ChN₃ 6) (MkNotes Ch₃ 4) +Bar₃ ← ++ (MkNotes ChRoot 10) (MkNotes ChN₁ 6) (MkNotes Ch₁ 4) + +Samples ← ⊟. JoinB [Bar₁ Bar₂ Bar₃ Bar₂] +&ap Samples +&fwa "./5-polyrhythms/output.wav" audio "wav" S Samples diff --git a/5-polyrhythms/output.mp4 b/5-polyrhythms/output.mp4 new file mode 100644 index 0000000..cfcf6d3 Binary files /dev/null and b/5-polyrhythms/output.mp4 differ diff --git a/5-polyrhythms/output.wav b/5-polyrhythms/output.wav new file mode 100644 index 0000000..64274e6 Binary files /dev/null and b/5-polyrhythms/output.wav differ diff --git a/README.md b/README.md index b0e01a2..19be12e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,12 @@ - + +

+ Polyrhythms music generation +

+ https://github.com/phenax/uiua-playground/raw/refs/heads/main/5-polyrhythms/output.mp4 + -- cgit v1.3.1