Java script question

in a way you can...
the javascript inside of cheetah can call system code... now if the code is give data to work with... by writing the data to a file then call the routine with used the data and write out more data which can read by the javascript afterwards.

it is slow and clunky for now, but possible

Todd
 
added question

I wanted to read a *.wav file using Javascript and use frequencies in the file to determine the size of a shapes in a Cheetah3d project.

Does that sound do-able?
 
hi, .wav format seems to be simple binary format. so you can read directly via javascript of Cheetah3D.

here is a sample "Tool" script for creating spline object from .wav file. please check it.

regards.

tg_jp, Hiroto.
 

Attachments

  • Cheetah3D_sz_002.jpg
    Cheetah3D_sz_002.jpg
    43.3 KB · Views: 713
  • Wave Loader.js.zip
    1.6 KB · Views: 628
hi, .wav format seems to be simple binary format. so you can read directly via javascript of Cheetah3D.

here is a sample "Tool" script for creating spline object from .wav file. please check it.

regards.

tg_jp, Hiroto.

Hiroto,
I tried the wave loader script but the spline it produced looked very different.
Any ideas?
Thanks,
Mike
 

Attachments

  • WaveLoaderTest.jpg
    WaveLoaderTest.jpg
    118.1 KB · Views: 515
Can´t help you here as I don´t know how the conversion works.
Here´s just a comparison from a 2 sec sound file: Above as splines in Cheetah3d, beneath as a sound wave form. It´s a 8000Hz, 32-bit float sound so it´s not a common one. Maybe it don´t fits into the process as your´s. Maybe.

Cheers
Frank
 

Attachments

  • WaveVSsplines.png
    WaveVSsplines.png
    39.5 KB · Views: 513
Thanks Frank. Yeah, that nice wave form is what I'm trying to get to. I think it's some kind of log10 calculation.
 
If the WAV is encoded at more than 16 bits per sample it's probably not going to work. Try downsampling it (e.g. using Audacity).
 
hi,

Thas's a bug when you use it with 16 bit .wav file, as reported. I didn't check 16 bit file when I wrote it :p

I attached the latest version with 16 bit compatible. please try it.

actually, there are some variation of .wav format, if you have some problem with the script, please let me know, and I will check it with your .wav file. :)

* I fixed bug when 16 bit .wav file.
* I changed parameter names.

regards.

tg_jp, Hiroto
 

Attachments

  • Wave Loader.js.zip
    1.7 KB · Views: 569
Last edited:
Back
Top