spectral
spectral copied to clipboard
Exception while rendering
Hi Mike,
I wasn't sure where to post about this, but I tried out this code and am getting an exception:
CompilerException java.lang.RuntimeException: Can't determine count of dimension 1 on Object: class mikera.matrixx.Matrix, compiling:(pink_viz/core.clj:56:42)
That's from trying to integrate the code into my pink-viz project, but I get the same exception while using spectral. (Well, the freesound stuff doesn't seem to work, maybe it has to do with the version of Overtone; I tested with spectral in a repl using a (double-array 400000) as a the source for analysis.)
The above seems to occur when calling (mat/column-count M) or (mat/row-count M) on the returned matrix from Matrix/wrap in fft-matrix. I'm not familiar with core.matrix, so apologies I can't offer more information at this time.
Thanks! steven
OK thanks for the report I will check it out! Probably version conflicts, it is a while since I updated the dependencies.....
Hi @kunstmusik it's working for me - I just pushed some new code with updated dependencies. Not sure if this solves your problem - can you give it a try?
Ah! I think I figured out something. So what I found out after some digging is that in spectral, the core.clj file loads inst.clj. Now, on on my computer, the freesound stuff was causing an exception while loading core, and it turns out inst.clj wasn't getting required into the namespace. After that error, I would try evaluating code and then I'd get the error I reported.
It seems to me that the key part of what was missing is this:
(:require [mikera.vectorz.matrix-api])
This was in the inst.clj file. Once that gets required, everything works. I tried adding that require line into my pink-viz project and everything worked. So that exception I got was throwing everything off for loading spectral here, and when I tried the code out separately in pink-viz, I didn't see the require.
For spectral, maybe that require could be added to core.clj?
Also, one other question: is the data to be given to to the fft-matrix function in spectral expecting to be in the range of shorts (+/-32768) or +/-1.0? I tried the functions with +-1.0 initially but got a blue square, but then I multiplied my array by 32768 and got something more heat-map-ish.
On Wed, Mar 11, 2015 at 9:32 PM, Mike Anderson [email protected] wrote:
Hi @kunstmusik https://github.com/kunstmusik it's working for me - I just pushed some new code with updated dependencies. Not sure if this solves your problem - can you give it a try?
— Reply to this email directly or view it on GitHub https://github.com/mikera/spectral/issues/2#issuecomment-78408284.