Open seclorum opened 12 years ago
Hello!
Indeed sound is one of the first things I would like to address, and I'm thinking about something like the C64 SID chip, not exactly an emulator, but more or less the same API from the point of view of the programmer, exactly as you say: wavefor, envelope, filter, ... and then start/stop of the channel. It makes sense to also provide three channels like the C64, they are enough for a lot of fun.
I'll start hacking on that in the weekend.
Cheers, Salvatore
Great! I think its quite enough to have 3 voices, should be more than enough for simple stuff. Also, if its a 'real' synthesizer, we can start to add sound modules - PING, ZAP, EXPLODE!
Just a ping on this - I'd really like to add libsfxr support to load81 if that is of interest. Do you have other plans for sound @antirez ?
On the off chance that someone still cares about this, I added sfxr basic effects just to make asteroids.lua less quiet
sfx(i)
: play sound effect #isound(file)
: play sound0: pickup/coin 1: laser/shoot 2: explosion 3: powerup 4: hit/hurt 5: jump 6: blip/select 7: thrust (new)
Nice one, makes a lot of sense to add sfxr .. Hope @antirez antirez will consider merging it to the main branch...
It would be very nice to have sound in LOAD81, and following the 8-bit ideology, if it were a synthesis-oriented approach (as opposed to .WAV sample playback) this would be very neat.
What I have in mind is some sort of mini-synth such as the one found in sfxr:
http://www.drpetter.se/project_sfxr.html
A Lua table could be used to set the sound parameters for each synth voice (maybe it can be multi-timbral?):
sound[1].envelope(0,0.5,0.275,1) -- ADSR sound[1].filterType(LOPASS) &etc.
.. and then triggered with something like sound[1].play() / sound[2].play() and .stop() and .pause() and so on. This would make it very easy to set up a series of sound effects in tables and trigger them according to programmer needs.