Plaster
New
List
Login
text
default
gingerale
2018.01.01 13:45:05
There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION CL-MIXED:SIZE (5)> when called with arguments (0.0). [Condition of type SIMPLE-ERROR] Restarts: 0: [RETRY] Retry calling the generic function. 1: [CONTINUE] Continue with fingers crossed. 2: [ABORT] abort thread (#<THREAD "#<DEFAULT-SERVER running> process thread." RUNNING {100565EDD3}>) Backtrace: 0: ((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION CL-MIXED:SIZE (5)> 0.0) [fast-method] 1: (SB-PCL::CALL-NO-APPLICABLE-METHOD #<STANDARD-GENERIC-FUNCTION CL-MIXED:SIZE (5)> (0.0)) 2: ((:METHOD HARMONY:PROCESS (HARMONY:BUFFER-SOURCE T)) #<HARMONY:BUFFER-SOURCE playing> 441) [fast-method] Locals: HARMONY:BUFFERS = #(0.0 0.09505605 0.18925126 0.2817326 0.3716625 0.45822653 ...) CL-MIXED:OUTPUTS = #(#<CL-MIXED:BUFFER {1002938983}>) HARMONY:SAMPLES = 441 HARMONY:SOURCE = #<HARMONY:BUFFER-SOURCE playing> 3: ((LAMBDA (HARMONY:SAMPLES HARMONY:SEGMENT) :IN "/home/janne/apps/portacle/projects/shirakumo/harmony/source.lisp") 441 #.(SB-SYS:INT-SAP #X7FFFE8038260)) 4: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/home/janne/apps/portacle/lin/asdf/cache/SBCL-1.3.17-Linux-X86-64/home/janne/apps/portacle/projects/shirakumo/cl-mixed/segments..
Raw
Annotate
Repaste
Annotations
common-lisp
default
gingerale
2018.01.01 13:48:05
(defun play (waves duration) ;; WAVES is a list of floats that rule wave frequencies, DURATION is the duration of the sample generated in seconds (unless harmony-simple:*server* (harmony-simple:initialize)) (unless (harmony-simple:started-p) (error "Harmony is stopped")) (let* ((sample-rate (harmony:samplerate harmony-simple:*server*)) (data (make-array (floor (* duration sample-rate)) :element-type 'single-float :initial-element 0.0s0))) (generate-wave waves data sample-rate) ;; This generates the wanted output and fills out the data array (harmony-simple:play 'harmony:buffer-source :sfx :buffers data)))
Raw
Repaste