Vcoderz Community

Vcoderz Community (http://forum.vcoderz.com/index.php)
-   Computers & Information Technologies (http://forum.vcoderz.com/forumdisplay.php?f=6)
-   -   Help - Music notes in C (http://forum.vcoderz.com/showthread.php?t=18341)

Google 05-28-2010 03:21 PM

Help - Music notes in C
 
I need someone who's good in enough in music to help me generate the Lebanese anthem ring-tone.
The C code below is a header file containing an array called Tones of type TonesStruct. This array contains the notes of "barney the dinosaur" song. I need to get the notes of the Lebanese anthem instead. It doesn't matter if you don't know C. At least I need the music notes.

Thank you.

Code:


#define    a              141    // 440 Hz,  a       
#define    ah            70      // 880 Hz,  ah         
#define    b              126    // 492 Hz,  b           
#define    bh            62      // 992 Hz,  bh         
#define    c              119    // 521 Hz,  c           
#define    ch            60      // 1042 Hz, ch         
#define    d              105    // 590 Hz,  d           
#define    dh            52      // 1179 Hz, dh         
#define    e              94      // 658 Hz,  e           
#define    eh            46      // 1330 Hz, eh         
#define    f              89      // 694 Hz,  f           
#define    fh            44      // 1389 Hz, fh         
#define    g              158    // 393 Hz,  g           
#define    gh            79      // 781 Hz,  gh
#define    SF            125    // scale factor
#define    NumOfNotes    16      // number of notes

// structure of tones and delays

typedef struct                           
{
    unsigned int TimeDelay;
    unsigned char Frequency[15];
} TonesStruct;

rom near TonesStruct Tones[] = {{250*SF, {c, c, d, e, c, e, d, g, c, c, d, e, 0}},

                                {500*SF, {c, b, 0}},
                                {250*SF, {c, c, d, e, f, e, d, c, b, dh, a, b, 0}},   
                                {500*SF, {c, c, 0}},                                   
                                {375*SF, {ah, 0}},                       
                                {150*SF, {bh, 0}},                                   
                                {250*SF, {ah, gh, ah, bh, 0}},                   
                                {500*SF, {ch, 0}},                                   
                                {375*SF, {gh, 0}},                                   
                                {150*SF, {ah, 0}},                                   
                                {250*SF, {gh, f, 0}},                               
                                {500*SF, {e, gh, 0}},                               
                                {375*SF, {ah, 0}},                               
                                {150*SF, {bh, 0}},                               
                                {250*SF, {ah, gh, ah, bh, ch, ah, gh, ch, bh, dh, 0}},
                                {500*SF, {ch, ch, 0}}};



PS: I found this on the internet, but I'm not sure how to translate it 100% correct.

Bella 05-28-2010 06:00 PM

Do u need the music notes of the Lebanese anthem? I can write the notes, but i have no idea about: {500*SF,{375*SF ...

Google 05-28-2010 07:05 PM

Quote:

Originally Posted by Bella (Post 215645)
Do u need the music notes of the Lebanese anthem? I can write the notes, but i have no idea about: {500*SF,{375*SF ...


All I need is the tones and the delay of each.
Please, try what you're thinking of. It might be useful.

Bella 05-28-2010 07:55 PM

I can write the notes, but i don't know how to translate the croche, double croche, croche pointer ... like the language above ...

In G major:

G , D, D, B, D, G, A, B, C, B, D, B, C, A, D, B, G, B, A, A, G, F#, D, D, D, D, B, D, D, B, D, G, A, G, G, A, D, C, B, B, B, A, D, E, F#, G, G, G.

D, D, G, A, A, B, D, D, E, F#, F#, G, D, D, G, A, A, B, D, C, B, A, A, G, B, C, D, D, D, D, C, B, C, D, D, D, D, C, B, A, A, A, A, G, F#, G, A, A, A, A, D, D, B, B, B, B, G, E, E, E, E, G, A, D, F#, F#, G



I usually play it in the C major:

C, G, G, E, G, C, D, D, E,
E, F, G, E, F, D, G, E, C, E, D,
C, G, G, E, G, C, D, D, E,
E, F, G, F, E, E, E, D, G, G, C, C, C, C,

G, G, C, D, D, E, G, G, A, B, B, C, G, G, G, C
G, G, C, D, D, E, G, F, E, D, D, C, G, G, C
E, F, G, G, G, G, F, E, F, G, G, G, G,
F, E, D, D, D, D, C, B, C, D, D, D, D,
G, G, E, E, E, E, C, B, A, A, A, A,
F, D, G, B, B, C, C, C, C

Google 05-28-2010 10:42 PM

Quote:

Originally Posted by Bella (Post 215653)
I can write the notes, but i don't know how to translate the croche, double croche, croche pointer ... like the language above ...

In G major:

G , D, D, B, D, G, A, B, C, B, D, B, C, A, D, B, G, B, A, A, G, F#, D, D, D, D, B, D, D, B, D, G, A, G, G, A, D, C, B, B, B, A, D, E, F#, G, G, G.

D, D, G, A, A, B, D, D, E, F#, F#, G, D, D, G, A, A, B, D, C, B, A, A, G, B, C, D, D, D, D, C, B, C, D, D, D, D, C, B, A, A, A, A, G, F#, G, A, A, A, A, D, D, B, B, B, B, G, E, E, E, E, G, A, D, F#, F#, G



I usually play it in the C major:

C, G, G, E, G, C, D, D, E,
E, F, G, E, F, D, G, E, C, E, D,
C, G, G, E, G, C, D, D, E,
E, F, G, F, E, E, E, D, G, G, C, C, C, C,

G, G, C, D, D, E, G, G, A, B, B, C, G, G, G, C
G, G, C, D, D, E, G, F, E, D, D, C, G, G, C
E, F, G, G, G, G, F, E, F, G, G, G, G,
F, E, D, D, D, D, C, B, C, D, D, D, D,
G, G, E, E, E, E, C, B, A, A, A, A,
F, D, G, B, B, C, C, C, C

Thanks for you and tony who tried to help.
That's what I want but I still need the timing. Like how much time each notes take. In my above example 250, 375, 500.. are used. I'm not restricted to those numbers but I need to have numbers that are proportional. For example, suppose you have G, E and the first note last for 1 second but the second one last for half a second, it would be good if you can tell me that G is 1000 and E is 500 for example.
And about the G major and C major, I don't know exactly what do you mean and what's the difference between them. I just need this ring-tone to be simple so it would be played by a buzzer of a machine.

Bella 05-29-2010 07:36 PM

Hope that this is what u need.

In seconds:
G: 0.5
D: 0.25
D: 0.25
B: 0.5
D: 0.5
G: 1
A: 1

B: 1
C: 0.75
B: 0.25
D: 1.75
B: 0.25

C: 1
A: 0.75
D: 0.25
B: 1
G: 0.75
B: 0.25

A: 1
A: 0.75
G: 0.25
F#: 0.5
D: 0.25
D: 0.25
D: 0.5
D: 0.5


B: 1
D: 0.25
D: 0.25
B: 0.5
D: 0.5
G: 1
A: 1

B: 1
B: 0.75
B: 0.25
A: 1
D- E- F#: 1




G: 1
G: 0.75
G: 0.25
G: 1
D: 0.75
D: 0.25

G:3
A: 0.75
A: 0.25

B: 1
D: 0.75
D: 0.25
E: 1
F# : 0.75
F#: 0.25

G: 3
D: 0.75
D: 0.25

G: 3
A: 0.75
A: 0.25

B: 1
D: 0.75
C: 0.25
B: 1
A: 0.75
A: 0.25

G: 3
B: 0.75
C: 0.25

D: 1
D: 0.75
D: 0.25
D: 0.5
C: 0.5
B: 0.75
C: 0.25




D: 1
D: 0.75
D: 0.25
D: 1
C: 0.75
B: 0.25

A: 1
A: 0.75
A: 0.25
A: 0.5
G: 0.5
F#: 0.75
G: 0.25

A: 1
A: 0.75
A: 0.25
A: 1
D: 0.75
D: 0.25

B: 1
B: 0.75
B: 0.25
B: 1
G: 0.75
D: 0.25

E: 1
E: 0.75
E: 0.25
E: 1
C: 0.75
A: 0.25

D: 3
F: 0.75
F: 0.25

G: 4

And if you want them in numbers as u told me 1 sec => 1000:

G: 500
D: 250
D: 250
B: 500
D: 500
G: 1000
A: 1000

B: 1000
C: 750
B: 250
D: 750
B: 250

C: 1000
A: 750
D: 250
B: 1000
G: 750
B: 250

A: 1000
A: 750
G: 250
F#: 500
D: 250
D: 250
D: 500
D: 500


B: 1000
D: 250
D: 250
B: 500
D: 500
G: 1000
A: 1000

B: 1000
B: 750
B: 250
A: 1000
D- E- F#: 1000


G: 1000
G: 750
G: 250
G: 1000
D: 750
D: 250

G: 3000
A: 750
A: 250

B: 1000
D: 750
D: 250
E: 1000
F#: 750
F#: 250

G: 3000
D: 750
D: 250

G: 3000
A: 750
A: 250

B: 1000
D: 750
C: 250
B: 1000
A: 750
A: 250

G: 3000
B: 750
C: 250

D: 1000
D: 750
D: 250
D: 500
C: 500
B: 750
C: 250




D: 1000
D: 750
D: 250
D: 1000
C: 750
B: 250

A: 1000
A: 750
A: 250
A: 500
G: 500
F#: 750
G: 250

A: 1000
A: 750
A: 250
A: 1000
D: 750
D: 250

B: 1000
B: 750
B: 250
B: 1000
G: 750
D: 250

E: 1000
E: 750
E: 250
E: 1000
C: 750
A: 250

D: 3000
F: 750
F: 250

G: 4000


Google 05-29-2010 08:53 PM

Thank you very much. This is exactly what I want.
I'll integrate this in the code, generate the sound and post it here.
I hope it works well.

Google 05-29-2010 10:04 PM

I just have a question. Can you tell me these notes are which ones in this table?
=> http://www.intmath.com/Trigonometric-graphs/music.php

Cause I need to know what frequencies to use.

Google 05-29-2010 11:03 PM

Well, I already tried the above notes with the follwoing frequencies:

Code:

A => 440 Hz,  a               
B => 492 Hz,  b               
C => 521 Hz,  c               
D => 590 Hz,  d               
E => 658 Hz,  e               
F => 694 Hz,  f               
G => 393 Hz,  g           
FH => 369.99 Hz

Code:

rom near TonesStruct Tones[] =    {{500*SF, {G}},
{250*SF, {D,D}},
{500*SF, {B,D}},
{1000*SF, {G,A,B}},
{750*SF, {C}},
{250*SF, {B}},
{750*SF, {D}},
{250*SF, {B}},
{1000*SF, {C}},
{750*SF, {A}},
{250*SF, {D}},
{1000*SF, {B}},
{750*SF, {G}},
{250*SF, {B}},
{1000*SF, {B}},
{750*SF, {G}},
{250*SF, {B}},
{1000*SF, {A}},
{750*SF, {A}},
{250*SF, {G}},
{500*SF, {FH}},
{250*SF, {D,D}},
{500*SF, {D,D}},
{1000*SF, {B}},
{250*SF, {D,D}},
{500*SF, {B,D}},
{1000*SF, {G,A}},
{1000*SF, {B}},
{750*SF, {B}},
{250*SF, {B}},
{1000*SF, {A,D,E,FH}},
{1000*SF, {G}},
{750*SF, {G}},
{250*SF, {G}},
{1000*SF, {G}},
{750*SF, {D}},
{250*SF, {D}},
{3000*SF, {G}},
{750*SF, {A}},
{250*SF, {A}},
{1000*SF, {B}},
{750*SF, {D}},
{250*SF, {D}},
{1000*SF, {E}},
{750*SF, {FH}},
{250*SF, {FH}},
{3000*SF, {G}},
{750*SF, {D}},
{250*SF, {D}},
{3000*SF, {G}},
{750*SF, {A}},
{250*SF, {A}},
{1000*SF, {B}},
{750*SF, {D}},
{250*SF, {C}},
{1000*SF, {B}},
{750*SF, {A}},
{250*SF, {A}},
{3000*SF, {G}},
{750*SF, {B}},
{250*SF, {C}},
{1000*SF, {D}},
{750*SF, {D}},
{250*SF, {D}},
{500*SF, {D,C}},
{750*SF, {B}},
{250*SF, {C}},
{1000*SF, {D}},
{750*SF, {D}},
{250*SF, {D}},
{1000*SF, {D}},
{750*SF, {C}},
{250*SF, {B}},
{1000*SF, {A}},
{750*SF, {A}},
{250*SF, {A}},
{500*SF, {A,G}},
{750*SF, {FH}},
{250*SF, {G}},
{1000*SF, {A}},
{750*SF, {A}},
{250*SF, {A}},
{1000*SF, {A}},
{750*SF, {D}},
{250*SF, {D}},
{1000*SF, {B}},
{750*SF, {B}},
{250*SF, {B}},
{1000*SF, {B}},
{750*SF, {G}},
{250*SF, {D}},
{1000*SF, {E}},
{750*SF, {E}},
{250*SF, {E}},
{1000*SF, {E}},
{750*SF, {C}},
{250*SF, {A}},
{3000*SF, {D}},
{750*SF, {F}},
{250*SF, {F}},
{4000*SF, {G}}};

I don't know what D- and E- are. I assumed them as D and E.

This is what I got => http://securepp.net/sound/sound.wma
It seems good at the end.
Is there any modification I can do on it to make it better?

Bella 05-30-2010 08:04 AM

While I was doing the frequencies I noticed that I missed a set of notes after the first 5 sets, I'll put it in red with the seconds and then I'll put the frequencies of all the notes:

G: 0.5
D: 0.25
D: 0.25
B: 0.5
D: 0.5
G: 1
A: 1

B: 1
C: 0.75
B: 0.25
D: 1.75
B: 0.25

C: 1
A: 0.75
D: 0.25
B: 1
G: 0.75
B: 0.25

A: 1
A: 0.75
G: 0.25
F#: 0.5
D: 0.25
D: 0.25
D: 0.5
D: 0.5


B: 1
D: 0.25
D: 0.25
B: 0.5
D: 0.5
G: 1
A: 1

B: 1 - 1000
B: 0.75 - 750
C: 0.25 - 250
D: 1 - 1000
C: 1 - 1000



The frequencies are:


C: 523.25
D: 587.33
C: 523.25



B: 493.88
B: 493.88
B: 493.88
A: 440
D- E- F#: 293.66-329.63-369.99

G: 392
G: 392
G: 392
G: 392
D: 293.66
D: 293.66

G: 392
A: 440
A: 440

B: 493.88
D: 293.66
D: 293.66
E: 329.63
F# : 369.99
F#: 369.99

G: 392
D: 293.66
D: 293.66

G: 392
A: 440
A: 440

B: 493.88
D: 587.33
C: 523.25
B: 493.88
A: 440
A: 440

G: 392
B: 493.88
C: 523.25

D: 587.33
D: 587.33
D: 587.33
D: 587.33
C: 523.25
B: 493.88
C: 523.25

D: 587.33
D: 587.33
D: 587.33
D: 587.33
C: 523.25
B: 493.88

A: 440
A: 440
A: 440
A: 440
G: 392
F#: 369.99
G: 392

A: 440
A: 440
A: 440
A: 440
D: 293.66
D: 293.66

B: 493.88
B: 493.88
B: 493.88
B: 493.88
G: 392
D: 293.66

E: 329.63
E: 329.63
E: 329.63
E: 329.63
C: 523.25
A: 440

D: 587.33
F: 349.23
F: 349.23

G: 783.99




All times are GMT +1. The time now is 07:11 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger