Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step-oriented functionality #1072

Merged
merged 41 commits into from
Apr 18, 2024
Merged

Step-oriented functionality #1072

merged 41 commits into from
Apr 18, 2024

Conversation

yaxu
Copy link
Member

@yaxu yaxu commented Apr 9, 2024

Alternative to beatmode backported from strudel - instead of having alternative representations based on embedded lists of beats, keep the same functional representation of cyclic time. Instead keep note of the tactus, aka the 'clapping rate' or number of steps per cycle.

  • steps
  • s_cat
  • s_nth
  • s_nth' / s_every
  • s_nthcycle
  • s_nthcycle' / s_everycycle
  • s_alt
  • s_taper
  • s_taperlist
  • s_expand
  • s_contract

Some examples:

-- the same as "bd sd mt ht lt" (not "[bd sd mt] [ht lt]")
d1 $ sound $ s_cat ["bd sd", "mt ht lt"]

-- repeat sequence, removing a step each time
d1 $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- play 8 steps per cycle
d1 $ steps 8 $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- taper the taper
d1 $ steps 8 $ s_taper $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- starts with tactus of 6 steps
tactus $ n "0 1 2 3 4 5" # sound "arpy"

-- tactus of 21 steps (triangular number of 6)
tactus $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- tactus of 231 steps (triangular number of 21)
tactus $ s_taper $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- Do something every n steps
d1 $ steps 8 $ s_nth 4 (# speed (-2)) $ n "0 1 2 3 4" # sound "arpy"

-- Jump forward two steps every 4th beat
d1 $ steps 8 $ s_nth 4 (2 <~) $ n "0 1 2 3 4" # sound "arpy"

-- The steps can expand!
d1 $ steps 8 $ s_nth 4 ((# (room 1 # sz 0.9)) . s_expand 6) $ n "0 1 2 3 4" # sound "arpy"

-- Alternate between elements in groups

d1 $ steps 8 $ sound $ s_alt [
    ["bd", "sd:6"],
    ["mt", "lt", "ht"],
    ["gretsch:3 gretsch:4", "gretsch:2", s_expand 3 "gretsch:1", "cp"]
  ]

-- Use s_taperlist to generate one of the groups
d1 $ steps 8 $ sound $ s_alt [
    s_taperlist "arpy:0 arpy:3 arpy:4 arpy:6",
    ["mt", "lt", "ht"],
    ["gretsch:3 gretsch:4", "gretsch:2", s_expand 3 "gretsch:1", "cp"]
  ]


-- You can pattern everything! But note the tactus of the resulting
-- pattern will be calculated from the first cycle. 

d1 $ steps 8 $ s_expand "4!2 3!2 2!2 1!2" $
  n (fast 1 "0 1 2 5 [3 4]") # sound "gretsch"
    # speed 1.5

d1 $ steps 8 $ s_sub "<[0 1 2 3 4] [4 3 2 1 0]>" $
  n (fast 1 "0 1 2 5 [3 4]") # sound "gretsch"
    # speed 1.5
-- the same as "bd sd mt ht lt" (not "[bd sd mt] [ht lt]")
d1 $ sound $ s_cat ["bd sd", "mt ht lt"]

-- repeat sequence, removing a step each time
d1 $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- play 8 steps per cycle
d1 $ steps 8 $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- taper the taper
d1 $ steps 8 $ s_taper $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- starts with tactus of 6 steps
tactus $ n "0 1 2 3 4 5" # sound "arpy"

-- tactus of 21 steps (triangular number of 6)
tactus $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- tactus of 231 steps (triangular number of 21)
tactus $ s_taper $ s_taper $ n "0 1 2 3 4 5" # sound "arpy"

-- Do something every n steps
d1 $ steps 8 $ s_nth 4 (# speed (-2)) $ n "0 1 2 3 4" # sound "arpy"

-- Jump forward two steps every 4th beat
d1 $ steps 8 $ s_nth 4 (2 <~) $ n "0 1 2 3 4" # sound "arpy"

-- The steps can expand!
d1 $ steps 8 $ s_nth 4 ((# (room 1 # sz 0.9)) . s_expand 6) $ n "0 1 2 3 4" # sound "arpy"

-- Alternate between elements in groups

d1 $ steps 8 $ sound $ s_alt [
    ["bd", "sd:6"],
    ["mt", "lt", "ht"],
    ["gretsch:3 gretsch:4", "gretsch:2", s_expand 3 "gretsch:1", "cp"]
  ]

-- Use s_taperlist to generate one of the groups
d1 $ steps 8 $ sound $ s_alt [
    s_taperlist "arpy:0 arpy:3 arpy:4 arpy:6",
    ["mt", "lt", "ht"],
    ["gretsch:3 gretsch:4", "gretsch:2", s_expand 3 "gretsch:1", "cp"]
  ]


-- You can pattern everything! But note the tactus of the resulting
-- pattern will be calculated from the first cycle. 

d1 $ steps 8 $ s_expand "4!2 3!2 2!2 1!2" $
  n (fast 1 "0 1 2 5 [3 4]") # sound "gretsch"
    # speed 1.5

d1 $ steps 8 $ s_sub "<[0 1 2 3 4] [4 3 2 1 0]>" $
  n (fast 1 "0 1 2 5 [3 4]") # sound "gretsch"
    # speed 1.5

@yaxu yaxu marked this pull request as draft April 9, 2024 14:31
@yaxu yaxu marked this pull request as ready for review April 11, 2024 09:28
@yaxu yaxu changed the title Tactus WIP Step-oriented functionality Apr 11, 2024
@yaxu yaxu merged commit 850fb7a into dev Apr 18, 2024
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants