| 4 | |
| 5 | The beeper device /dev/cardbeep accepts formatted strings containing various notes to play. The following notes are supported: |
| 6 | ||'''Note'''||'''Octave'''||'''Frequency (Hz)'''|| |
| 7 | ||C||5||523.25|| |
| 8 | ||D||5||587.33|| |
| 9 | ||E||5||659.26|| |
| 10 | ||F||5||698.46|| |
| 11 | ||G||5||783.99|| |
| 12 | ||A||5||880|| |
| 13 | ||B||5||987.77|| |
| 14 | ||C||6||1046.5|| |
| 15 | ||E||6||1318.5|| |
| 16 | ||G||6||1568|| |
| 17 | ||A||6||1760|| |
| 18 | ||C||7||2093|| |
| 19 | ||D||7||2349.3|| |
| 20 | ||E||7||2637|| |
| 21 | |
| 22 | A string can be formatted to send to the device in the format: |
| 23 | {{{ |
| 24 | |
| 25 | <duration><note><octave> |
| 26 | * duration |
| 27 | * 1 – 8, note = 1/duration |
| 28 | * 1 = whole (1/1) note |
| 29 | * 4 = quarter (1/4) note |
| 30 | * 8 = eighth (1/8) note |
| 31 | * note - letter from above table |
| 32 | * octave - number from above table |
| 33 | }}} |
| 34 | |
| 35 | Commas are used to separate note information, for example: |
| 36 | {{{ |
| 37 | 4A5,8E6 |
| 38 | }}} |
| 39 | Plays a 1/4 note A in octave five then a 1/8 note E in octave 6. |
| 40 | |
| 41 | The default octave may be set by: |
| 42 | {{{ |
| 43 | O<octave> |
| 44 | }}} |
| 45 | |
| 46 | Example: |
| 47 | {{{ |
| 48 | O5,A,B,C |
| 49 | }}} |
| 50 | Sets the default octave to 5 then plays note A, B, and C. |
| 51 | |
| 52 | The tempo may be set by: |
| 53 | {{{ |
| 54 | T<tempo> |
| 55 | }}} |
| 56 | ''tempo must be three characters numeric''' |
| 57 | |
| 58 | Example: |
| 59 | {{{ |
| 60 | T100,A,B |
| 61 | }}} |
| 62 | Sets the tempo to 100 then plays note A and B. |
| 63 | |
| 64 | Refer to the lib825ev library functions for sound output. |
| 65 | http://tech.825spectrum.com/trac/wiki/Docs/Prog/Manual/ApplicationLibraries/lib825ev/KeypadSound#KeypadSoundFunctions |
| 66 | |
| 67 | |