Need Vic20 Music/SFX

Discuss anything related to the VIC
Post Reply
furroy
Vic 20 Drifter
Posts: 20
Joined: Sun Aug 27, 2023 5:03 am

Need Vic20 Music/SFX

Post by furroy »

I'm working on an RPG project, but I have no musical abilities... Looking for someone to help out! I have the VicTracker2.0 irq player already integrated, but if you have another tracker you would prefer and there's asm for an irq player, happy to switch.
forest.png
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Need Vic20 Music/SFX

Post by chysn »

An alternative to composing music is to use algorithmically-generated music. I'm an electronic music composer, but I've found that unexpanded memory is insufficient to store "notes" in most cases. So I use various forms of generative music in my games. Each of my games does it a bit differently, for variety, but the skeleton is based on a decade-old hardware synthesizer module designed by Tom Whitwell* that does this:

Code: Select all

(1) Randomize two 8-bit registers
(2) On a trigger (usually, but not necessarily, controlled by a clock):
  (a) Shift both registers left, and set bit 0 of each register to the carry bit of the other register
  (b) Potentially reverse the value of bit 0 of the "low register" based on probability
(3) Continuously emit voltage (0-5V) scaled to the value of one of the 8-bit registers
Usually the voltage from (3) is sent to the volt-per-octave input of an oscillator, either directly or via a quantizer for using specific musical modes, and often through an attenuator to limit the notes' range. For the VIC-20, you can either directly set a sound register to the shift register value or (better yet) use the value as an index to a note in a specific game-appropriate musical mode.

The result is a sixteen-step pattern that repeats, but gradually changes based on probability. In game usage, it doesn't need to be probability. And the seed doesn't need to be random; I usually curate registers (after auditioning dozens of results for suitability), and I might flip bits according to specific game events or other rules.

Since arcade game music is typically simple, this type of music player provides a lot of bang for the byte, with my players typically costing 80 bytes or so. Examples of variations on this idea:

* In TRBo: Turtle Rescue Bot, I used eight curated registers of two bytes each (for sixteen steps per theme). These simply repeat during the level, then the theme changes for the next level.
* In Trolley Problem, the game starts off with a curated pattern, and then the low bit is flipped each time you pick up a rider. So as the game progresses, the music slowly evolves.
* In ZEPTOPOLIS, a curated shift register is modified deterministically, to provide several minutes of different music before repetition.
* In Dungeon of Dance, the register is randomized rather than curated, and is realized as a bass/snare/hi-hat drum beat rather than notes.

These are all games for unexpanded VIC-20. Being the simplest example, you can see the code for TRBo here, from lines 1179-1234. The curated themes start at 1815. The ISR simply calls NXNOTE each interrupt: https://github.com/Chysn/VIC20-TRBo/blo ... c/trbo.asm

__________________
* https://www.musicthing.co.uk/Turing-Machine/
Last edited by chysn on Fri Sep 08, 2023 5:04 am, edited 1 time in total.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Need Vic20 Music/SFX

Post by orion70 »

Wow, procedurally generated music! I've always been fascinated by "procedural worlds", which save memory and guarantee unlimited replayability, but never knew this could also be applied to music :D
furroy
Vic 20 Drifter
Posts: 20
Joined: Sun Aug 27, 2023 5:03 am

Re: Need Vic20 Music/SFX

Post by furroy »

So I did spend a few hours extracting the music players from trbo and zeptopolis and messing around with them, but these both seem more suited to an arcade-type faster pace game, where mine is a slower pace RPG. I think I want something with more of a melody? Also it shouldn't loop so frequently. I'm not musically inclined, so I don't know how exactly to express what I'm looking for. I do love the idea of procgen music though, if you have any suggestions on that. I'm loading the music & player up into block 5 ram, so the memory footprint isn't a concern for me.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Need Vic20 Music/SFX

Post by chysn »

furroy wrote: Tue Oct 24, 2023 7:35 am So I did spend a few hours extracting the music players from trbo and zeptopolis and messing around with them, but these both seem more suited to an arcade-type faster pace game.
Yes, no doubt. You can get away with that kind of thing in arcade games, where short themes are de rigueur. For RPGs, you want longer themes, contrasting parts, more variation in note duration, a more grounded modality (major, minor, etc.). Not necessarily slower, but maybe. Probably harmonizing polyphony.

These things are achievable in procedurally-generated music, but you might wish to find a tracker and collaborate with a composer. I've written a tracker*, but it's not really fleshed out for polyphony and it, too, has the goal of being super-tiny.

Out of curiosity, are there any VIC-20 games with soundtracks that have the sort of vibe you're going for? What about non-VIC-20 games?
____________________
* https://github.com/Chysn/VIC20-SubMed/b ... submed.asm, lines 985-1080.
furroy
Vic 20 Drifter
Posts: 20
Joined: Sun Aug 27, 2023 5:03 am

Re: Need Vic20 Music/SFX

Post by furroy »

Well the previous title in the series on C64 used a simple rendition of Greensleeves done in SID. I'm not looking for anything overly complex, but something you can at least hum along to.

People who know how to use VicTracker (or are willing to learn it) are extremely few and far between! But so far, it's been the only tracker I've been able to get a tune to play via irq in my game.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Re: Need Vic20 Music/SFX

Post by Jeff-20 »

I did a simple "song" in my 5 line game, "Trails"... here.

In line 4. A is a sound channel and F is just an ever-ascending number in the game loop:

Code: Select all

4 F=F+1:POKEA,(FAND25)+215
It's a snake game in five lines of BASIC. This was enough music to suffice. :D
High Scores, Links, and Jeff's Basic Games page.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Need Vic20 Music/SFX

Post by chysn »

Jeff-20 wrote: Thu Oct 26, 2023 2:45 pm I did a simple "song" in my 5 line game, "Trails"... here.

In line 4. A is a sound channel and F is just an ever-ascending number in the game loop:

Code: Select all

4 F=F+1:POKEA,(FAND25)+215
It's a snake game in five lines of BASIC. This was enough music to suffice. :D
I love it! There could be a whole thread devoted to one-line procedural arcade game music like this. How about this one?

Code: Select all

F = F + 1 : POKE A, (F AND 23) - (F AND 110) + 215
User avatar
pixel
Vic 20 Scientist
Posts: 1358
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Need Vic20 Music/SFX

Post by pixel »

"KI"-generated music lacks soul and atmosphere – unless that's the kind of atmosphere you're looking for. :D I'm suggesting that a handful of notes done by a musician will do much better.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
furroy
Vic 20 Drifter
Posts: 20
Joined: Sun Aug 27, 2023 5:03 am

Re: Need Vic20 Music/SFX

Post by furroy »

Hand crafted music would be ideal, but finding someone willing to learn/use VicTracker is easier said than done!
Post Reply