within

From TidalCycles userbase
Revision as of 01:55, 19 November 2019 by Somehoax (talk | contribs) (Created page with "使用'''within'''將函數應用到圖式中的一部分。'''within'''接受兩個參數:起始和終止點(時序),兩者類型都是0和1之間的浮點數,...")
Jump to: navigation, search

Type: within :: Arc -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a

使用within將函數應用到圖式中的一部分。within接受兩個參數:起始和終止點(時序),兩者類型都是0和1之間的浮點數,且作用於相關的圖式。注意第二個參數(終止點)必須大於第一個(起始點)函數才能產生作用。

For example, to apply fast 2 to only the first half of a pattern:

d1 $ within (0, 0.5) (fast 2) $ sound "bd*2 sn lt mt hh hh hh hh"

Or, to apply (# speed "0.5") to only the last quarter of a pattern:

d1 $ within (0.75, 1) (# speed "0.5") $ sound "bd*2 sn lt mt hh hh hh hh"