Author Topic: QB64 TankDrum - Playable/Recordable Virtual Instrument  (Read 5481 times)

0 Members and 1 Guest are viewing this topic.

FellippeHeitor

  • Guest
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #15 on: October 14, 2020, 08:39:05 pm »
Cool job, as usual, Dav. I like how recording works!

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #16 on: October 14, 2020, 10:39:38 pm »
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

- Dav
« Last Edit: October 14, 2020, 10:40:56 pm by Dav »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #17 on: October 14, 2020, 10:52:54 pm »
I wonder if you can also get the notes up on some visual music bars.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #18 on: October 15, 2020, 02:09:54 am »
@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
Shuwatch!

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #19 on: October 15, 2020, 04:56:02 pm »
@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
« Last Edit: October 16, 2020, 01:05:20 pm by Dav »

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #20 on: October 16, 2020, 01:12:58 pm »
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

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #21 on: October 16, 2020, 08:32:24 pm »
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.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: QB64 TankDrum - Playable/Recordable Virtual Instrument
« Reply #22 on: October 16, 2020, 10:40:56 pm »
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