RTW = RENOISE TXT WAVE

Hi,
I’ve discovered how to create a sample using a simple txt file generated from a lisp in autocad,
try double click these txt in the sample Windows (make shure have “show all files” enabled)
then enable loop mode to forward and set base note to A1
Enjoy
Attachment 5148 not found.

The structure of the txt is very simple:
each sample is 2 character long, the first is “space: ascii 32 (alt+32)” the second is the value of the sample with a depth of 8 bit, ascii from 384 (y=-1) to 639 (y=+1).
Then if you want a wave 100 sample long, you have to make a txt with 200 value in a single line.

Very nice thx

This thread would fit into “Tips and Tricks” better than “Ideas and Suggestions”.

You are right! How move it?

Moved.

Oh, the idea might be cool. But I think this is kind of specific “feature” to the programming language you’re using - so why, instead of showing of the results and the “format”, aren’t you going deeper into the process of creating those files? You mentioned lisp/autocad, so there must be some convenience in this technique?

Other than that, I think renoise can import “raw” waveforms with a format you choose in preferences? So why use .txt format with “faked” 8bit, when you can use virtually any programming language to write the values directly in binary into a file, and load that via the same raw import you’re using for importing your files? Also renoise could load 8bit directly, in preferences you can choose some extra params that raw data will be interpreted with. Naming the file “txt” is a bit queer, because if you open it with a text editor I guess that program will complain or display gibberish, or both.

Maybe using a graphics/pixel prog like gimp or photoshop, a 1 pixel higth monocrome 8/16 bpp line, and exporting that as “raw data” after manipulating with graphics tools, could be another nead technique to make up chipsound wavecycles! You could even use a picture with somekind of gradients or whatever, end export ever x’th line to get morphing wavecycles! I think I’ll try that idea tonight… :ph34r:/>/>

Btw it’s a “standard” thing in tracker scene and glitch style genres to load raw data of any kind of filetype into a sampler to interpret that as “audio” and process a little before using (much stuff sounds hard, and introduces dc offset!). Hm, recalling from ft2 days it seems like plain old ascii files had different (better) characteristics to unicode stuff…

These are the code that AutoCAD read to generate txt, I only know LISP Language.
I can generate also wav directly from autocad:
look at these samples:
http://www.acadballa.com/1dwg8smp.htm

(defun c:rtw () ;2014/07/17 ;RENOISE TXT WAVE crea txt che renoise legge come wave chr da 384 a 384+255
(setq f (open “c:\00\TXTWAVE.txt” “w”))
(setq samplerate 44100) ;fisso, non cambiare, impostare uguale al samplerate di default di renoise
(setq note1 33) ;nota midi C3=60 A3=69 A1=45 C1=36
(setq freq1 (* 440.0 (expt 2.0 (/ (- note1 69.0) 12.0))))
; (setq freq1 55) ;frequenza desiderata A3=440
(setq rate1 2.0)
(setq vol1 0.8)
(setq duration1 1.0)
; (setq duration1 (/ 1.0 freq1))
(setq sample (fix (* samplerate duration1))) ;numero di sample di un ciclo di forma d’onda
(setq asciistart 384) ;chr i=256 y=0, i=384 y=-1, i=512 y=0, i=640 y=1
(setq asciirange 256)
(setq a1 0.0 b1 0.0)
(setq dx (/ 1.0 samplerate))
(repeat (fix sample)
; (setq note11 (+ note1 (clfostp6 b1 0 7 12 0 7 12))) ;arp1
; (setq freq1 (fix (* 440.0 (expt 2.0 (/ (- note11 69.0) 12.0))))) ;arp1

; (setq vol1 (clfopto3 b1 0.5 1.0 0.1 0.0))
(setq min1 (+ asciistart (* asciirange 0.5 (- 1.0 vol1))))
(setq max1 (+ asciistart (* asciirange 0.5 (+ 1.0 vol1))))

(progn
(write-char 32 f) ;questo carattere serve sempre
;saw
; (setq y (clfosaw0 a1 min1 max1))
;sin
; (setq y (clfosin0 a1 min1 max1))
;tri
; (setq y (clfotri0 a1 min1 max1))
;squ
; (setq y (clfosqu0 a1 min1 max1))
;pdo
(setq wav11 2.0) ;0.0 0=sin 1=tri 2=squ 3=saw 4=noi
(setq exp11 1.0) ;1.0 0.1/10
(setq pul11 (clfopto3 b1 0.5 0.9 0.1 0.9)) ;0.5 0/1
(setq shr11 (clfopto3 b1 0.5 1.0 1.0 1.0)) ;1.0 0/1
(setq snc11 (clfopto3 b1 0.5 1.0 1.0 1.0)) ;1.0 0.1/10
(setq jmp11 0.5) ;0.5 0.1/0.9
(setq frq11 2.0) ;1.0 0.1/10
(setq amt11 0.0) ;0.5 0/10
(setq y (clfopdo1mix5 a1 min1 max1 wav11 exp11 pul11 shr11 snc11 jmp11 frq11 amt11))

(write-char (fix y) f)
)
(setq
da1 (* freq1 dx)
; da1 (* freq1 (clfopto3 b1 0.5 2 1 2) dx)
db1 (* rate1 dx)
a1 (+ a1 da1)
b1 (+ b1 db1)
)
)
(close f)
)

(defun clfopdo1mix5 (x min max i ex pw sh sy jp fr am / v00 v01 v02 v03 v04 ;PDO Phase Distortion Oscillator, i=position in the ppg wavetable, sy=sync sh=shrink pw=pulse width jp=jump fr=fmfreq am=fmamount ex=expt
y00 y01 y02 y03 y04)
(setq x (* sy (- x (fix x))))
(setq x (expt (clfopto5 x (* pw sh) (* pw sh) sh 0.0 jp (- 1 jp) 1.0 1.0) ex)) ;jump, new shrink 2014/07/15 1
(setq x (+ x (* am (/ (clfosin0 (* fr x) -1.0 1.0) (* 2 pi)))))
(setq v00 (+ (* -1 (abs (- i 0))) 1))
(setq v01 (+ (* -1 (abs (- i 1))) 1))
(setq v02 (+ (* -1 (abs (- i 2))) 1))
(setq v03 (+ (* -1 (abs (- i 3))) 1))
(setq v04 (+ (* -1 (abs (- i 4))) 1))
(if (<= v00 0) (setq v00 0))
(if (<= v01 0) (setq v01 0))
(if (<= v02 0) (setq v02 0))
(if (<= v03 0) (setq v03 0))
(if (<= v04 0) (setq v04 0))
(setq y00 (clfosin0 x min max)) ;0 sin
(setq y01 (clfotri0 x min max)) ;1 tri
(setq y02 (clfosqu0 x min max)) ;2 squ
(setq y03 (clfosaw0 x min max)) ;3 saw
(setq y04 (clfornd0 min max)) ;4 noi
(setq y (+ (* v00 y00) (* v01 y01) (* v02 y02) (* v03 y03) (* v04 y04)))
)

(defun clfosaw0 (x min max)
(setq x (- x (fix x)))
(setq y (clfopto4 x 0.5 0.5 0.0 1.0 -1.0 0.0))
(setq y (+ min (* (- max min) (/ (+ y 1.0) 2.0))))
(while (> (abs y) 1)
(progn
(if (> y 1) (setq y (- 2 y))) ;mirror
(if (< y -1) (setq y (- -2 y)))
)
)
(setq y y)
)

(defun clfosin0 (x min max)
(setq x (- x (fix x)))
(setq y (sin (* 2 pi x)))
(+ min (* (- max min) (/ (+ y 1.0) 2.0)))
)

(defun clfotri0 (x min max)
(setq x (- x (fix x)))
(setq y (clfopto4 x 0.25 0.75 0.0 1.0 -1.0 0.0))
(setq y (+ min (* (- max min) (/ (+ y 1.0) 2.0))))
(while (> (abs y) 1)
(progn
(if (> y 1) (setq y (- 2 y))) ;mirror
(if (< y -1) (setq y (- -2 y)))
)
)
(setq y y)
)

(defun clfosqu0 (x min max)
(setq x (- x (fix x)))
(setq y (clfopto6 x 0.0 0.5 0.5 1.0 0.0 1.0 1.0 -1.0 -1.0 0.0))
(setq y (+ min (* (- max min) (/ (+ y 1.0) 2.0))))
(while (> (abs y) 1)
(progn
(if (> y 1) (setq y (- 2 y))) ;mirror
(if (< y -1) (setq y (- -2 y)))
)
)
(setq y y)
)

(defun clfopto3 (x p2 q1 q2 q3) ;p=x q=y
(setq x (- x (fix x)))
(if (= p2 0) (setq y (+ q2 (* x (- q3 q2)))))
(if (and (> p2 0) (< p2 1))
(progn
(if (<= x p2)
(setq y (+ q1 (* (- x 0) (/ (- q2 q1) (- p2 0)))))
(setq y (+ q2 (* (- x p2) (/ (- q3 q2) (- 1.0 p2)))))
)
)
)
(if (= p2 1) (setq y (+ q1 (* x (- q2 q1)))))
(setq y y)
)

(defun clfopto4 (x p2 p3 q1 q2 q3 q4) ;p=x q=y
(setq x (- x (fix x)))
(if (<= x p2) (setq y (+ q1 (* (- x 0) (/ (- q2 q1) (- p2 0)))))
(if (<= x p3) (setq y (+ q2 (* (- x p2) (/ (- q3 q2) (- p3 p2)))))
(if (<= x 1.0) (setq y (+ q3 (* (- x p3) (/ (- q4 q3) (- 1.0 p3))))))))
)

(defun clfopto5 (x p2 p3 p4 q1 q2 q3 q4 q5) ;p=x q=y ADSR
(setq x (- x (fix x)))
(setq p2 (+ 0.0001 (* 0.9998 p2)))
(setq p3 (+ 0.0001 (* 0.9998 p3)))
(setq p4 (+ 0.0001 (* 0.9998 p4)))
(if (<= x p2) (setq y (+ q1 (* (- x 0) (/ (- q2 q1) (- p2 0)))))
(if (<= x p3) (setq y (+ q2 (* (- x p2) (/ (- q3 q2) (- p3 p2)))))
(if (<= x p4) (setq y (+ q3 (* (- x p3) (/ (- q4 q3) (- p4 p3)))))
(if (<= x 1.0) (setq y (+ q4 (* (- x p4) (/ (- q5 q4) (- 1.0 p4)))))))))
)

(defun clfopto6 (x p2 p3 p4 p5 q1 q2 q3 q4 q5 q6) ;p=x q=y
(setq x (- x (fix x)))
(setq p2 (+ 0.001 (* 0.998 p2)))
(setq p3 (+ 0.001 (* 0.998 p3)))
(setq p4 (+ 0.001 (* 0.998 p4)))
(setq p5 (+ 0.001 (* 0.998 p5)))
(if (<= x p2) (setq y (+ q1 (* (- x 0) (/ (- q2 q1) (- p2 0)))))
(if (<= x p3) (setq y (+ q2 (* (- x p2) (/ (- q3 q2) (- p3 p2)))))
(if (<= x p4) (setq y (+ q3 (* (- x p3) (/ (- q4 q3) (- p4 p3)))))
(if (<= x p5) (setq y (+ q4 (* (- x p4) (/ (- q5 q4) (- p5 p4)))))
(if (<= x 1.0) (setq y (+ q5 (* (- x p5) (/ (- q6 q5) (- 1.0 p5))))))))))
)