home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1995-07-28 | 1.6 KB | 51 lines |
- || TimeStretch V0.01 alpha
- || written on 28th July 1995 by Benjamin Bommer for private needs,
- || and that's why it sucks...
- || anyway: read the accompanying note on how it's done
- || if you want to include this in your own programms,
- || (thinking of Computer Concepts' totally underdeveloped AudioWorks)
- || because I'm not gonna write a sample-editor just to stuff this
- || effect somewhere...
- || This is public domain.
- "Samplename : ";name$
- )x% =
- ("<stretch$dir>.Input."+name$)
- "OS_Args",2,x%
- ,,length%
- sample_in% (length%+1024)
- "load <stretch$dir>.Input."+name$+" "+
- ~sample_in%
- "Input-File loaded"
- /out% =
- ("<stretch$dir>.stretched."+name$)
- "Output-file opened":
- "Original file length: ";length%
- values to change:
- smooth% should not be greater than chsize%
- (chsize% = 256 :
- chunksize in bytes
- !'stretch = 4 :
- stretching factor
- "0smooth% = 30 :
- area to overlap (in bytes)
- chk% = 0
- outl% = 0
- chknr% = length%/chsize%
- "Bytes written: ";outl%;", ";
- (outl%/length%*100);"% stretched"
- .:in1% = sample_in% + chk%*chsize%*(1/stretch) + smooth%
- a% = 1
- chsize%-smooth%
- #out%,?(in1%):outl%+=1
- in1%+=1
- chk%+=1
- smooth%<>0
- 83 in2% = sample_in% + chk%*chsize%*(1/stretch)
- a% = 0
- smooth%-1
- :B
- #out%,(?in1%)*(1-(1/smooth%)*a%)+(?in2%)*((1/smooth%)*a%)
- ; outl%+=1:in1%+=1:in2%+=1
- in1%>=sample_in%+length%
- #out%
-