Good Sound Code for the Atom/Atom Pro

Anyone have a good sound code snippet for a cool melody? I want to use the “Sound” command in the Atom Pro, but was wondering if anyone already have a good melody I can try…

Please post any Sound command snippet here… :smiley:

Could be neat to try and reproduce the chirps and whistles of R2D2. :laughing:

We will Rock You…

Sound 9,[800000\392, 600000\370, 200000\0, 800000\330, 600000\294, 200000\0, 300000\330, 100000\0, 300000\330]

I can’t help with song snippets, but here is a big musical note frequency chart that might be useful.

And, from this page:

[code] STANDARD MUSICAL NOTE FREQUENCIES:
The equal-tempered scale of western music is based upon an octave (frequency doubling) that contains 12 notes, or “semitones”, each of which is 1.059463 (the 12th root of 2) times the one below it.

The standard musical tone frequencies of the equal-tempered piano keyboard are tabulated below, but you can find others by extending the series. To find the same note letter in the next higher octave, just multiply by 2. To go down one octave, divide by 2. For example, C0 = C1 / 2 = 32.703 / 2 = 16.352 Hz.

Notes that correspond to the black keys on a
standard piano keyboard are shown in boldface:

Note      Hz
A0       27.500
A#0      29.135
B0       30.868
C1       32.703
C#1      34.648
D1       36.708
D#1      38.891
E1       41.203
F1       43.654
F#1      46.249
G1       48.999
G#1      51.913
A1       55.000
A#1      58.270
B1       61.735
C2       65.406
C#2      69.296
D2       73.416
D#2      77.782
E2       82.407
F2       87.307
F#2      92.499
G2       97.999
G#2     103.826
A2      110.000
A#2     116.541
B2      123.471
C3      130.813
C#3     138.591
D3      146.832
D#3     155.563
E3      164.814
F3      174.614
F#3     184.997
G3      195.998
G#3     207.652
A3      220.000
A#3     233.082
B3      246.942
C4      261.626     MIDDLE C
C#4     277.183
D4      293.665
D#4     311.127
E4      329.628
F4      349.228
F#4     369.994
G4      391.995
G#4     415.305
A4      440.000     Concert A
A#4     466.164
B4      493.883
C5      523.251
C#5     554.365
D5      587.330
D#5     622.254
E5      659.255
F5      698.456
F#5     739.989
G5      783.991
G#5     830.609
A5      880.000
A#5     932.328
B5      987.767
C6     1046.502
C#6    1108.731
D6     1174.659
D#6    1244.508
E6     1318.510
F6     1396.913
F#6    1479.978
G6     1567.982
G#6    1661.219
A6     1760.000
A#6    1864.655
B6     1975.533
C7     2093.005
C#7    2217.461
D7     2349.318
D#7    2489.016
E7     2637.020
F7     2793.826
F#7    2959.955
G7     3135.963
G#7    3322.438
A7     3520.000
A#7    3729.310
B7     3951.066
C8     4186.009

[/code]

Thanks for the code snippet and making this a sticky Beth! 8)

Name that tune…

A0     	CON 27.5
Ashrp0 	CON 29.135
B0  	CON 30.868
C1  	CON 32.703
Cshrp1 	CON 34.648
D1  	CON 36.708
Dshrp1 	CON 38.891
E1  	CON 41.203
F1  	CON 43.654
Fshrp1 	CON 46.249
G1  	CON 48.999
Gshrp1 	CON 51.913
A1  	CON 55
Ashrp1 	CON 58.27
B1  	CON 61.735
C2  	CON 65.406
Cshrp2 	CON 69.296
D2  	CON 73.416
Dshrp2 	CON 77.782
E2  	CON 82.407
F2  	CON 87.307
Fshrp2 	CON 92.499
G2  	CON 97.999
Gshrp2 	CON 103.826
A2  	CON 110
Ashrp2 	CON 116.541
B2  	CON 123.471
C3  	CON 130.813
Cshrp3 	CON 138.591
D3  	CON 146.832
Dshrp3 	CON 155.563
E3  	CON 164.814
F3  	CON 174.614
Fshrp3 	CON 184.997
G3  	CON 195.998
Gshrp3 	CON 207.652
A3  	CON 220
Ashrp3 	CON 233.082
B3  	CON 246.942
C4  	CON 261.626
Cshrp4 	CON 277.183
D4  	CON 293.665
Dshrp4 	CON 311.127
E4  	CON 329.628
F4  	CON 349.228
Fshrp4 	CON 369.994
G4  	CON 391.995
Gshrp4 	CON 415.305
A4  	CON 440
Ashrp4 	CON 466.164
B4  	CON 493.883
C5  	CON 523.251
Cshrp5 	CON 554.365
D5  	CON 587.33
Dshrp5 	CON 622.254
E5  	CON 659.255
F5  	CON 698.456
Fshrp5 	CON 739.989
G5  	CON 783.991
Gshrp5 	CON 830.609
A5  	CON 880
Ashrp5 	CON 932.328
B5  	CON 987.767
C6  	CON 1046.502
Cshrp6 	CON 1108.731
D6  	CON 1174.659
Dshrp6 	CON 1244.508
E6  	CON 1318.51
F6  	CON 1396.913
Fshrp6 	CON 1479.978
G6  	CON 1567.982
Gshrp6 	CON 1661.219
A6  	CON 1760
Ashrp6 	CON 1864.655
B6  	CON 1975.533
C7  	CON 2093.005
Cshrp7 	CON 2217.461
D7  	CON 2349.318
Dshrp7 	CON 2489.016
E7  	CON 2637.02
F7  	CON 2793.826
Fshrp7 	CON 2959.955
G7  	CON 3135.963
Gshrp7 	CON 3322.438
A7  	CON 3520
Ashrp7 	CON 3729.31
B7  	CON 3951.066
C8  	CON 4186.009

hldRandom var long
hldRandom = random TCA 
 
main

gosub myfunc3[150,C6]
gosub myfunc3[150,A5]
gosub myfunc3[150,F5]
pause 150 
gosub myfunc3[150,F5]
pause 150
gosub myfunc3[150,F5]
gosub myfunc3[150,G5]
gosub myfunc3[150,A5]
gosub myfunc3[150,Ashrp5]
gosub myfunc3[200,C6]
pause 100
gosub myfunc3[200,C6]
pause 100
gosub myfunc3[350,C6]
gosub myfunc3[200,A5]

;Randomly play it again
hldRandom = random hldRandom ; uses "hldRandom" to generate a new "hldRandom" 
serout s_out,i9600,[DEC hldRandom, 13] ; See the random value
pause hldRandom 

exception main

goto main 

duration 	var word
note 		var word

myfunc3[duration,note]

sound p9,[duration\note]
return

Anyone have any new compositions? I like using the sound feature as part of my debug, if I’m going to have an indicator using sound, might as well as be pleasant :slight_smile:

It’s not very complex but here is the “victory” song the iRobot Roomba Vacuum cleaner plays after returning to its charging base. It seems very fitting for signaling the completion of any program.

sound 9, [200\523, 200\659, 200\784, 300\1046, 100\0, 175\1046, 450\1397]