Spin2Cpp authorities: could this be translated easily?
Ken Gracey
Posts: 7,392
Hey guys,
I've been playing around for quite a while with Chip's original FFT frequency analyzer code as modified by Pete Hemery. I built the Propeller Demo Board microphone circuit on a breadboard with a FLiP module and I'm using PST to display the note and frequency. I made a short video https://youtube.com/watch?v=Y4sjqXE9yjA which has since been improved to also display the correct note in Bb (clarinet) transposition, but you'll see it's right on with the frequencies.
I'm thinking about adding a couple of Blockly blocks for a C library if this Spin/ASM would readily translate it to C. The top Spin file doesn't really do what I want it to do yet - it would normally display the A4 frequency and the percent sharp/flat. All the variables are present along with a lot of other stuff I'd still need to remove from the code. Transposition could be handled in Blockly.
The goal would be to have a simple tuner in Blockly, but also the ability to control things with an instrument.
Recently, you guys (Dave Hein) did an amazing job porting the S3 spin files to C - and we've just about got Blockly switched over to the new C libraries.
I'm wondering if you'd be able to tell me about the feasibility of converting the attached file to C trough Spin2Cpp. It's not the final source code I'd like to use, so I'm just looking for some "gotchas" and pitfalls before I continue. If you think it would convert, I'll get the top Spin file in order and then come back here with the official request.
What do ya think?
Thanks,
Ken Gracey
I've been playing around for quite a while with Chip's original FFT frequency analyzer code as modified by Pete Hemery. I built the Propeller Demo Board microphone circuit on a breadboard with a FLiP module and I'm using PST to display the note and frequency. I made a short video https://youtube.com/watch?v=Y4sjqXE9yjA which has since been improved to also display the correct note in Bb (clarinet) transposition, but you'll see it's right on with the frequencies.
I'm thinking about adding a couple of Blockly blocks for a C library if this Spin/ASM would readily translate it to C. The top Spin file doesn't really do what I want it to do yet - it would normally display the A4 frequency and the percent sharp/flat. All the variables are present along with a lot of other stuff I'd still need to remove from the code. Transposition could be handled in Blockly.
The goal would be to have a simple tuner in Blockly, but also the ability to control things with an instrument.
Recently, you guys (Dave Hein) did an amazing job porting the S3 spin files to C - and we've just about got Blockly switched over to the new C libraries.
I'm wondering if you'd be able to tell me about the feasibility of converting the attached file to C trough Spin2Cpp. It's not the final source code I'd like to use, so I'm just looking for some "gotchas" and pitfalls before I continue. If you think it would convert, I'll get the top Spin file in order and then come back here with the official request.
What do ya think?
Thanks,
Ken Gracey
Comments
Just for fun, spin2cpp produced the C code from your Spin project and it was pulled into SimpleIDE and built as a project. Here's the .zip...
dgately
Eric
I don't know about code space (that would probably be a wash) but it would free up the cog that was being used for Float32.
Eric
I'll need some help from somebody at that point. Coding isn't the best use of my time in Parallax - not because I'm expensive but because I'm pretty slow at it and it makes for very bad value engineering from the employer's perspective. All coding brains were allocated to Chip in our family. But I'll take the traits for completion just a little jab for fun.
Ken Gracey