QB64.org Forum
Active Forums => Programs => Topic started by: Dav on October 13, 2020, 11:24:16 am
-
This is a little TankDrum instrument you can play and record little tunes with. It's easy to use, just click on the drum notes to play them. Hit R to record your playing in real-time. Hit P to play back your song. Hit C to clear it and start over. Your song can be saved to file and loaded again later. This was quickly thrown together, which is obvious in the code, I just wanted to get something working fast. I hope to improve this program soon, maybe use a more interesting scale, or perhaps allow selecting different scales. Enjoy.
- Dav
New in version 1.0c: Increased number of notes to 15, changed to a major scale, Can undo last recording process, can save/load/delete song.
Download TankDrum v1.0c Source (674k) -->
-
Damned if that doesn't look like a fancy smoke detector mounted on an acoustic ceiling tile :)
Well this looks like fun! Thanks Dav
-
Dang ogg files! Went to run the bas file and Windows Explorer hung up "loading directory"
[ This attachment cannot be displayed inline in 'Print Page' view ]
This line is not working:
Tried the typical fix of prefixing .\ but still not found. I am not going to see if double tankdrum\tandkdrum\tankdrum.ico from extract with Windows Explorer crashed computer one time already.
Really recommend putting ogg files in their own subdirectory so Windows users can access the bas or image files without hassles with Windows Explorer.
Anyway after restart after crash and some other trick to get the bas file loaded into QB64 before Explorer hangs everything up, after all that the sounds are really nice for musical instrument.
-
Wow...I didn't know (or forgot) about the ogg file problem. Putting them in a "tankdrum\ogg\" will fix that (And \tankdrum\img\ for images)? Also, I can leave out the .ico file if it's a problem with some windows versions. I sure didn't have any of those problems here using my lower windows version Win7, which is so out of date everyone tells me, is inferior to win10, and no longer even supported by M$ at all, but still works smoothly most all of the time (I'm only being sarcastic to Microsoft by the way, not you).
I really appreciate you going through the trouble bplus, and trying it out. I'll make the changes and put up another download as soon as I can. Thanks!
- Dav
-
Hi @Dav
It's just the ogg files that cause problems.
I liked Windows 7 the best and in my old man's opinion that includes the world going to hell in a hand-basket, Windows 7 was the Best! (Never used XP with QB64 and barely used it with VB6 before I switched everything to .NET and realized FT! and then there was a loss of a computer and... OTOH Steve makes a good case about getting stuck in the past, fuddy-duddy sort :) So don't think you are missing anything really valuable by not having 10 IMHO I am kind of envious :)
Anyway, the problem with loading ICO image I think is because when I extract with Windows 10 (the easy way) I get double folders of the extracted folder name twice. I am guessing that is what happened and why the usual fix didn't. I know it should be easy fix no matter what, I just am not going to use Explorer again to get to the base of the problem. Wait... I have my own Explorer now! thanks to QB64, I can work around and check.
Hey did you get that image from a smoke detector?
-
Lol @ smoke detector. Nope, it was a metal steel pan pic I heavily manipulated in my image tools and added some color gradients, texture and a background. I was going for a different look, and had a others versions, but got tired of messing with it so I went with the blue one. I copied the note layout from other tankdrums I have seen.
- Dav
-
Time for a Google, tankdrums, oh yeah! now I see, never saw that before.
-
I thought it was a Frizbee.
Handpans sound like this:
Looks like a fine way to abuse finger joints.
I'd try your program but I have the musical talent of a dead frog.
However, I did study the code to learn from it. Are you allergic
to arrays?
-
I've watched that video before. Hang drums like those sound cool. A good one cost thousands, so I'll probably never have one. I have had a tank drum made from a propane tank that cost a couple hundred, it did hurt the fingers pretty much and didn't sound near as good as the hand pans. Ended up giving the drum away to a friend who really adored it.
- Dav
-
I'll give this a try later today. Looks cool
-
Looks really cool, indeed! I'll be trying it out soon too!
-
I'd try your program but I have the musical talent of a dead frog.Are you allergic
to arrays?
Maybe it's a matter of finding the right instrument? I am betting this one will be fun to tinker with and that I believe is all it takes.
Despite my complaints of ogg files (and that is a Windows 10 problem) this one sounds really cool!
I haven't looked at the code but I doubt Dav is allergic to arrays, guess I will have to see WTH that's about?
-
Nah, I'm not allergic to arrays. I guess it depends what coding mood I'm in at the time. Sometimes I code quick and messy, other times neat and tidy. The more time spent on a program though I usually get it in better shape. You should see some of my first draft programs - looks like a beginner made them.
- Dav
-
You know I went to look at it again for the array usage and crashed my computer
again,
Man I thought you updated the zip and put the oggs in a separate folder, dang!
The post even says you had edited it.
-
I'm sorry. No I haven't updated it yet. I forgot to take my laptop with me today. Hanging out at my fathers home now this evening. I probably won't get to update the zip until tomorrow.
- Dav
-
Cool job, as usual, Dav. I like how recording works!
-
Thanks, Fellippe. I had another recording method at first, using multiple arrays. The first method had a timer running, and one array recorded the time a note was played, the other array recorded the notes. Worked very well, until I added overdubbing. For that I had to add two temp arrays and merge all array data. Had a hard time making that work, so I decided to get rid of all extra arrays and just use one running array, which worked the way I wanted. Hmm...maybe I do have an array allergy after all.
I have some big plans for a new version...
- Add Save/Load
-Increase to 15 notes, and major scale to play more kinds of songs
- Maybe some small extra percussion sounds
- A'Metronome sound for steady playing
-Time show for song length.
- Add looping Atmosphere sounds for background feel
- Move keyboard input to a GFX menu selection via mouse
I want to get it so it can play a real tankdrum song like this one (https://www.youtube.com/watch?v=ilTQWBaTG3M)
- Dav
-
I wonder if you can also get the notes up on some visual music bars.
-
@Dav As soon as I try to record, the program behaves quite sluggishly. The delays for note presses are quite long (up to 2 or 3 seconds) and it will sometimes play a few notes together all of a sudden when it catches up. During normal playing, it works quite well, however. I was able to play part of "The Lion Sleeps Tonight" using it haha
-
@bplus: I'll see about coming up with something for note display. Thanks for the suggestion.
@SpriggsySpriggs : Maybe the _LIMIT value is too low for your system, and it doesn't help that I put the LOCATE/PRINT stuff inside the DO/LOOP which causes a constant write to screen which isn't needed and slows it all down somewhat.
EDIT: (code here was removed because latest update made changes to fix problem, hopefully)
- Dav
-
I have posted a new version of TankDrum.
For v1.0c drum notes are increased to 15, and changed it to a major scale. Added UNDO after a recording in case you don't like what you recorded and want to do it over. Also added crude but functional song save/load/delete functions (song saved to a file called TANKDRUM.SAV). I increased _LIMIT number to hopefully prevent sluggish, and removed screen writes in the recording DO/LOOP. I also organized .ogg and images into separate folders.
Check the first post for the new download link.
- Dav
-
Good, I can explore files again. Can't figure out how to load the ico, just have to comment it out I guess, all else seems to work.
-
I'm glad there's no more crashing, and it's working ok. I may just ditch the .ico in the next release.
Trying to make it more visually appealing, I'm working on making every note highlight for a second when it plays. I'm using TIMER and note flags. When a note is struck, its flag is on, and the note will highlight for 1 second, then turn its flag off (each note has 2 .png images for that, one highlighted and one off). This makes a nice visual display going on while playing the drum. I've implemented 5 notes so far and it's working - it will be interesting to see if all 15 notes can be going using this method without making it too sluggish to play.
I resorted to using TIMER and flags because I couldn't use _SNDPLAYING to see when a note is playing
(which would make it much easier). I'm using _SNDPLAYCOPY to play sounds, and according to the wiki _SNDPLAYING only works with handles from _SNDOPEN and _SNDCOPY.
- Dav