andrew clarke asked:

Michael P. Lang wrote:
> > struct Note
> > {
> >     int nPitch;
> >     int nDuration;
> > };
> >
> > Note noteMelody[4][10];
>
> What are the magic numbers for?
>
> 4 notes per bar, 10 bars?

Pitch and duration?

I didn't write the code, but I'm a musician, so I can see where he's going.
This is probably an over-simplification for you, Andrew, but pitch is the
frequency (generally expressed in Herz); and duration is how long to hold
the note. A musician would think in terms of quarters, eighths (or quavers
and semi-quavers, depending on which side of the pond you're on), but the
computer is probably thinking in milliseconds.

I doubt that pitch is 4 Hz. I suspect a bug in the code. The OP may want to
get the 4th of a table of pitches, and the 10th of a table of durations. He
will get instead the 10th element of the 4th element.

Multidimensional arrays throw a lot of people. Again, if this is to simple
for you, skip it. Let's say you have an array of teachers, and each teacher
has certain students.
Mr. Smith
        Jane
        Johnny
        Suzie
        Larry
        Curly
        Moe
Mr. Jones
        Richard
        Dick
        Rich
        Ritchie
        Rick
Mr. Wang
        Li Pengyou
        Deng Xiaoping
        Ding Ling
        Tan Kai Rui

StudentArray[3][3] would be "Ding Ling", because you're getting the third
teacher's third student.

Cordially,

Kerry Thompson

P.S: I'm not being flip with a name like "Ding Ling". She was a famous
Chinese author. I do like the name, though ^_^




To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to