Pages: 1 2 [3]   Go Down
Author Topic: LED with Music Notes  (Read 2295 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
CC GG AA G
Led1 Led1, Led2 Led2, Led3 Led3, Led2.
The names matching the notes says to me that you want Led1 on while note C is playing, Led2 on when note G is playing, Led3 on when note A is playing.

This is different from turning one led on when the first note plays, two leds on while the second note plays, three on while the third note plays, etc.

Or, maybe I'm not understanding your initial or current desire.
Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
CC GG AA G
Led1 Led1, Led2 Led2, Led3 Led3, Led2.
[1] The names matching the notes says to me that you want Led1 on while note C is playing, Led2 on when note G is playing, Led3 on when note A is playing.

[2] This is different from turning one led on when the first note plays, two leds on while the second note plays, three on while the third note plays, etc.

Or, maybe I'm not understanding your initial or current desire.

I think y'all are talking past each other a little bit.  I think the code/fix I just posted provides behavior he wants, [1] above.

Cheers,
John
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am sorry, I must not be explaining it right.

The notes used in the song are A,C,D E F G

Played like this ccggaag ffeeddc   ggffeed ggffeed  ccggaagffeeddc

(BTW as I am writing this I see one of my errors. I said 8 Notes and there are only 6)

Anyway I was thinking it would be cool to assign an LED to each note.

LED1 C, LED2 G LED3,A and so on.  This way every time it played C led1 came one G Led2 came on and so on.

Guy I am sorry I have not been explaining  myself very clearly and my spelling is not the best.

Thank for all you time and effort. I am learning.
« Last Edit: December 28, 2012, 08:45:23 pm by kculm » Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am sorry, I must not be explaining it right.

The notes used in the song are A,C,D E F G

Played like this ccggaag ffeeddc   ggffeed ggffeed  ccggaagffeeddc

(BTW as I am writing this I see one of my errors. I said 8 Notes and there are only 6)

Anyway I was thinking it would be cool to assign an LED to each note.

LED1 C, LED2 G LED3,A and so on.  This way every time it played C led1 came one G Led2 came on and so on.

Guy I not I have been explaining  myself very clearly and my spelling is not the best.

Thank for all you time and effort. I am learning.

I'm pretty sure I understand you kculm.  I posted the entire sketch, copy and paste the whole thing, run it, and let me know if that works.

You do have 8 LEDs wired up (on pins 2-9), correct?

Cheers,
John
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

John, Yes to Led's On pins 2-9  Spk on 11.

When I run your code all I get is one Note And led on pin2.

Thats it.

Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

John, Yes to Led's On pins 2-9  Spk on 11.

When I run your code all I get is one Note And led on pin2.

Thats it.

Does the note play and end, or play and stay playing?

Try taking out all the lines that start with "Serial."  There are three of them.

John
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Note Plays and ends Led/Pin2 Comes on for a sec or so and then Off.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Quote

Does the note play and end, or play and stay playing?

Try taking out all the lines that start with "Serial."  There are three of them.

John

Thats its, you the Man..
Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Quote

Does the note play and end, or play and stay playing?

Try taking out all the lines that start with "Serial."  There are three of them.

John

Thats its, you the Man..

Awesome.  Give me some karma (click the little + under my name).  I have a long way to go to catch up with PaulS smiley

Cheers,
John
Logged

Pages: 1 2 [3]   Go Up
Jump to: