twinkle twinkle little star
hitsware
Posts: 156
cx data 8,6,9,6:nx data 2,4,3,4
c var nib (4):n var nib(4):x var nib:y var nib
for x=0 to 3:read cx+x,c(x):read nx+x,n(x):next
play:for x=0 to 3:for y=0 to 3
freqout 0,400,c(x)*n(y)*8,c(x)*n(y)*16
next[noparse]:next:[/noparse]goto play
c var nib (4):n var nib(4):x var nib:y var nib
for x=0 to 3:read cx+x,c(x):read nx+x,n(x):next
play:for x=0 to 3:for y=0 to 3
freqout 0,400,c(x)*n(y)*8,c(x)*n(y)*16
next[noparse]:next:[/noparse]goto play
Comments
Is there a question or information in your post? The code you posted is incomplete, unformatted and there is no statement or question to assist us in identifying what your post is to convey.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Evedently not
>The code you posted is incomplete,
It runs with stamp2.exe
and a BS2
>unformatted and there is no statement or question
>to assist us in identifying what your post is to convey.
If you hook your sterero (via Y plug to (p0 (of your stamp)to both channels))
(and run the code) you will hear what I mean.
Just trying to show the musical abilities of a BS ........
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
nx data 2,4,3,4 'to have disappeared(or I can't find)) asking for a
c var nib (4) ' pic version of "twinkle twinkle little star".
n var nib(4) 'This is not that tune, but demonstrates one
x var nib 'method of generating music with a stamp2
y var nib 'cx = chord
for x=0 to 3 'nx=note
read cx+x,c(x) 'for instance for the notes in
read nx+x,n(x) '(major chords have a 3,4,5 frequency ratio)
next 'Cmaj:
play '6*3=18=G,6*4=24=C,6*5=30=E
for x=0 to 3 '6,8,9 gives the ratios of the 3 major chords
for y=0 to 3 'in a key (say C,F,G)
freqout 0,400,c(x)*n(y)*8,c(x)*n(y)*16 '
next
next
goto play
t var nib
x var byte
a con 40
c con 24
d con 27
e con 30
f con 32
g con 36
q con 1
h con 2
for x=0 to 26
lookup x,[noparse][[/noparse]c,c,g,g,a,a,g,f,f,e,e,d,d,c,g,g,f,e,e,d,g,g,f,f,e,e,d],n
lookup x,[noparse][[/noparse]q,q,q,q,q,q,h,q,q,q,q,q,q,h,q,q,h,q,q,h,q,q,q,q,q,q,h],t
freqout 0,t*300,n*11
next
for x=0 to 13
lookup x,[noparse][[/noparse]c,c,g,g,a,a,g,f,f,e,e,d,d,c],n
lookup x,[noparse][[/noparse]q,q,q,q,q,q,h,q,q,q,q,q,q,h],t
freqout 0,t*300,n*11
next