Difference between revisions of "scale"

From TidalCycles userbase
Jump to: navigation, search
Line 32: Line 32:
 
== Adding your own scales ==
 
== Adding your own scales ==
  
[[Type signature|Type]]: <source inline>getScale :: Num a => [(String, [a])] -> Pattern String -> Pattern Int -> Pattern a</source inline>
+
[[Type signature|Type]]: <source inline>getScale :: Num a => [(String, [a])] -> Pattern String -> Pattern Int -> Pattern a</source>
  
 
You can build your own `scale` function with additional scales if you wish, using <source inline>getScale</source>. For example:
 
You can build your own `scale` function with additional scales if you wish, using <source inline>getScale</source>. For example:

Revision as of 10:46, 16 March 2019

Not to be confused with range.

Type: scale :: Num a => Pattern String -> Pattern Int -> Pattern a

The scale function interprets a pattern of note numbers into a particular named scale.

For example:

d1 $ jux rev $ chunk 4 (fast 2 . (|- n 12)) $ off 0.25 (|+ 7) $ struct (iter 4 "t(5,8)")
  $ n (scale "ritusen" "0 .. 7") # sound "superpiano"

Please note that prior to Tidal version 1.0.0, scale had a very different function as a range operator. Veteran users will need to switch to using range for this functionality.

scaleList

Type: scaleList :: String

The scaleList function outputs all the available scales, at the time of writing:

minPent majPent ritusen egyptian kumai hirajoshi iwato chinese indian pelog 
prometheus scriabin gong shang jiao zhi yu whole augmented augmented2 hexMajor7 
hexDorian hexPhrygian hexSus hexMajor6 hexAeolian major ionian dorian phrygian 
lydian mixolydian aeolian minor locrian harmonicMinor harmonicMajor melodicMinor 
melodicMinorDesc melodicMajor bartok hindu todi purvi marva bhairav ahirbhairav 
superLocrian romanianMinor hungarianMinor neapolitanMinor enigmatic spanish 
leadingWhole lydianMinor neapolitanMajor locrianMajor diminished diminished2 
chromatic

Adding your own scales

Type: getScale :: Num a => [(String, [a])] -> Pattern String -> Pattern Int -> Pattern a

You can build your own `scale` function with additional scales if you wish, using getScale. For example:

let scale = getScale (scaleTable ++ [("techno", [0,2,3,5,7,8,10]),
                                     ("broken", [0,1,4,7,8,10])
                                    ])

The above takes the standard scaleTable as a starting point, and adds two custom scales to it.

==