ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


4 - Tone Frequency

The piezo_tone structure is filled and passed to the function, and is used both to set the frequency of the note and its duration. The first value, tone, can be any of 256 possible values that can range from 64 hertz to over 8 kilohertz (and silence), as the table shows:

Tone Number and Frequency Values (in hertz) for piezo_tone Structure
0 (silence) 1 8,192.0 2 5,461.3 3 4,096.0 4 3,276.8 5 2,730.7 6 2,340.6 7 2,048.0
8 1,820.4 9 1,638.4 10 1,489.5 11 1,365.3 12 1,260.3 13 1,170.3 14 1,092.3 15 1,024.0
16 963.8 17 910.2 18 862.3 19 819.2 20 780.2 21 744.7 22 712.3 23 682.7
24 655.4 25 630.2 26 606.8 27 585.1 28 565.0 29 546.1 30 528.5 31 512.0
32 496.5 33 481.9 34 468.1 35 455.1 36 442.8 37 431.2 38 420.1 39 409.6
40 399.6 41 390.1 42 381.0 43 372.4 44 364.1 45 356.2 46 348.6 47 341.3
48 334.4 49 327.7 50 321.3 51 315.1 52 309.1 53 303.4 54 297.9 55 292.6
56 287.4 57 282.5 58 277.7 59 273.1 60 268.6 61 264.3 62 260.1 63 256.0
64 252.1 65 248.2 66 244.5 67 240.9 68 237.4 69 234.1 70 230.8 71 227.6
72 224.4 73 221.4 74 218.5 75 215.6 76 212.8 77 210.1 78 207.4 79 204.8
80 202.3 81 199.8 82 197.4 83 195.0 84 192.8 85 190.5 86 188.3 87 186.2
88 184.1 89 182.0 90 180.0 91 178.1 92 176.2 93 174.3 94 172.5 95 170.7
96 168.9 97 167.2 98 165.5 99 163.8 100 162.2 101 160.6 102 159.1 103 157.5
104 156.0 105 154.6 106 153.1 107 151.7 108 150.3 109 148.9 110 147.6 111 146.3
112 145.0 113 143.7 114 142.5 115 141.2 116 140.0 117 138.8 118 137.7 119 136.5
120 135.4 121 134.3 122 133.2 123 132.1 124 131.1 125 130.0 126 129.0 127 128.0
128 127.0 129 126.0 130 125.1 131 124.1 132 123.2 133 122.3 134 121.4 135 120.5
136 119.6 137 118.7 138 117.9 139 117.0 140 116.2 141 115.4 142 114.6 143 113.8
144 113.0 145 112.2 146 111.5 147 110.7 148 110.0 149 109.2 150 108.5 151 107.8
152 107.1 153 106.4 154 105.7 155 105.0 156 104.4 157 103.7 158 103.0 159 102.4
160 101.8 161 101.1 162 100.5 163 99.9 164 99.3 165 98.7 166 98.1 167 97.5
168 96.9 169 96.4 170 95.8 171 95.3 172 94.7 173 94.2 174 93.6 175 93.1
176 92.6 177 92.0 178 91.5 179 91.0 180 90.5 181 90.0 182 89.5 183 89.0
184 88.6 185 88.1 186 87.6 187 87.1 188 86.7 189 86.2 190 85.8 191 85.3
192 84.9 193 84.5 194 84.0 195 83.6 196 83.2 197 82.7 198 82.3 199 81.9
200 81.5 201 81.1 202 80.7 203 80.3 204 79.9 205 79.5 206 79.1 207 78.8
208 78.4 209 78.0 210 77.6 211 77.3 212 76.9 213 76.6 214 76.2 215 75.9
216 75.5 217 75.2 218 74.8 219 74.5 220 74.1 221 73.8 222 73.5 223 73.1
224 72.8 225 72.5 226 72.2 227 71.9 228 71.5 229 71.2 230 70.9 231 70.6
232 70.3 233 70.0 234 69.7 235 69.4 236 69.1 237 68.8 238 68.6 239 68.3
240 68.0 241 67.7 242 67.4 243 67.1 244 66.9 245 66.6 246 66.3 247 66.1
248 65.8 249 65.5 250 65.3 251 65.0 252 64.8 253 64.5 254 64.3 255 64.0


Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice