Musical scale: Difference between revisions
m
→version 2: misplaced comma
m (→version 2: misplaced comma) |
|||
Line 586:
hdrSize = 44,
fileLen = dataLength + hdrSize - 8,
freqs = { 261.6, 293.6, 329.6, 349.2, 392.0, 440.0, 493.9, 523.3 }
wavhdr = "RIFF"&
int_to_bytes(fileLen,4)&
Line 599:
int_to_bytes(8,2)& -- bits per sample (bps) (= 8)
"data"&
int_to_bytes(dataLength,4)
if length(wavhdr)!=hdrSize then ?9/0 end if -- sanity check
integer fn = open("notes.wav", "wb")
puts(fn, wavhdr)
|