知识库



按索引浏览词汇表

特殊 | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | 全部

页:  1  2  3  (下一个)
  全部

A

ASCII 码对照表详解

ASCII 码对照表详解

计算机是美国发明的,当初并没有考虑后来需要增加那么多字符,比如中国的汉字,那么早期的美国常用字符,用 1 个字节的前 7 个位来表示,已经足够了,这样就产生了ASCII 码,后来就不够用了,第 8 位也被扩展使用了,就增加了一些字符,这也就多了扩展的 ASCII 码。

ASCII 码和扩展的 ASCII 码

ASCII 码即美国标准信息交换码 (American Standard Code for Information Interchange)

是基于罗马字母表的一套电脑编码系统。 一种使用 7 个或 8 个二进制位进行编码的方案,最多可以给 256 个字符(包括字母、数字、标点符号、控制字符及其他符号)分配或指定数值。

名称的由来

ASCII(American Standard Code for Information Interchange,美国信息互换标准代码)是基于罗马字母表的一套电脑编码系统。

特点

它主要用于显示现代英语和其他西欧语言。它是现今最通用的单字节编码系统,并等同于国际标准 ISO 646。

包含内容

控制字符:回车键、退格、换行键等。
可显示字符:英文大小写字符、阿拉伯数字和西文符号

技术特征

7 位(bits)表示一个字符,共 128 字符

ASCII 扩展字符集

7 位编码的字符集只能支持 128 个字符,为了表示更多的欧洲常用字符,对 ASCII 进行了扩展,ASCII 扩展字符集使用 8 位(bits)表示一个字符,共 256 字符。

ASCII 扩展字符集比 ASCII 字符集扩充出来的符号包括表格符号、计算符号、希腊字母和特殊的拉丁符号。

注意:在计算机的存储单元中,一个 ASCII 码值占一个字节(8个二进制位),其最高位(b7)用作奇偶校验位。所谓奇偶校验,是指在代码传送过程中用来检验是否出现错误的一种方法,一般分奇校验和偶校验两种。

  • 奇校验规定:正确的代码一个字节中 1 的个数必须是奇数,若非奇数,则在最高位 b7 添 1
  • 偶校验规定:正确的代码一个字节中 1 的个数必须是偶数,若非偶数,则在最高位 b7 添 1

计算机只能理解数字,因此一个 ASCII 码就是一个字符, 如 a 或 @ 的数字表现形式,也可表示某种动作。ASCII 码出现较早,非打印字符的使用也不再出于最初的目的。以下是ASCII码字符表,其中包括对前 32 个非打印字符的描述。当初设计 ASCII 码实际上是为了使用电传打字机,因此这些描述不好理解。如果有人说想要你的成绩单,但要用 ASCII 格式,这就意味着他们只想要不带诸如加粗,下划线等格式的纯文本,也就是计算能理解的最原始的格式。这样就比较容易输入计算机进行处理。记事本可以创建 ASCII 码文本,在 Word 中你也可以把文件保存为纯文本。

ASCII码字符表结构组成

第 0~32 号及第 127 号(共 34 个)是控制字符或通讯专用字符,如控制符 LF(换行)、CR(回车)、FF(换页)、DEL(删除)、BEL(振铃)等,通讯专用字符 SOH(文头)、EOT(文尾)、ACK(确认)等。

第 33~126 号(共94个)是字符,其中第 48~57 号为 0~9 十个阿拉伯数字,65~90 号为 26 个大写英文字母,97~122 号为 26 个小写英文字母,其余为一些标点符号、运算符号等。

第一部分 ASCII 非打印控制字符表

ASCII 表上的数字 0–31 分配给了控制字符,用于控制像打印机等一些外围设备。例如 12 代表换页/新页功能。此命令指示打印机跳到下一页的开头。(参详 ASCII 码表中 0-31 )

ASCII 码表中 0-31


第二部分 ASCII 打印字符

数字 32–126 分配给了能在键盘上找到的字符,当您查看或打印文档时就会出现。数字 127 代表 DELETE 命令。(参详 ASCII 码表中 32-127)

ASCII 码表中 32-127


第三部分 扩展 ASCII 打印字符

扩展的 ASCII 字符满足了对更多字符的需求。扩展的 ASCII 包含 ASCII 中已有的 128 个字符(数字 0–32 显示在下图中),又增加了 128 个字符,总共是 256 个。即使有了这些更多的字符,许多语言还是包含无法压缩到 256 个字符中的符号。因此出现了一些 ASCII 的变体来囊括地区性字符和符号。例如许多软件程序把 ASCII 表(又称作 ISO8859-1 )用于北美、西欧、澳大利亚和非洲的语言。





C

CSS之display

1.解释一下display的几个常用的属性值,inline , block, inline-block, none

  • inline(行内元素):
  1. 使元素变成行内元素,拥有行内元素的特性,即可以与其他行内元素共享一行,不会独占一行.
  2. 不能更改元素的height,width的值,大小由内容撑开.
  3. 可以使用padding上下左右都有效,margin只有left和right产生边距效果,但是top和bottom就不行.
  • block(块级元素):
  1. 使元素变成块级元素,独占一行,在不设置自己的宽度的情况下,块级元素会默认填满父级元素的宽度.
  2. 能够改变元素的height,width的值.
  3. 可以设置padding,margin的各个属性值,top,left,bottom,right都能够产生边距效果.
  • inline-block(融合行内于块级):
  1. 结合了inline与block的一些特点,结合了上述inline的第1个特点和block的第2,3个特点.
  2. 用通俗的话讲,就是不独占一行的块级元素。如图:

图二:

两个图可以看出,display:inline-block后块级元素能够在同一行显示,有人这说不就像浮动一样吗。没错,display:inline-block的效果几乎和浮动一样,但也有不同,接下来讲一下inline-block和浮动的比较。

2.inline-block布局 vs 浮动布局

a.不同之处:对元素设置display:inline-block ,元素不会脱离文本流,而float就会使得元素脱离文本流,且还有父元素高度坍塌的效果

b.相同之处:能在某程度上达到一样的效果

  我们先来看看这两种布局:
图一:display:inline-block

图二:对两个孩子使用float:left,我在上一篇浮动布局讲过,这是父元素会高度坍塌,所以要闭合浮动,对box使用overflow:hidden,效果如下:

>>乍一看两个都能做到几乎相同的效果,(仔细看看display:inline-block中有间隙问题,这个留到下面再讲)

  c.浮动布局不太好的地方:参差不齐的现象,我们看一个效果:
图三:

图四:

>>从图3,4可以看出浮动的局限性在于,若要元素排满一行,换行后还要整齐排列,就要子元素的高度一致才行,不然就会出现图三的效果,而inline-block就不会。

3.inline-block存在的小问题:

  a.上面可以看到用了display:inline-block后,存在间隙问题,间隙为4像素,这个问题产生的原因是换行引起的,因为我们写标签时通常会在标签结束符后顺手打个回车,而回车会产生回车符,回车符相当于空白符,通常情况下,多个连续的空白符会合并成一个空白符,而产生“空白间隙”的真正原因就是这个让我们并不怎么注意的空白符。

  b.去除空隙的方法:
  1.对父元素添加,{font-size:0},即将字体大小设为0,那么那个空白符也变成0px,从而消除空隙
  现在这种方法已经可以兼容各种浏览器,以前chrome浏览器是不兼容的
图一:

c.浏览器兼容性:ie6/7是不兼容 display:inline-block的所以要额外处理一下:

  在ie6/7下:

  对于行内元素直接使用{dislplay:inline-block;}

  对于块级元素:需添加{display:inline;zoom:1;}

4.总结:

  display:inline-block的布局方式和浮动的布局方式,究竟使用哪个,我觉得应该根据实际情况来决定的:
  a.对于横向排列东西来说,我更倾向与使用inline-block来布局,因为这样清晰,也不用再像浮动那样清除浮动,害怕布局混乱等等。
  b.对于浮动布局就用于需要文字环绕的时候,毕竟这才是浮动真正的用武之地,水平排列的是就交给inline-block了。



H

HSB颜色模式

HSB又称HSV,表示一种颜色模式:在HSB模式中,H(hues)表示色相,S(saturation)表示饱和度,B(brightness)表示亮度。

HSB是色相、饱和度、明度的相应英文首字母缩写。

平常表述颜色时,一般用的就是HSB模式,因为人眼看到的就是色相、饱和度、明度,HSB模式对应的媒介是人眼。

1、色相(H,hue)在0~360°的标准色轮上,色相是按位置度量的。在通常的使用中,色相是由颜色名称标识的,比如红、绿或橙色。黑色和白色无色相。

红:0度或者360度
黄:300度
绿:240度
青:180度
蓝:120度
洋红:60度




2、饱和度(S,saturation):表示色彩的纯度,饱和度为0时为灰色。白、黑和其他灰色色彩都没有饱和度的。饱和度高,色彩鲜艳,在最大饱和度时,每一色相具有最纯的色光。取值范围在0-100之间。



3、亮度(B,brightness或V,value):是色彩的明亮度,表示色彩的明暗程度。为0时即为黑色。最大亮度是色彩最鲜明的状态。取值范围在0-100之间。





HTML Colors


颜色名列表

本页提供了被大多数浏览器支持的颜色名。

提示:W3C 的 HTML 4.0 标准仅支持 16 种颜色名,它们是:aqua、black、blue、fuchsia、gray、green、lime、maroon、navy、olive、purple、red、silver、teal、white、yellow。

如果使用其它颜色的话,就应该使用十六进制的颜色值


颜色名 十六进制颜色值 颜色
AliceBlue #F0F8FF  
AntiqueWhite #FAEBD7  
Aqua #00FFFF  
Aquamarine #7FFFD4  
Azure #F0FFFF  
Beige #F5F5DC  
Bisque #FFE4C4  
Black #000000  
BlanchedAlmond #FFEBCD  
Blue #0000FF  
BlueViolet #8A2BE2  
Brown #A52A2A  
BurlyWood #DEB887  
CadetBlue #5F9EA0  
Chartreuse #7FFF00  
Chocolate #D2691E  
Coral #FF7F50  
CornflowerBlue #6495ED  
Cornsilk #FFF8DC  
Crimson #DC143C  
Cyan #00FFFF  
DarkBlue #00008B  
DarkCyan #008B8B  
DarkGoldenRod #B8860B  
DarkGray #A9A9A9  
DarkGreen #006400  
DarkKhaki #BDB76B  
DarkMagenta #8B008B  
DarkOliveGreen #556B2F  
Darkorange #FF8C00  
DarkOrchid #9932CC  
DarkRed #8B0000  
DarkSalmon #E9967A  
DarkSeaGreen #8FBC8F  
DarkSlateBlue #483D8B  
DarkSlateGray #2F4F4F  
DarkTurquoise #00CED1  
DarkViolet #9400D3  
DeepPink #FF1493  
DeepSkyBlue #00BFFF  
DimGray #696969  
DodgerBlue #1E90FF  
Feldspar #D19275  
FireBrick #B22222  
FloralWhite #FFFAF0  
ForestGreen #228B22  
Fuchsia #FF00FF  
Gainsboro #DCDCDC  
GhostWhite #F8F8FF  
Gold #FFD700  
GoldenRod #DAA520  
Gray #808080  
Green #008000  
GreenYellow #ADFF2F  
HoneyDew #F0FFF0  
HotPink #FF69B4  
IndianRed #CD5C5C  
Indigo #4B0082  
Ivory #FFFFF0  
Khaki #F0E68C  
Lavender #E6E6FA  
LavenderBlush #FFF0F5  
LawnGreen #7CFC00  
LemonChiffon #FFFACD  
LightBlue #ADD8E6  
LightCoral #F08080  
LightCyan #E0FFFF  
LightGoldenRodYellow #FAFAD2  
LightGrey #D3D3D3  
LightGreen #90EE90  
LightPink #FFB6C1  
LightSalmon #FFA07A  
LightSeaGreen #20B2AA  
LightSkyBlue #87CEFA  
LightSlateBlue #8470FF  
LightSlateGray #778899  
LightSteelBlue #B0C4DE  
LightYellow #FFFFE0  
Lime #00FF00  
LimeGreen #32CD32  
Linen #FAF0E6  
Magenta #FF00FF  
Maroon #800000  
MediumAquaMarine #66CDAA  
MediumBlue #0000CD  
MediumOrchid #BA55D3  
MediumPurple #9370D8  
MediumSeaGreen #3CB371  
MediumSlateBlue #7B68EE  
MediumSpringGreen #00FA9A  
MediumTurquoise #48D1CC  
MediumVioletRed #C71585  
MidnightBlue #191970  
MintCream #F5FFFA  
MistyRose #FFE4E1  
Moccasin #FFE4B5  
NavajoWhite #FFDEAD  
Navy #000080  
OldLace #FDF5E6  
Olive #808000  
OliveDrab #6B8E23  
Orange #FFA500  
OrangeRed #FF4500  
Orchid #DA70D6  
PaleGoldenRod #EEE8AA  
PaleGreen #98FB98  
PaleTurquoise #AFEEEE  
PaleVioletRed #D87093  
PapayaWhip #FFEFD5  
PeachPuff #FFDAB9  
Peru #CD853F  
Pink #FFC0CB  
Plum #DDA0DD  
PowderBlue #B0E0E6  
Purple #800080  
Red #FF0000  
RosyBrown #BC8F8F  
RoyalBlue #4169E1  
SaddleBrown #8B4513  
Salmon #FA8072  
SandyBrown #F4A460  
SeaGreen #2E8B57  
SeaShell #FFF5EE  
Sienna #A0522D  
Silver #C0C0C0  
SkyBlue #87CEEB  
SlateBlue #6A5ACD  
SlateGray #708090  
Snow #FFFAFA  
SpringGreen #00FF7F  
SteelBlue #4682B4  
Tan #D2B48C  
Teal #008080  
Thistle #D8BFD8  
Tomato #FF6347  
Turquoise #40E0D0  
Violet #EE82EE  
VioletRed #D02090  
Wheat #F5DEB3  
White #FFFFFF  
WhiteSmoke #F5F5F5  
Yellow #FFFF00  
YellowGreen #9ACD32  

HTML图形字符

HTML图形特殊字符集 

使用方法:
这些字符属于unicode字符集,所以,你的文档需要声明为UTF-8;
下面符号列表的后面有两列编号,它们并不太一样,第一列是用于HTML的,你需要在前面加上&#符号; 例如:&#8672
第二列可以用于CSS文件中,但是需要用反斜杠\转义;  例如:\8672
第二列也可以用于JavaScript,和CSS用法一样,不过要用\u来转义。
需要注意的是:


有的字符在不同的浏览器下表现不太一样;比如小雪人 ☃ 在Firefox和Chrome下不太一样,钻石 ◆ 在IE下要比Chrome下要大一点儿;
有的字符在某个浏览器下不会显示;当然原因并不是字符代码的问题,而是浏览器的bug,比如,–在Chrome下。。。
但是,98%的字符都能在所有浏览器下正常显示的,不过如果你真的要使用,最好仔细在各个浏览器下验证一番。
经测试这些字符在Android/iOS等智能终端的识别度比较差,所以,使用的时候要特别注意移动浏览器~~
各种箭头

⇠ 8672 21E0
⇢ 8674 21E2
⇡ 8673 21E1
⇣ 8675 21E3
↞ 8606 219E
↠ 8608 21A0
↟ 8607 219F
↡ 8609 21A1
← 8592 2190
→ 8594 2192
↑ 8593 2191
↓ 8595 2193
↔ 8596 2194
↕ 8597 2195
⇄ 8644 21C4
⇅ 8645 21C5
↢ 8610 21A2
↣ 8611 21A3
⇞ 8670 21DE
⇟ 8671 21DF
↫ 8619 21AB
↬ 8620 21AC
⇜ 8668 21DC
⇝ 8669 21DD
↚ 8602 219A
↛ 8603 219B
↮ 8622 21AE
↭ 8621 21AD
形状
⇦ 8678 21E6
⇨ 8680 21E8
⇧ 8679 21E7
⇩ 8681 21E9
↷ 8631 21B7
↶ 8630 21B6
↻ 8635 21BB
↺ 8634 21BA
⟳ 10227 27F3
⟲ 10226 27F2
⟰ 10224 27F0
⟱ 10225 27F1
↵ 8629 21B5
↯ 8623 21AF
⇵ 8693 21F5
向右的箭头
➔ 10132 2794
➙ 10137 2799
➨ 10152 27A8
➲ 10162 27B2
➜ 10140 279C
➞ 10142 279E
➟ 10143 279F
➠ 10144 27A0
➤ 10148 27A4
➥ 10149 27A5
➦ 10150 27A6
➧ 10151 27A7
➵ 10165 27B5
➸ 10168 27B8
➼ 10172 27BC
➽ 10173 27BD
➺ 10170 27BA
➳ 10163 27B3
➾ 10174 27BE
基本形状
▲ 9650 25B2
► 9658 25BA
▼ 9660 25BC
◄ 9668 25C4
❤ 10084 2764
✈ 9992 2708
★ 9733 2605
✦ 10022 2726
☀ 9728 2600
◆ 9670 25C6
◈ 9672 25C8
▣ 9635 25A3
标点
« 171 00AB
» 187 00BB
‹ 139 008B
› 155 009B
“ 8220 201C
” 8221 201D
‘ 8216 2018
’ 8217 2019
• 8226 2022
◦ 9702 25E6
¡ 161 00A1
¿ 191 00BF
℅ 8453 2105
№ 8470 2116
& 38 0026
@ 64 0040
℞ 8478 211E
℃ 8451 2103
℉ 8457 2109
° 176 00B0
| 124 007C
¦ 166 00A6
– 8211 2013
— 8212 2014
… 8230 2026
¶ 182 00B6
∼ 8764 223C
≠ 8800 2260
法律符号
® 174 00AE
© 169 00A9
℗ 8471 2117
™ 153 0099
℠ 8480 2120
货币
$ 36 0024
¢ 162 00A2
£ 163 00A3
¤ 164 00A4
€ 8364 20AC
¥ 165 00A5
₱ 8369 20B1
₹ 8377 20B9
数学
½ 189 00BD
¼ 188 00BC
¾ 190 00BE
⅓ 8531 2153
⅔ 8532 2154
⅛ 8539 215B
⅜ 8540 215C
⅝ 8541 215D
‰ 8240 2030
% 37 0025
< 60 003C
> 62 003E
音乐符号
♩ 9833 2669
♪ 9834 266A
♫ 9835 266B
♬ 9836 266C
♭ 9837 266D
♯ 9839 266F
对号、错号
160 00A0
☐ 9744 2610
☑ 9745 2611
☒ 9746 2612
✓ 10003 2713
✔ 10004 2714
✕ 10005 10005
✖ 10006 2716
✗ 10007 2717
✘ 10008 2718
十字
☨ 9768 2628
☩ 9769 2629
✝ 10013 271D
✞ 10014 271E
✟ 10015 271F
✠ 10016 2720
✚ 10010 271A
† 8224 2020
✢ 10018 2722
✤ 10020 2724
✣ 10019 2723
✥ 10021 2725
星星、星号、雪花
★ 9733 2605
✭ 10029 272D
✮ 10030 272E
☆ 9734 2606
✪ 10026 272A
✡ 10017 2721
✯ 10031 272F
✵ 10037 2735
✶ 10038 2736
✸ 10040 2738
✹ 10041 2739
✺ 10042 273A
✱ 10033 2731
✲ 10034 2732
✴ 10036 2734
✳ 10035 2733
✻ 10043 273B
✽ 10045 273D
❋ 10059 274B
❆ 10054 2746
❄ 10052 2744
❅ 10053 2745
杂项
☻ 9787 263B
☺ 9786 263A
☹ 9785 2639
✉ 9993 2709
☎ 9742 260E
☏ 9743 260F
✆ 9990 2706
� 65533 FFFD
☁ 9729 2601
☂ 9730 2602
❄ 10052 2744
☃ 9731 2603
❈ 10056 2748
✿ 10047 273F
❀ 10048 2740
❁ 10049 2741
☘ 9752 2618
❦ 10086 2766
☕ 9749 9749
❂ 10050 2742
☥ 9765 2625
☮ 9774 262E
☯ 9775 262F
☪ 9770 262A
☤ 9764 2624
✄ 9988 2704
✂ 9986 2702
☸ 9784 2638
⚓ 9875 2693
☣ 9763 2623
⚠ 9888 26A0
⚡ 9889 26A1
☢ 9762 2622
♻ 9851 267B
♿ 9855 267F
☠ 9760 2620
手型、铅笔、笔
☜ 9756 261C
☞ 9758 261E
☝ 9757 261D
☟ 9759 261F
✌ 9996 270C
✍ 9997 270D
✎ 9998 270E
✐ 10000 2710
✏ 9999 270F
✑ 10001 2711
✒ 10002 2712
天空、植物
☽ 9789 263D
☾ 9790 263E
♂ 9794 2642
♀ 9792 2640
☿ 9791 263F
♁ 9793 2641
♃ 9795 2643
♄ 9796 2644
♅ 9797 2645
♆ 9798 2646
♇ 9799 2647
星座
♈ 9800 2648
♉ 9801 2649
♊ 9802 264A
♋ 9803 264B
♌ 9804 264C
♍ 9805 264D
♎ 9806 264E
♏ 9807 264F
♑ 9809 2651
♒ 9810 2652
♓ 9811 2653
象棋,扑克牌
♚ 9818 265A
♛ 9819 265B
♜ 9820 265C
♝ 9821 265D
♞ 9822 265E
♟ 9823 265F
♔ 9812 2654
♕ 9813 2655
♖ 9814 2656
♗ 9815 2657
♘ 9816 2658
♙ 9817 2659
♠ 9824 2660
♣ 9827 2663
♥ 9829 2665
♦ 9830 2666
♤ 9828 2664
♧ 9831 2667
♡ 9825 2661
♢ 9826 2662
希腊字母
Α 913 0391
Β 914 0392
Γ 915 0393
Δ 916 0394
Ε 917 0395
Ζ 918 0396
Η 919 0397
Θ 920 0398
Ι 921 0399
Κ 922 039A
Λ 923 039B
Μ 924 039C
Ν 925 039D
Ξ 926 039E
Ο 927 039F
Π 928 03A0
Ρ 929 03A1
Σ 931 03A3
Τ 932 03A4
Υ 933 03A5
Φ 934 03A6
Χ 935 03A7
Ψ 936 03A8
Ω 937 03A9



White Circled Number

⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ㉑ ㉒ ㉓ ㉔ ㉕ ㉖ ㉗ ㉘ ㉙ ㉚ ㉛ ㉜ ㉝ ㉞ ㉟ ㊱ ㊲ ㊳ ㊴ ㊵ ㊶ ㊷ ㊸ ㊹ ㊺ ㊻ ㊼ ㊽ ㊾ ㊿

These are specifically sans-serif:

🄋 ➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉

Black Circled Number

⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ ⓫ ⓬ ⓭ ⓮ ⓯ ⓰ ⓱ ⓲ ⓳ ⓴

These are specifically sans-serif:

🄌 ➊ ➋ ➌ ➍ ➎ ➏ ➐ ➑ ➒ ➓

Circled Numbers on Black Square

㉈ ㉉ ㉊ ㉋ ㉌ ㉍ ㉎ ㉏

Double Circled Number

⓵ ⓶ ⓷ ⓸ ⓹ ⓺ ⓻ ⓼ ⓽ ⓾

Number with Period

🄀 ⒈ ⒉ ⒊ ⒋ ⒌ ⒍ ⒎ ⒏ ⒐ ⒑ ⒒ ⒓ ⒔ ⒕ ⒖ ⒗ ⒘ ⒙ ⒚ ⒛

Parenthesized

⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂ ⒃ ⒄ ⒅ ⒆ ⒇

Chinese/Japanese/Korean Circled Number

㊀ ㊁ ㊂ ㊃ ㊄ ㊅ ㊆ ㊇ ㊈ ㊉

Parenthesized Letters

🄐 🄑 🄒 🄓 🄔 🄕 🄖 🄗 🄘 🄙 🄚 🄛 🄜 🄝 🄞 🄟 🄠 🄡 🄢 🄣 🄤 🄥 🄦 🄧 🄨 🄩

⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ ⒨ ⒩ ⒪ ⒫ ⒬ ⒭ ⒮ ⒯ ⒰ ⒱ ⒲ ⒳ ⒴ ⒵

White Circled Letters

Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ

ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ

The Ⓜ also means Metro, a sign for subway.

Black Circled Letters

🅐 🅑 🅒 🅓 🅔 🅕 🅖 🅗 🅘 🅙 🅚 🅛 🅜 🅝 🅞 🅟 🅠 🅡 🅢 🅣 🅤 🅥 🅦 🅧 🅨 🅩



HTML的样式管理

HTML的样式管理


HTML是网页开发的基础,而样式设置则是让网页更加美观和易读的关键。本文将介绍一些HTML样式设置的技巧,帮助您打造出更加精美的网页。

1. 使用内联样式

内联样式是指在HTML标签中直接设置样式,p style="color: red;">这是一段红色的文字</p>

这种方式虽然不太方便,但是可以快速实现简单的样式设置。

2. 使用样式表

样式表是一种更加灵活的样式设置方式。我们可以在HTML文档中引入一个样式表,然后在样式表中设置各种样式。head>k rel="stylesheet" type="text/css" href="style.css">

</head>

在style.css文件中可以设置各种样式:

color: red;

这样就可以使所有的段落文字变成红色了。

3. 使用类和ID选择器

类和ID选择器可以让我们更加精细地控制样式。p class="highlight">这是一段高亮的文字</p>

在样式表中可以这样设置:

.highlight {d-color: yellow;

这样就可以使.highlight类的元素背景色变成黄色了。

4. 使用CSS框模型

CSS框模型是指通过设置元素的外边距、内边距和边框来控制元素的大小和位置。例如:

gargin: 10px;">

这是一个带有边框、内边距和外边距的元素

</div>

这样就可以创建一个大小为200x100像素,带有1像素黑色边框、10像素内边距和外边距的元素。

5. 使用响应式设计

响应式设计是指根据设备屏幕大小和分辨率来自动调整网页布局和样式。例如:

ediadax-width: 600px) {

body {t-size: 12px;

这样就可以在屏幕宽度小于600像素的设备上自动将字体大小调整为12像素。

HTML样式设置是网页设计中非常重要的一部分。通过使用内联样式、样式表、类和ID选择器、CSS框模型和响应式设计等技巧,我们可以打造出更加精美和易读的网页。



M

Markdown语法

Markdown 是一种轻量级标记语言,它用简洁的语法代替排版,使我们专心于码字。它的目标是实现易读易写,成为一种适用于网络的书写语言。同时,Markdown支持嵌入html标签。

<u>注意:Markdown使用#+*等符号来标记, 符号后面必须跟上 至少1个 空格才有效!</u>

Markdown的常用语法

标题

Markdown 标题支持两种形式:

1、用#标记

标题开头 加上1~6个#,依次代表一级标题、二级标题....六级标题

# 一级标题
## 二级标题
### 三级标题
##### 四级标题
###### 五级标题
###### 六级标题

2、用=-标记

标题底下 加上任意个=代表一级标题,-代表二级标题

一级标题
======

二级标题
----------

效果如下:

一级标题

二级标题

三级标题

四级标题
五级标题
六级标题

列表

Markdown 支持有序列表和无序列表。

无序列表使用-+*作为列表标记:

- Red
- Green
- Blue

* Red
* Green
* Blue

+ Red
+ Green
+ Blue

效果如下:

  • Red
  • Green
  • Blue

有序列表则使用数字加英文句点.来表示:

1. Red
2. Green
3. Blue

效果如下:

  1. Red
  2. Green
  3. Blue

引用

引用以>来表示,引用中支持多级引用、标题、列表、代码块、分割线等常规语法。

常见的引用写法:

> 这是一段引用    //在`>`后面有 1 个空格
> 
>     这是引用的代码块形式    //在`>`后面有 5 个空格
>     
> 代码例子:
>   
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

> 一级引用
> > 二级引用
> > > 三级引用

> #### 这是一个四级标题
> 
> 1. 这是第一行列表项
> 2. 这是第二行列表项

效果如下:

这是一段引用

这是引用的代码块形式    //在`>`后面有 5 个空格

代码例子:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

一级引用

二级引用

三级引用

这是一个四级标题

  1. 这是第一行列表项
  2. 这是第二行列表项

以下是分割线


强调

两个*-代表加粗,一个*-代表斜体,~~代表删除。

**加粗文本** 或者 __加粗文本__

*斜体文本*  或者_斜体文本_

~~删除文本~~

效果如下:

加粗文本 或者 加粗文本

斜体文本 或者 斜体文本

删除文本


图片与链接

图片与链接的语法很像,区别在一个 ! 号。二者格式:

图片:![]()    ![图片文本(可忽略)](图片地址)

链接:[]()     [链接文本](链接地址)

链接又分为行内式参考式自动链接

这是行内式链接:[ConnorLin's Blog](http://connorlin.github.io)。

这是参考式链接:[ConnorLin's Blog][url],其中url为链接标记,可置于文中任意位置。

[url]: http://connorlin.github.io/ "ConnorLin's Blog"

链接标记格式为:[链接标记文本]:  链接地址  链接title(可忽略)

这是自动链接:直接使用`<>`括起来<http://connorlin.github.io>

这是图片:![][avatar]

[avatar]: 

效果如下:

这是行内式链接:ConnorLin's Blog

这是参考式链接:ConnorLin's Blog,其中url为链接标记,可置于文中任意位置。

这是自动链接:直接使用<>括起来http://connorlin.github.io

这是图片:
avatar.jpg

代码

代码分为行内代码代码块

  • 行内代码使用 `代码` 标识,可嵌入文字中

  • 代码块使用4个空格或

    标识
    
    

    这里是代码
    
    
    
  • 代码语法高亮在 后面加上空格和语言名称即可

     语言
    //注意语言前面有空格
    这里是代码

例如:

这是行内代码`onCreate(Bundle savedInstanceState)`的例子。

这是代码块和语法高亮:

 java
// 注意java前面有空格
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

效果如下:

这是行内代码onCreate(Bundle savedInstanceState)的例子。

这是代码块和语法高亮:

// 注意java前面有空格
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

表格

表格对齐格式

  • 居左::----
  • 居中::----:-----
  • 居右:----:

例子:

|标题|标题|标题|
|:---|:---:|---:|
|居左测试文本|居中测试文本|居右测试文本|
|居左测试文本1|居中测试文本2|居右测试文本3|
|居左测试文本11|居中测试文本22|居右测试文本33|
|居左测试文本111|居中测试文本222|居右测试文本333|

效果如下:

标题 标题 标题
居左测试文本 居中测试文本 居右测试文本
居左测试文本1 居中测试文本2 居右测试文本3
居左测试文本11 居中测试文本22 居右测试文本33
居左测试文本111 居中测试文本222 居右测试文本333

分隔线

在一行中用三个以上的*-_来建立一个分隔线,行内不能有其他东西。也可以在符号间插入空格。

***
---
___

* * *

效果均为一条分割线:



换行

在行尾添加两个空格加回车表示换行:

这是一行后面加两个空格  换行

效果如下:

这是一行后面加两个空格
换行


脚注(注解)

使用[^]来定义脚注:

这是一个脚注的例子[^1]

[^1]: 这里是脚注

效果如下:

这是一个脚注的例子[1]


常用弥补Markdown的Html标签

字体

<font face="微软雅黑" color="red" size="6">字体及字体颜色和大小</font>
<font color="#0000ff">字体颜色</font>

效果如下:

<font face="微软雅黑" color="red" size="6">字体及字体颜色和大小</font>
<font color="#0000ff">字体颜色</font>


换行

使用html标签`<br/>`<br/>换行

效果如下:

使用html标签<br/>
换行


文本对齐方式

<p align="left">居左文本</p>
<p align="center">居中文本</p>
<p align="right">居右文本</p>

效果如下:

<p align="left">居左文本</p>
<p align="center">居中文本</p>
<p align="right">居右文本</p>


下划线

<u>下划线文本</u>

效果如下:

<u>下划线文本</u>





P

PleaseJS Color Library

色轮模式参看🎞️Adobe Color

#PleaseJS

www.checkman.io/please

Please.js is a polite companion that wants to help you make your projects beautiful. It uses HSV color space to create random pleasing colors as well as color schemes based on a given color. It has two core functions and a bunch of little helpers for you to use.

Please.make_color();
//or
Please.make_scheme(
{
	h: 145,
	s: .7,
	v: .6
},
{
	scheme_type: 'triadic',
	format: 'rgb-string'
});

##Core

make_color

Please.make_color({options})

The make_color function by default will generate and return a random hex string using the golden ratio to ensure that the color will look nice on your screen.

You can also pass an options object to make_color and have it do a whole bunch of different things.

make_color options:

  • hue(0-360) By setting the hue, you determine the color.
  • saturation(0.0-1.0) By setting the saturation, you determine the distance from gray.
  • value(0.0-1.0) By setting the value, you determine the balance between black and white.
  • base_color('the name of an HTML color') Setting a base_color (e.g. 'pink') will create a random color within the HSV range of the chosen color. Please will recognize any of the 146 standard HTML colors, it has a very good memory. (参看143个颜色值
  • greyscale | grayscale(true/false) Setting either greyscale or grayscale (but we all know which one is correct) to true will cause all of the colors you generate to be within the grey or gray range. This is effectively the same as setting your saturation to 0.
  • golden(true/false) Setting golden to true randomizes your hue (overrides hue setting) and makes you a spectacular color based on the golden ratio. It's so good, it's the default. Make sure to turn it off if you want to have more control over your generated colors.
  • full_random(true/false) Setting full_random to true will make Please lose its mind. It will completely randomize the hue, saturation, and value of the colors it makes.
  • colors_returned(1-infinity) Setting colors_returned to higher than 1 will return an array full of the colors Please has made for you. If you set it to 1, you'll just get the one color! It makes a sort of sense if you think about it.
  • format('format string') Setting format string, will change the format of what make_color will return for you. The options are as follows (example is the color black):
    • 'hex' = '#000000'
    • 'rgb' = {r: 0, g: 0,b: 0}
    • 'rgb-string' = 'rgb(0,0,0)'
    • 'hsv' = {h: 0, s: 0, v: 0}

Here are the defaults for each option:

{
	hue: null,
	saturation: null,
	value: null,
	base_color: '',
	greyscale: false,
	grayscale: false,
	golden: true,
	full_random: false,
	colors_returned: 1,
	format: 'hex',
}

Here is an example of a fully random color call:

Please.make_color({
	golden: false,
	full_random: true
});

Here is an example that will produce 100 reds as RGB strings:

Please.make_color({
	golden: false,
	base_color: 'red',
	colors_returned: 100,
	format: 'rgb-string'
});

make_scheme

The second core function allows Please to make a color scheme for you.

Please.make_scheme(base_color,{options})

The make scheme function will return a series of colors based upon the color and options you feed it. The base_color must be in HSV color space and is an object in the format of

{
	h: ___,
	s: ___,
	v: ___
}

make_scheme options:

  • scheme_type (参看Adobe色轮
    • 'monochromatic' | 'mono' - Makes a 5 color scheme using your provided color, all the colors will be fairly similar to each other.
    • 'complementary' | 'complement' - Makes a two color scheme using your provided color, the 2nd color will be the complement of the 1st, such that mixing them will create a neutral grey.
    • 'split-complementary' | 'split-complement' | 'split' - Makes a three color scheme where the 2nd and 3rd colors are at a 30 degree split from the complement of the 1st color.
    • 'double-complementary' | 'double-complement' | 'double' - Makes a four color scheme where the 2nd color is the complement of the 1st, and the 3rd and 4th colors are complements of each other at a 30 degree ofset from the first pair
    • 'analogous' | 'ana' - Makes a six color scheme where each additional color is offset from the 1st by 20 degrees.
    • 'triadic' | 'triad' | 'tri' - Makes a 3 color scheme where the 2nd and 3rd color are equally spaced from the 1st.
  • format('format string') Setting format string, will change the format of what make scheme will return for you. The options are as follows (example is the color white):
    • 'hex' = '#ffffff'
    • 'rgb' = {r: 255, g: 255,b: 255}
    • 'rgb-string' = 'rgb(255,255,255)'
    • 'hsv' = {h: 0, s: 0, v: 1}

Here is an example of a complementary scheme in hex:

Please.make_scheme(
{
	h: 130,
	s: .7.
	v: .75
},
{
	scheme_type: 'complement',
	format: 'hex'
});

Here is an example that will produce a triadic scheme in rgb-strings:

Please.make_scheme(
{
	h: 130,
	s: .7.
	v: .75
},
{
	scheme_type: 'triadic',
	format: 'rgb-string'
});

Here are the defaults for each option:

{
	scheme_type: 'analogous',
	format: 'hex'
}

Other Methods

Please also has some bonus features. It allows you to convert freely between the color formats of RGB, HSV, and HEX.

RGB_to_HEX() HEX_to_RGB() RGB_to_HSV() HSV_to_RGB() HEX_to_HSV() HSV_to_HEX()

conversion from HSV or RGB expect an object with the properties

{
	r: 0-255,
	g: 0-255,
	b: 0-255
}

and

{
	h: 0-360,
	s: 0.0-1.0,
	v: 0,0-1.0
}

respectively, while converstions from HEX expect a string. Return formats are modeled the same way as the arguments.

In addition Please, can convert from an HTML color name into HEX, RGB, or HSV.

NAME_to_HEX()
NAME_to_RGB()
NAME_to_HSV()

These functions take a string and return a HEX string or an RGB/HSV object.

I hope you enjoy using Please. Have fun, and remember to say the magic word.



R

rgba颜色值

一、RGB

在CSS中能够使用颜色名来使用颜色,如果不使用颜色名,我们使用RGB值来描述颜色,R代表红色red,G代表绿色green,B代表蓝色blue。

每一种颜色的范围在0~255之间,或者也可以用0%~100%这种表示范围,因此 RGB 能够表示 255*255*255 种颜色

二、RGBA: 

RGBA的意思是(Red-Green-Blue-Alpha)它是在RGB上扩展包括了“alpha”通道,运行对颜色值设置透明度。

rgba(0,0,0,0)四个值,前三个值的范围是0~255之间的整数或0-100的百分数

前三个值,描述的是三原色,分别代表红绿蓝三原色在预期色彩中的量。最后一个则代表透明度,

范围在0-1之间。1表示不透明,0表示全透明,0.5为半透明。


示例:

rgba(255,255,255,0)则表示完全透明的白色;

rgba(0,0,0,1)则表示完全不透明的黑色;

rgba(0,0,0,0)则表示完全不透明的白色,也即是无色;

三、十六进制的 RGB

1.颜色有 0~f 十六个分档,分别代表0~255。且颜色是aabbcc形式的,可以简写

2.颜色用 # 开头



S

strudel

API Reference

This is the long list functions you can use! Remember that you don't need to remember all of those and that you can already make music with a small set of functions!

accelerate

A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.

s("sax").accelerate("<0 1 2 4 8 16>").slow(2).osc()

add

Assumes a pattern of numbers. Adds the given number to each item in the pattern.

// Here, the triad 0, 2, 4 is shifted by different amounts
"0 2 4".add("<0 3 4 0>").scale('C major').note()
// Without add, the equivalent would be:
// "<[0 2 4] [3 5 7] [4 6 8] [0 2 4]>".scale('C major').note()
// You can also use add with notes:
"c3 e3 g3".add("<0 5 7 0>").note()
// Behind the scenes, the notes are converted to midi numbers:
// "48 52 55".add("<0 5 7 0>").note()

addVoicings

Adds a new custom voicing dictionary.

addVoicings('cookie', {
  7: ['3M 7m 9M 12P 15P', '7m 10M 13M 16M 19P'],
  '^7': ['3M 6M 9M 12P 14M', '7M 10M 13M 16M 19P'],
  m7: ['8P 11P 14m 17m 19P', '5P 8P 11P 14m 17m'],
  m7b5: ['3m 5d 8P 11P 14m', '5d 8P 11P 14m 17m'],
  o7: ['3m 6M 9M 11A 15P'],
  '7alt': ['3M 7m 10m 13m 15P'],
  '7#11': ['7m 10m 13m 15P 17m'],
}, ['C3', 'C6'])
"<C^7 A7 Dm7 G7>".voicings('cookie').note()

almostAlways

Shorthand for .sometimesBy(0.9, fn)

s("hh*8").almostAlways(x=>x.speed("0.5"))

almostNever

Shorthand for .sometimesBy(0.1, fn)

s("hh*8").almostNever(x=>x.speed("0.5"))

always

Shorthand for .sometimesBy(1, fn) (always calls fn)

s("hh*8").always(x=>x.speed("0.5"))

amp

Like {@link gain}, but linear.

s("bd*8").amp(".1*2 .5 .1*2 .5 .1 .5").osc()

appBoth

When this method is called on a pattern of functions, it matches its haps with those in the given pattern of values. A new pattern is returned, with each matching value applied to the corresponding function.

In this _appBoth variant, where timespans of the function and value haps are not the same but do intersect, the resulting hap has a timespan of the intersection. This applies to both the part and the whole timespan.

appLeft

As with {@link Pattern#appBoth}, but the whole timespan is not the intersection, but the timespan from the function of patterns that this method is called on. In practice, this means that the pattern structure, including onsets, are preserved from the pattern of functions (often referred to as the left hand or inner pattern).

apply

Like layer, but with a single function:

"<c3 eb3 g3>".scale('C minor').apply(scaleTranspose("0,2,4")).note()

appRight

As with {@link Pattern#appLeft}, but whole timespans are instead taken from the pattern of values, i.e. structure is preserved from the right hand/outer pattern.

appWhole

Assumes 'this' is a pattern of functions, and given a function to resolve wholes, applies a given pattern of values to that pattern of functions.

arp

Selects indices in in stacked notes.

note("<[c,eb,g]!2 [c,f,ab] [d,f,ab]>")
.arp("0 [0,2] 1 [0,2]").slow(2)

arpWith

Selects indices in in stacked notes.

note("<[c,eb,g]!2 [c,f,ab] [d,f,ab]>")
.arpWith(haps => haps[2])

arrange

Allows to arrange multiple patterns together over multiple cycles. Takes a variable number of arrays with two elements specifying the number of cycles and the pattern to use.

arrange([4, "<c a f e>(3,8)"],[2, "<g a>(5,8)"]).note()

attack

Amplitude envelope attack time: Specifies how long it takes for the sound to reach its peak value, relative to the onset.

note("c3 e3").attack("<0 .1 .5>")

bank

Select the sound bank to use. To be used together with s. The bank name (+ "_") will be prepended to the value of s.

s("bd sd").bank('RolandTR909') // = s("RolandTR909_bd RolandTR909_sd")

begin

a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. 0.25 to cut off the first quarter from each sample.

samples({ rave: 'rave/AREUREADY.wav' }, 'github:tidalcycles/Dirt-Samples/master/')
s("rave").begin("<0 .25 .5 .75>")

bpf

Sets the center frequency of the band-pass filter. When using mininotation, you can also optionally supply the 'bpq' parameter separated by ':'.

s("bd sd,hh*3").bpf("<1000 2000 4000 8000>")

bpq

Sets the band-pass q-factor (resonance).

s("bd sd").bpf(500).bpq("<0 1 2 3>")

brak

Returns a new pattern where every other cycle is played once, twice as fast, and offset in time by one quarter of a cycle. Creates a kind of breakbeat feel.

cat

Appends the given pattern(s) to the next cycle.

s("hh*2").cat(
  note("c2(3,8)")
)

cat

The given items are concatenated, where each one takes one cycle.

cat(e5, b4, [d5, c5]).note() // "<e5 b4 [d5 c5]>".note()

ceil

Assumes a numerical pattern. Returns a new pattern with all values set to their mathematical ceiling. E.g. 3.2 replaced with 4, and -4.2 replaced with -4.

"42 42.1 42.5 43".ceil().note()

channel

choose the channel the pattern is sent to in superdirt

choose

Chooses randomly from the given list of elements.

choose

Chooses from the given list of values (or patterns of values), according to the pattern that the method is called on. The pattern should be in the range 0 .. 1.

choose2

As with choose, but the pattern that this method is called on should be in the range -1 .. 1

chooseCycles

Picks one of the elements at random each cycle.

chooseCycles("bd", "hh", "sd").s().fast(4)
"bd | hh | sd".s().fast(4)

chooseInWith

As with {chooseWith}, but the structure comes from the chosen values, rather than the pattern you're using to choose with.

chooseWith

Choose from the list of values (or patterns of values) using the given pattern of numbers, which should be in the range of 0..1

chop

Cuts each sample into the given number of parts, allowing you to explore a technique known as 'granular synthesis'. It turns a pattern of samples into a pattern of parts of samples.

samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })
s("rhodes")
 .chop(4)
 .rev() // reverse order of chops
 .loopAt(4) // fit sample into 4 cycles

chunk

Divides a pattern into a given number of parts, then cycles through those parts in turn, applying the given function to each part in turn (one part per cycle).

"0 1 2 3".chunk(4, x=>x.add(7)).scale('A minor').note()

chunkBack

Like chunk, but cycles through the parts in reverse order. Known as chunk' in tidalcycles

"0 1 2 3".chunkBack(4, x=>x.add(7)).scale('A minor').note()

clip

Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration. In tidal, this would be done with legato, which has a complicated history in strudel. For now, if you're coming from tidal, just think clip = legato.

note("c a f e").s("piano").clip("<.5 1 2>")

coarse

fake-resampling for lowering the sample rate. Caution: This effect seems to only work in chromium based browsers

s("bd sd,hh*4").coarse("<1 4 8 16 32>")

compress

Compress each cycle into the given timespan, leaving a gap

cat(
  s("bd sd").compress(.25,.75),
  s("~ bd sd ~")
)

cosine

A cosine signal between 0 and 1.

stack(sine,cosine).segment(16).range(0,15).slow(2).scale('C minor').note()

cpm

Plays the pattern at the given cycles per minute.

s("<bd sd>,hh*2").cpm(90) // = 90 bpm

crush

bit crusher effect.

s("<bd sd>,hh*3").fast(2).crush("<16 8 7 6 5 4 3 2>")

csoundm

Sends notes to Csound for rendering with MIDI semantics. The hap value is translated to these Csound pfields:

p1 -- Csound instrument either as a number (1-based, can be a fraction), or as a string name. p2 -- time in beats (usually seconds) from start of performance. p3 -- duration in beats (usually seconds). p4 -- MIDI key number (as a real number, not an integer but in [0, 127]. p5 -- MIDI velocity (as a real number, not an integer but in [0, 127]. p6 -- Strudel controls, as a string.

cut

In the style of classic drum-machines, cut will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.

s("rd*4").cut(1)

decay

Amplitude envelope decay time: the time it takes after the attack time to reach the sustain level. Note that the decay is only audible if the sustain value is lower than 1.

note("c3 e3").decay("<.1 .2 .3 .4>").sustain(0)

defragmentHaps

Combines adjacent haps with the same value and whole. Only intended for use in tests.

degrade

Randomly removes 50% of events from the pattern. Shorthand for .degradeBy(0.5)

s("hh*8").degrade()
s("[hh?]*8")

degradeBy

Randomly removes events from the pattern by a given amount. 0 = 0% chance of removal 1 = 100% chance of removal

s("hh*8").degradeBy(0.2)
s("[hh?0.2]*8")

delay

Sets the level of the delay signal.

When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter, separated by ':'.

s("bd").delay("<0 .25 .5 1>")
s("bd bd").delay("0.65:0.25:0.9 0.65:0.125:0.7")

delayfeedback

Sets the level of the signal that is fed back into the delay. Caution: Values >= 1 will result in a signal that gets louder and louder! Don't do it

s("bd").delay(.25).delayfeedback("<.25 .5 .75 1>").slow(2)

delaytime

Sets the time of the delay effect.

s("bd").delay(.25).delaytime("<.125 .25 .5 1>").slow(2)

detune

Set detune of oscillators. Works only with some synths, see tidal doc

n("0 3 7").s('superzow').octave(3).detune("<0 .25 .5 1 2>").osc()

discreteOnly

Returns a new pattern, with 'continuous' haps (those without 'whole' timespans) removed from query results.

div

Divides each number by the given factor.

djf

DJ filter, below 0.5 is low pass filter, above is high pass filter.

n("0 3 7 [10,24]").s('superzow').octave(3).djf("<.5 .25 .5 .75>").osc()

drawLine

Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span. Should only be used with single characters as values, otherwise the character slots will be messed up. Character legend:

  • "|" cycle separator
  • "-" hold previous value
  • "." silence

const line = drawLine("0 [1 2 3]", 10); // |0--123|0--123
console.log(line);
silence;

dry

Set dryness of reverb. See {@link room} and {@link size} for more information about reverb.

n("[0,3,7](3,8)").s("superpiano").room(.7).dry("<0 .5 .75 1>").osc()

early

Nudge a pattern to start earlier in time. Equivalent of Tidal's <~ operator

"bd ~".stack("hh ~".early(.1)).s()

echo

Superimpose and offset multiple times, gradually decreasing the velocity

s("bd sd").echo(3, 1/6, .8)

echoWith

Superimpose and offset multiple times, applying the given function each time.

"<0 [2 4]>"
.echoWith(4, 1/8, (p,n) => p.add(n*2))
.scale('C minor').note().clip(.2)

end

The same as .begin, but cuts off the end off each sample.

s("bd*2,oh*4").end("<.1 .2 .5 1>")

euclid

Changes the structure of the pattern to form an euclidean rhythm. Euclidian rhythms are rhythms obtained using the greatest common divisor of two numbers. They were described in 2004 by Godfried Toussaint, a canadian computer scientist. Euclidian rhythms are really useful for computer/algorithmic music because they can describe a large number of rhythms with a couple of numbers.

// The Cuban tresillo pattern.
note("c3").euclid(3,8)

euclidLegato

Similar to euclid, but each pulse is held until the next pulse, so there will be no gaps.

n("g2").decay(.1).sustain(.3).euclidLegato(3,8)

euclidRot

Like euclid, but has an additional parameter for 'rotating' the resulting sequence.

// A Samba rhythm necklace from Brazil
note("c3").euclidRot(3,16,14)

every

An alias for {@link firstOf}

note("c3 d3 e3 g3").every(4, x=>x.rev())

fast

Speed up a pattern by the given factor. Used by "*" in mini notation.

s("<bd sd> hh").fast(2) // s("[<bd sd> hh]*2")

fastGap

speeds up a pattern like fast, but rather than it playing multiple times as fast would it instead leaves a gap in the remaining space of the cycle. For example, the following will play the sound pattern "bd sn" only once but compressed into the first half of the cycle, i.e. twice as fast.

s("bd sd").fastGap(2)

filterHaps

Returns a new Pattern, which only returns haps that meet the given test.

filterValues

As with {@link Pattern#filterHaps}, but the function is applied to values inside haps.

firstCycle

Queries the pattern for the first cycle, returning Haps. Mainly of use when debugging a pattern.

firstCycleValues

Accessor for a list of values returned by querying the first cycle.

firstOf

Applies the given function every n cycles, starting from the first cycle.

note("c3 d3 e3 g3").firstOf(4, x=>x.rev())

floor

Assumes a numerical pattern. Returns a new pattern with all values set to their mathematical floor. E.g. 3.7 replaced with to 3, and -4.2 replaced with -5.

"42 42.1 42.5 43".floor().note()

fmap

see {@link Pattern#withValue}

focus

Similar to compress, but doesn't leave gaps, and the 'focus' can be bigger than a cycle

s("bd hh sd hh").focus(1/4, 3/4)

freq

Set frequency of sound.

freq("220 110 440 110").s("superzow").osc()
freq("110".mul.out(".5 1.5 .6 [2 3]")).s("superzow").osc()

fromBipolar

Assumes a numerical pattern, containing bipolar values in the range -1 .. 1 Returns a new pattern with values scaled to the unipolar range 0 .. 1

gain

Controls the gain by an exponential amount.

s("hh*8").gain(".4!2 1 .4!2 1 .4 1")

hpf

Applies the cutoff frequency of the high-pass filter.

When using mininotation, you can also optionally add the 'hpq' parameter, separated by ':'.

s("bd sd,hh*4").hpf("<4000 2000 1000 500 200 100>")
s("bd sd,hh*4").hpf("<2000 2000:25>")

hpq

Controls the high-pass q-value.

s("bd sd,hh*4").hpf(2000).hpq("<0 10 20 30>")

hurry

Both speeds up the pattern (like 'fast') and the sample playback (like 'speed').

s("bd sd:2").hurry("<1 2 4 3>").slow(1.5)

hush

Silences a pattern.

stack(
  s("bd").hush(),
  s("hh*3")
)

inside

Carries out an operation 'inside' a cycle.

"0 1 2 3 4 3 2 1".inside(4, rev).scale('C major').note()
// "0 1 2 3 4 3 2 1".slow(4).rev().fast(4).scale('C major').note()

invert

Swaps 1s and 0s in a binary pattern.

s("bd").struct("1 0 0 1 0 0 1 0".lastOf(4, invert))

irand

A continuous pattern of random integers, between 0 and n-1.

// randomly select scale notes from 0 - 7 (= C to C)
irand(8).struct("x(3,8)").scale('C minor').note()

iter

Divides a pattern into a given number of subdivisions, plays the subdivisions in order, but increments the starting subdivision each cycle. The pattern wraps to the first subdivision after the last subdivision is played.

note("0 1 2 3".scale('A minor')).iter(4)

iterBack

Like iter, but plays the subdivisions in reverse order. Known as iter' in tidalcycles

note("0 1 2 3".scale('A minor')).iterBack(4)

jux

The jux function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel.

s("lt ht mt ht hh").jux(rev)

juxBy

Jux with adjustable stereo width. 0 = mono, 1 = full stereo.

s("lt ht mt ht hh").juxBy("<0 .5 1>/2", rev)

lastOf

Applies the given function every n cycles, starting from the last cycle.

note("c3 d3 e3 g3").lastOf(4, x=>x.rev())

late

Nudge a pattern to start later in time. Equivalent of Tidal's ~> operator

"bd ~".stack("hh ~".late(.1)).s()

layer

Layers the result of the given function(s). Like {@link Pattern.superimpose}, but without the original pattern:

"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*4"
  .layer(x=>x.add("0,2"))
  .scale('C minor').note()

legato

a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. 0.25 to cut off the first quarter from each sample.

"c4 eb4 g4 bb4".legato("<0.125 .25 .5 .75 1 2 4>")

legato

Multiplies the hap duration with the given factor. With samples, clip might be a better function to use (more info)

note("c3 eb3 g3 c4").legato("<.25 .5 1 2>")

leslie

Emulation of a Leslie speaker: speakers rotating in a wooden amplified cabinet.

n("0,4,7").s("supersquare").leslie("<0 .4 .6 1>").osc()

linger

Selects the given fraction of the pattern and repeats that part to fill the remainder of the cycle.

s("lt ht mt cp, [hh oh]*2").linger("<1 .5 .25 .125>")

loop

Loops the sample (from begin to end) the specified number of times. Note that the tempo of the loop is not synced with the cycle tempo.

s("bd").loop("<1 2 3 4>").osc()

loopAt

Makes the sample fit the given number of cycles by changing the speed.

samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })
s("rhodes").loopAt(4)

loopAtCps

Makes the sample fit the given number of cycles and cps value, by changing the speed. Please note that at some point cps will be given by a global clock and this function will be deprecated/removed.

samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })
s("rhodes").loopAtCps(4,1.5).cps(1.5)

lpf

Applies the cutoff frequency of the low-pass filter.

When using mininotation, you can also optionally add the 'lpq' parameter, separated by ':'.

s("bd sd,hh*3").lpf("<4000 2000 1000 500 200 100>")
s("bd*8").lpf("1000:0 1000:10 1000:20 1000:30")

lpq

Controls the low-pass q-value.

s("bd sd,hh*4").lpf(2000).lpq("<0 10 20 30>")

lrate

Rate of modulation / rotation for leslie effect

n("0,4,7").s("supersquare").leslie(1).lrate("<1 2 4 8>").osc()

lsize

Physical size of the cabinet in meters. Be careful, it might be slightly larger than your computer. Affects the Doppler amount (pitch warble)

n("0,4,7").s("supersquare").leslie(1).lrate(2).lsize("<.1 .5 1>").osc()

mask

Returns silence when mask is 0 or "~"

note("c [eb,g] d [eb,g]").mask("<1 [0 1]>").slow(2)

mul

Multiplies each number by the given factor.

"1 1.5 [1.66, <2 2.33>]".mul(150).freq()

n

Selects the given index from the sample map. Numbers too high will wrap around. n can also be used to play midi numbers, but it is recommended to use note instead.

s("bd sd,hh*3").n("<0 1>")

never

Shorthand for .sometimesBy(0, fn) (never calls fn)

s("hh*8").never(x=>x.speed("0.5"))

note

Plays the given note name or midi number. A note name consists of

  • a letter (a-g or A-G)
  • optional accidentals (b or #)
  • optional octave number (0-9). Defaults to 3

Examples of valid note names: cbbBbf#c3A4Eb2c#5

You can also use midi numbers instead of note names, where 69 is mapped to A4 440Hz in 12EDO.

note("c a f e")
note("c4 a4 f4 e4")
note("60 69 65 64")

octave

Sets the default octave of a synth.

n("0,4,7").s('supersquare').octave("<3 4 5 6>").osc()

off

Superimposes the function result on top of the original pattern, delayed by the given time.

"c3 eb3 g3".off(1/8, x=>x.add(7)).note()

often

Shorthand for .sometimesBy(0.75, fn)

s("hh*8").often(x=>x.speed("0.5"))

onsetsOnly

Returns a new pattern, with all haps without onsets filtered out. A hap with an onset is one with a whole timespan that begins at the same time as its part timespan.

orbit

An orbit is a global parameter context for patterns. Patterns with the same orbit will share the same global effects.

stack(
  s("hh*3").delay(.5).delaytime(.25).orbit(1),
  s("~ sd").delay(.5).delaytime(.125).orbit(2)
)

osc

Sends each hap as an OSC message, which can be picked up by SuperCollider or any other OSC-enabled software. For more info, read MIDI & OSC in the docs

outside

Carries out an operation 'outside' a cycle.

"<[0 1] 2 [3 4] 5>".outside(4, rev).scale('C major').note()
// "<[0 1] 2 [3 4] 5>".fast(4).rev().slow(4).scale('C major').note()

palindrome

Applies rev to a pattern every other cycle, so that the pattern alternates between forwards and backwards.

note("c d e g").palindrome()

pan

Sets position in stereo.

s("[bd hh]*2").pan("<.5 1 .5 0>")

Pattern

Create a pattern. As an end user, you will most likely not create a Pattern directly.

perlin

Generates a continuous pattern of perlin noise, in the range 0..1.

// randomly change the cutoff
s("bd sd,hh*4").cutoff(perlin.range(500,2000))

ply

The ply function repeats each event the given number of times.

s("bd ~ sd cp").ply("<1 2 3>")

polymeter

Combines the given lists of patterns with the same pulse. This will create so called polymeters when different sized sequences are used.

polymeter(["c", "eb", "g"], ["c2", "g2"]).note()
// "{c eb g, c2 g2}".note()

polymeterSteps

Aligns one or more given sequences to the given number of steps per cycle.

polymeterSteps(2, ["c", "d", "e", "f", "g", "f", "e", "d"])
.note().stack(s("bd")) // 1 cycle = 1 bd = 2 notes
// note("{c d e f g f e d}%2").stack(s("bd"))

press

Syncopates a rhythm, by shifting each event halfway into its timespan.

stack(s("hh*4"),
      s("bd mt sd ht").every(4, press)
     ).slow(2)

pressBy

Like press, but allows you to specify the amount by which each event is shifted. pressBy(0.5) is the same as press, while pressBy(1/3) shifts each event by a third of its timespan.

stack(s("hh*4"),
      s("bd mt sd ht").pressBy("<0 0.5 0.25>")
     ).slow(2)

pure

A discrete value that repeats once per cycle.

pure('e4') // "e4"

queryArc

Query haps inside the given time span.

const pattern = sequence('a', ['b', 'c'])
const haps = pattern.queryArc(0, 1)
console.log(haps)
silence

rand

A continuous pattern of random numbers, between 0 and 1.

// randomly change the cutoff
s("bd sd,hh*4").cutoff(rand.range(500,2000))

rand2

A continuous pattern of random numbers, between -1 and 1

range

Assumes a numerical pattern, containing unipolar values in the range 0 .. 1. Returns a new pattern with values scaled to the given min/max range. Most useful in combination with continuous patterns.

s("bd sd,hh*4").cutoff(sine.range(500,2000).slow(4))

range2

Assumes a numerical pattern, containing bipolar values in the range -1 .. 1 Returns a new pattern with values scaled to the given min/max range.

s("bd sd,hh*4").cutoff(sine2.range2(500,2000).slow(4))

rangex

Assumes a numerical pattern, containing unipolar values in the range 0 .. 1 Returns a new pattern with values scaled to the given min/max range, following an exponential curve.

s("bd sd,hh*4").cutoff(sine.rangex(500,2000).slow(4))

rarely

Shorthand for .sometimesBy(0.25, fn)

s("hh*8").rarely(x=>x.speed("0.5"))

ratio

Allows dividing numbers via list notation using ":". Returns a new pattern with just numbers.

ratio("1, 5:4, 3:2").mul(110).freq().s("piano").slow(2)

register

Registers a new pattern method. The method is added to the Pattern class + the standalone function is returned from register.

release

Amplitude envelope release time: The time it takes after the offset to go from sustain level to zero.

note("c3 e3 g3 c4").release("<0 .1 .4 .6 1>/2")

removeUndefineds

Returns a new pattern, with haps containing undefined values removed from query results.

reset

Resets the pattern to the start of the cycle for each onset of the reset pattern.

s("<bd lt> sd, hh*4").reset("<x@3 x(3,8)>")

restart

Restarts the pattern for each onset of the restart pattern. While reset will only reset the current cycle, restart will start from cycle 0.

s("<bd lt> sd, hh*4").restart("<x@3 x(3,8)>")

rev

Reverse all haps in a pattern

note("c3 d3 e3 g3").rev()

ribbon

Loops the pattern inside at offset for cycles.

// Looping a portion of randomness
note(irand(8).segment(4).scale('C3 minor')).ribbon(1337, 2)

room

Sets the level of reverb.

When using mininotation, you can also optionally add the 'size' parameter, separated by ':'.

s("bd sd").room("<0 .2 .4 .6 .8 1>")
s("bd sd").room("<0.9:1 0.9:4>")

roomsize

Sets the room size of the reverb, see {@link room}.

s("bd sd").room(.8).roomsize("<0 1 2 4 8>")

rootNotes

Maps the chords of the incoming pattern to root notes in the given octave.

"<C^7 A7 Dm7 G7>".rootNotes(2).note()

round

Assumes a numerical pattern. Returns a new pattern with all values rounded to the nearest integer.

"0.5 1.5 2.5".round().scale('C major').note()

run

A discrete pattern of numbers from 0 to n-1

run(4).scale('C4 major').note()
// "0 1 2 3".scale('C4 major').note()

s

Select a sound / sample by name. When using mininotation, you can also optionally supply 'n' and 'gain' parameters separated by ':'.

s("bd hh")
s("bd:0 bd:1 bd:0:0.3 bd:1:1.4")

samples

Loads a collection of samples to use with s

samples('github:tidalcycles/Dirt-Samples/master');
s("[bd ~]*2, [~ hh]*2, ~ sd")
samples({
 bd: '808bd/BD0000.WAV',
 sd: '808sd/SD0010.WAV'
 }, 'https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/');
s("[bd ~]*2, [~ hh]*2, ~ sd")

saw

A sawtooth signal between 0 and 1.

"c3 [eb3,g3] g2 [g3,bb3]".note().clip(saw.slow(4))
saw.range(0,8).segment(8).scale('C major').slow(4).note()

scale

Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like {@link Pattern#scaleTranspose}.

A scale consists of a root note (e.g. c4cf#bb4) followed by semicolon (':') and then a scale type.

The root note defaults to octave 3, if no octave number is given.

n("0 2 4 6 4 2").scale("C:major")
n("[0,7] 4 [2,7] 4")
.scale("C:<major minor>/2")
.s("piano")
n(rand.range(0,12).segment(8).round())
.scale("C:ritusen")
.s("folkharp")

scaleTranspose

Transposes notes inside the scale by the number of steps. Expected to be called on a Pattern which already has a {@link Pattern#scale}

"-8 [2,4,6]"
.scale('C4 bebop major')
.scaleTranspose("<0 -1 -2 -3 -4 -5 -6 -4>")
.note()

segment

Samples the pattern at a rate of n events per cycle. Useful for turning a continuous pattern into a discrete one.

note(saw.range(0,12).segment(24)).add(40)

seq

Appends the given pattern(s) to the current pattern.

s("hh*2").seq(
  note("c2(3,8)")
)

seq

Like cat, but the items are crammed into one cycle.

seq(e5, b4, [d5, c5]).note() // "e5 b4 [d5 c5]".note()

sequence

See {@link fastcat}

setContext

Returns a new pattern with the context field set to every hap set to the given value.

shape

Wave shaping distortion. CAUTION: it might get loud

s("bd sd,hh*4").shape("<0 .2 .4 .6 .8>")

showFirstCycle

More human-readable version of the {@link Pattern#firstCycleValues} accessor.

silence

Does absolutely nothing..

silence // "~"

sine

A sine signal between 0 and 1.

sine.segment(16).range(0,15).slow(2).scale('C minor').note()

slice

Chops samples into the given number of slices, triggering those slices with a given pattern of slice numbers. Instead of a number, it also accepts a list of numbers from 0 to 1 to slice at specific points.

await samples('github:tidalcycles/Dirt-Samples/master')
s("breaks165").slice(8, "0 1 <2 2*2> 3 [4 0] 5 6 7".every(3, rev)).slow(1.5)
await samples('github:tidalcycles/Dirt-Samples/master')
s("breaks125/2").fit().slice([0,.25,.5,.75], "0 1 1 <2 3>")

slow

Slow down a pattern over the given number of cycles. Like the "/" operator in mini notation.

s("<bd sd> hh").slow(2) // s("[<bd sd> hh]/2")

slowcat

Concatenation: combines a list of patterns, switching between them successively, one per cycle:

synonyms: {@link cat}

slowcat(e5, b4, [d5, c5])

slowcatPrime

Concatenation: combines a list of patterns, switching between them successively, one per cycle. Unlike slowcat, this version will skip cycles.

someCycles

Shorthand for .someCyclesBy(0.5, fn)

s("hh(3,8)").someCycles(x=>x.speed("0.5"))

someCyclesBy

Randomly applies the given function by the given probability on a cycle by cycle basis. Similar to {@link Pattern#sometimesBy}

s("hh(3,8)").someCyclesBy(.3, x=>x.speed("0.5"))

sometimes

Applies the given function with a 50% chance

s("hh*4").sometimes(x=>x.speed("0.5"))

sometimesBy

Randomly applies the given function by the given probability. Similar to {@link Pattern#someCyclesBy}

s("hh(3,8)").sometimesBy(.4, x=>x.speed("0.5"))

sortHapsByPart

Returns a new pattern, which returns haps sorted in temporal order. Mainly of use when comparing two patterns for equality, in tests.

source

Define a custom webaudio node to use as a sound source.

speed

Changes the speed of sample playback, i.e. a cheap way of changing pitch.

s("bd").speed("<1 2 4 1 -2 -4>")
speed("1 1.5*2 [2 1.1]").s("piano").clip(1)

splitQueries

Returns a new pattern, with queries split at cycle boundaries. This makes some calculations easier to express, as all haps are then constrained to happen within a cycle.

square

A square signal between 0 and 1.

square.segment(2).range(0,7).scale('C minor').note()

squiz

Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:

"A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated."

squiz("2 4/2 6 [8 16]").s("bd").osc()

stack

Stacks the given pattern(s) to the current pattern.

s("hh*2").stack(
  note("c2(3,8)")
)

stack

The given items are played at the same time at the same length.

stack(g3, b3, [e4, d4]).note() // "g3,b3,[e4,d4]".note()

stripContext

Returns a new pattern with the context field of every hap set to an empty object.

struct

Applies the given structure to the pattern:

note("c3,eb3,g3")
  .struct("x ~ x ~ ~ x ~ x ~ ~ ~ x ~ x ~ ~")
  .slow(4)

stut

Deprecated. Like echo, but the last 2 parameters are flipped.

s("bd sd").stut(3, .8, 1/6)

sub

Like add, but the given numbers are subtracted.

"0 2 4".sub("<0 1 2 3>").scale('C4 minor').note()
// See add for more information.

superimpose

Superimposes the result of the given function(s) on top of the original pattern:

"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*4"
  .superimpose(x=>x.add(2))
  .scale('C minor').note()

sustain

Amplitude envelope sustain level: The level which is reached after attack / decay, being sustained until the offset.

note("c3 e3").decay(.2).sustain("<0 .1 .4 .6 1>")

timeCat

Like {@link Pattern.seq}, but each step has a length, relative to the whole.

timeCat([3,e3],[1, g3]).note() // "e3@3 g3".note()

toBipolar

Assumes a numerical pattern, containing unipolar values in the range 0 ..

  1. Returns a new pattern with values scaled to the bipolar range -1 .. 1

transpose

Change the pitch of each value by the given amount. Expects numbers or note strings as values. The amount can be given as a number of semitones or as a string in interval short notation. If you don't care about enharmonic correctness, just use numbers. Otherwise, pass the interval of the form: ST where S is the degree number and T the type of interval with

  • M = major
  • m = minor
  • P = perfect
  • A = augmented
  • d = diminished

Examples intervals:

  • 1P = unison
  • 3M = major third
  • 3m = minor third
  • 4P = perfect fourth
  • 4A = augmented fourth
  • 5P = perfect fifth
  • 5d = diminished fifth

"c2 c3".fast(2).transpose("<0 -2 5 3>".slow(2)).note()
"c2 c3".fast(2).transpose("<1P -2M 4P 3m>".slow(2)).note()

tri

A triangle signal between 0 and 1.

tri.segment(8).range(0,7).scale('C minor').note()

undegradeBy

Inverse of {@link Pattern#degradeBy}: Randomly removes events from the pattern by a given amount. 0 = 100% chance of removal 1 = 0% chance of removal Events that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).

s("hh*8").undegradeBy(0.2)

unit

Used in conjunction with {@link speed}, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using unit "c" means speed will be interpreted in units of cycles, e.g. speed "1" means samples will be stretched to fill a cycle. Using unit "s" means the playback speed will be adjusted so that the duration is the number of seconds specified by speed.

speed("1 2 .5 3").s("bd").unit("c").osc()

velocity

Sets the velocity from 0 to 1. Is multiplied together with gain.

s("hh*8")
.gain(".4!2 1 .4!2 1 .4 1")
.velocity(".4 1")

voicing

Turns chord symbols into voicings. You can use the following control params:

  • chord: Note, followed by chord symbol, e.g. C Am G7 Bb^7
  • dict: voicing dictionary to use, falls back to default dictionary
  • anchor: the note that is used to align the chord
  • mode: how the voicing is aligned to the anchor
    • below: top note <= anchor
    • duck: top note <= anchor, anchor excluded
    • above: bottom note >= anchor
  • offset: whole number that shifts the voicing up or down to the next voicing
  • n: if set, the voicing is played like a scale. Overshooting numbers will be octaved

All of the above controls are optional, except chord. If you pass a pattern of strings to voicing, they will be interpreted as chords.

voicing("<C Am F G>")
n("0 1 2 3 4 5 6 7").chord("<C Am F G>").voicing()

voicings

DEPRECATED: still works, but it is recommended you use .voicing instead (without s). Turns chord symbols into voicings, using the smoothest voice leading possible. Uses chord-voicings package.

stack("<C^7 A7 Dm7 G7>".voicings('lefthand'), "<C3 A2 D3 G2>").note()

vowel

Formant filter to make things sound like vowels.

note("c2 <eb2 <g2 g1>>").s('sawtooth')
.vowel("<a e i <o u>>")

when

Applies the given function whenever the given pattern is in a true state.

"c3 eb3 g3".when("<0 1>/2", x=>x.sub(5)).note()

withContext

Returns a new pattern with the given function applied to the context field of every hap.

withHap

As with {@link Pattern#withHaps}, but applies the function to every hap, rather than every list of haps.

withHaps

Returns a new pattern with the given function applied to the list of haps returned by every query.

withHapSpan

Similar to {@link Pattern#withQuerySpan}, but the function is applied to the timespans of all haps returned by pattern queries (both part timespans, and where present, whole timespans).

withHapTime

As with {@link Pattern#withHapSpan}, but the function is applied to both the begin and end time of the hap timespans.

withLoc

Returns a new pattern with the given location information added to the context of every hap.

withQuerySpan

Returns a new pattern, where the given function is applied to the query timespan before passing it to the original pattern.

withQueryTime

As with {@link Pattern#withQuerySpan}, but the function is applied to both the begin and end time of the query timespan.

withValue

Returns a new pattern, with the function applied to the value of each hap. It has the alias {@link Pattern#fmap}.

"0 1 2".withValue(v => v + 10).log()

zoom

Plays a portion of a pattern, specified by the beginning and end of a time span. The new resulting pattern is played over the time period of the original pattern:

s("bd*2 hh*3 [sd bd]*2 perc").zoom(0.25, 0.75)
// s("hh*3 [sd bd]*2") // equivalent



页:  1  2  3  (下一个)
  全部