Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Implement cubic interpolation for non-looping oscillators. Tag as v1.1.0 (for real this time). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | v1.1.0 |
Files: | files | file ages | folders |
SHA3-256: |
9699e023ba9d7c55b3b141dec3fae821 |
User & Date: | alexa 2022-04-18 07:05:17 |
Context
2022-04-18
| ||
07:06 | Update README check-in: 4bb969e600 user: alexa tags: trunk | |
07:05 |
Implement cubic interpolation for non-looping oscillators. Tag as v1.1.0 (for real this time). check-in: 9699e023ba user: alexa tags: trunk, v1.1.0 | |
06:55 | Fix banner. check-in: 2ca263eaa6 user: alexa tags: trunk | |
Changes
Changes to src/oscillator.lisp.
︙ | ︙ | |||
110 111 112 113 114 115 116 | (define-typed-fn osc-fill-block/no-loop ((oscillator osc) (t/sfloat-array blk) (double-float pitch-ratio)) (boolean) (declare #+meltysynth-debug (optimize (speed 3) (debug 3) (safety 0) (compilation-speed 0)) #-meltysynth-debug (optimize (speed 3) (debug 1) (safety 0) (compilation-speed 0))) (loop with len fixnum = (length blk) for i fixnum from 0 below len | > > > > > > > > > > > > | > > > > | | | | | | > > > > | | < < > | > > > | > > > > | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | (define-typed-fn osc-fill-block/no-loop ((oscillator osc) (t/sfloat-array blk) (double-float pitch-ratio)) (boolean) (declare #+meltysynth-debug (optimize (speed 3) (debug 3) (safety 0) (compilation-speed 0)) #-meltysynth-debug (optimize (speed 3) (debug 1) (safety 0) (compilation-speed 0))) (loop with len fixnum = (length blk) for i fixnum from 0 below len do (let ((index0 0) (index1 0) (index2 0) (index3 0) (x0 0.0) (x1 0.0) (x2 0.0) (x3 0.0) (mu 0.0d0)) (declare (type fixnum index0 index1 index2 index3) (dynamic-extent index0 index1 index2 index3 x1 x2 mu)) (setf index0 (1- (the fixnum (truncate (osc-position osc))))) (setf index1 (1+ index0)) (setf index2 (1+ index1)) (setf index3 (1+ index2)) (when (>= index2 (osc-end osc)) (if (> i 0) (progn (fill blk 0.0 :start i :end (+ i (- len i))) (return-from osc-fill-block/no-loop t)) (return-from osc-fill-block/no-loop nil))) (when (>= index3 (osc-end osc)) (setf index3 index2)) (setf x0 (aref (osc-data osc) index0)) (setf x1 (aref (osc-data osc) index1)) (setf x2 (aref (osc-data osc) index2)) (setf x3 (aref (osc-data osc) index3)) (setf mu (- (osc-position osc) index1)) (ecase (osc-interpolation osc) (:linear (setf (aref blk i) (interpolate/linear x1 x2 mu))) (:cubic (locally (declare #+sbcl (sb-ext:muffle-conditions sb-ext:compiler-note)) (setf (aref blk i) (interpolate/cubic x0 x1 x2 x3 mu))))) (incf (osc-position osc) pitch-ratio))) t) (define-typed-fn osc-fill-block/continuous ((oscillator osc) (t/sfloat-array blk) (double-float pitch-ratio)) (boolean) (declare #+meltysynth-debug (optimize (speed 3) (debug 3) (safety 0) (compilation-speed 0)) #-meltysynth-debug (optimize (speed 3) (debug 1) (safety 0) (compilation-speed 0))) |
︙ | ︙ |