37
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: None.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// Note frequencies
|
|
20 |
#define SEQ_FREQ_A0 440
|
|
21 |
#define SEQ_FREQ_AsBf0 466 // 466.1637615 A#, Bb
|
|
22 |
#define SEQ_FREQ_B0 494 // 493.8833013
|
|
23 |
#define SEQ_FREQ_C0 523 // 523.2511306
|
|
24 |
#define SEQ_FREQ_CsDf0 554 // 554.365262 C#, Db, etc.
|
|
25 |
#define SEQ_FREQ_D0 587 // 587.3295358
|
|
26 |
#define SEQ_FREQ_DsEf0 622 // 622.2539674
|
|
27 |
#define SEQ_FREQ_E0 659 // 659.2551138
|
|
28 |
#define SEQ_FREQ_F0 698 // 698.4564629
|
|
29 |
#define SEQ_FREQ_FsGf0 740 // 739.9888454
|
|
30 |
#define SEQ_FREQ_G0 784 // 783.990872
|
|
31 |
#define SEQ_FREQ_GsAf0 831 // 830.6093952
|
|
32 |
#define SEQ_FREQ_A1 880
|
|
33 |
#define SEQ_FREQ_AsBf1 932 // 932.327523
|
|
34 |
#define SEQ_FREQ_B1 988 // 987.7666025
|
|
35 |
#define SEQ_FREQ_C1 1047 // 1046.502261
|
|
36 |
#define SEQ_FREQ_CsDf1 1109 // 1108.730524
|
|
37 |
#define SEQ_FREQ_D1 1175 // 1174.659072
|
|
38 |
#define SEQ_FREQ_DsEf1 1245 // 1244.507935
|
|
39 |
#define SEQ_FREQ_E1 1319 // 1318.510228
|
|
40 |
#define SEQ_FREQ_F1 1397 // 1396.912926
|
|
41 |
#define SEQ_FREQ_FsGf1 1480 // 1479.977691
|
|
42 |
#define SEQ_FREQ_G1 1568 // 1567.981744
|
|
43 |
#define SEQ_FREQ_GsAf1 1661 // 1661.21879
|
|
44 |
#define SEQ_FREQ_A2 1760
|
|
45 |
#define SEQ_FREQ_AsBf2 1865 // 1864.655046
|
|
46 |
#define SEQ_FREQ_B2 1976 // 1975.533205
|
|
47 |
#define SEQ_FREQ_C2 2093 // 2093.004522
|
|
48 |
#define SEQ_FREQ_CsDf2 2217 // 2217.461048
|
|
49 |
#define SEQ_FREQ_D2 2349 // 2349.318143
|
|
50 |
#define SEQ_FREQ_DsEf2 2489 // 2489.01587
|
|
51 |
#define SEQ_FREQ_E2 2673 // 2637.020455
|
|
52 |
#define SEQ_FREQ_F2 2794 // 2793.825851
|
|
53 |
#define SEQ_FREQ_FsGf2 2960 // 2959.955382
|
|
54 |
#define SEQ_FREQ_G2 3136 // 3135.963488
|
|
55 |
#define SEQ_FREQ_GsAf2 3322 // 3322.437581
|
|
56 |
#define SEQ_FREQ_A3 3520
|
|
57 |
#define SEQ_FREQ_AsBf3 3729 // 3729.310092
|
|
58 |
|
|
59 |
// Volume defines
|
|
60 |
#define SEQ_VOL_F 32767 // Forte = Loud
|
|
61 |
#define SEQ_VOL_MF 24575 // Mezzo forte = Medium loud
|
|
62 |
#define SEQ_VOL_MP 16383 // Mezzo piano = Medium soft
|
|
63 |
#define SEQ_VOL_P 8191 // Piano = Soft
|
|
64 |
|
|
65 |
|
|
66 |
STRUCT SEQ_2TONES
|
|
67 |
{
|
|
68 |
WORD duration;
|
|
69 |
WORD freq1;
|
|
70 |
WORD vol1;
|
|
71 |
WORD freq2;
|
|
72 |
WORD vol2;
|
|
73 |
}
|
|
74 |
|
|
75 |
STRUCT SEQ_LOOP
|
|
76 |
{
|
|
77 |
WORD repeats;
|
|
78 |
STRUCT tones[];
|
|
79 |
}
|
|
80 |
|
|
81 |
|
|
82 |
#define SEQ_DATA(A) SEQ_SIG A SEQ_CMD_RET
|
|
83 |
#define SEQ_VAL(N) N,
|
|
84 |
#define SEQ_LOOP(NUMBEROFTIMES,DATA) SEQ_CMD_STARTLOOP SEQ_VAL(NUMBEROFTIMES) DATA SEQ_CMD_ENDLOOP
|
|
85 |
#define SEQ_TONE(DUR,F1,V1) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(0) SEQ_VAL(0)
|
|
86 |
#define SEQ_2TONES(DUR,F1,V1,F2,V2) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(F2) SEQ_VAL(V2)
|
|
87 |
#define SEQ_SILENCE(DUR) SEQ_VAL(DUR) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0)
|
|
88 |
|
|
89 |
// DUR = number samples@8kHz hence 8000 = 1 second
|
|
90 |
// F1/F2 = frequency in Hz - can use note definitions above
|
|
91 |
// V1/V1 = volume in range 0-32767 - can use volume definitions above
|
|
92 |
// When playing two tones, sum of volumes should not be greater than 32767
|
|
93 |
// e.g. can use MF+P or MP+MP
|