Simulated Dancing Tesla Coil - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Prolific Programmers (https://qb64phoenix.com/forum/forumdisplay.php?fid=26) +---- Forum: SierraKen (https://qb64phoenix.com/forum/forumdisplay.php?fid=62) +---- Thread: Simulated Dancing Tesla Coil (/showthread.php?tid=2960) |
Simulated Dancing Tesla Coil - SierraKen - 08-17-2024 If you don't know already, a Tesla Coil is a metal rod that shoots out highly powered lightning bolts, which was invented by Nicola Tesla. This program is a simulation of that, where you tell it a .mp3 song to play and the lightning bolts jump around dancing to the song. There have been many real shows like this with real Tesla Coils, using music. This zip file also contains a small music album I created around 2005 or so and there's no lyrics, just electronic dance music I made using sound loops. Enjoy! Edit: This zip removed to add the ability to use both 64 and 32 bit computers. The update is below. RE: Simulated Dancing Tesla Coil - Petr - 08-17-2024 Hi SierraKen. It's a nicely done effect. I'm assuming you're using a 64-bit system, because a modest modification was needed in the 32-bit one: Row 77: Your: sz = _CV(_Unsigned _Integer64, _MK$(_Offset, SampleData.ELEMENTSIZE)) ' sz is the total size of the sound in bytes Repaired by me: sz = ConvertOffset(SampleData.ELEMENTSIZE) At the end the program i add ConvertOffset function downloaded from SMcNeill thread (the last one): https://qb64phoenix.com/forum/showthread.php?tid=66 Nicely done music RE: Simulated Dancing Tesla Coil - SierraKen - 08-17-2024 Thanks Petr! I'm glad you saw this! I tried your code with Steve's Function and got an error message in the Function. I also don't know how to use the Function with the variables it uses, so I'm just going to drop the 32 bit version (I use the 64 bit QB64), unless anyone wishes to tackle it. But thanks again! RE: Simulated Dancing Tesla Coil - SMcNeill - 08-18-2024 (08-17-2024, 04:56 PM)SierraKen Wrote: Thanks Petr! I'm glad you saw this! This function? Code: (Select All) FUNCTION ConvertOffset&& (value AS _OFFSET) Just plug it in, and on lin 67, make it: Code: (Select All) sz = ConvertOffset(SampleData.ELEMENTSIZE) RE: Simulated Dancing Tesla Coil - SierraKen - 08-18-2024 Thanks guys. I found the problem. It was using Explicit on the variables so DIM temp&& had to be added to the Function. So, hopefully this will run now on 32 bit computers. It works on my 64 bit. Here is the update. RE: Simulated Dancing Tesla Coil - a740g - 08-18-2024 I use the following. This is super fast as it just compiles to a C-style cast without any function calls. Code: (Select All)
RE: Simulated Dancing Tesla Coil - a740g - 08-18-2024 (08-18-2024, 04:04 PM)SierraKen Wrote: Thanks guys. I found the problem. It was using Explicit on the variables so DIM temp&& had to be added to the Function. So, hopefully this will run now on 32 bit computers. It works on my 64 bit. Nicely done! I am working on an audio visualization library and planning to include something like you did here as a vis option. RE: Simulated Dancing Tesla Coil - SierraKen - 08-18-2024 Thanks a740g! I credit Petr for most of the work. Hopefully you can work with the basic part of it for your own needs. |