Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: sound #11

Open
seclorum opened this issue Mar 7, 2012 · 5 comments
Open

Feature request: sound #11

seclorum opened this issue Mar 7, 2012 · 5 comments

Comments

@seclorum
Copy link

seclorum commented Mar 7, 2012

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.

@antirez
Copy link
Owner

antirez commented Mar 8, 2012

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

@seclorum
Copy link
Author

seclorum commented Mar 8, 2012

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!

@seclorum
Copy link
Author

seclorum commented Jan 7, 2019

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 ?

@afbjorklund
Copy link

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 #i
  • sound(file): play sound

0: pickup/coin
1: laser/shoot
2: explosion
3: powerup
4: hit/hurt
5: jump
6: blip/select
7: thrust (new)

https://github.com/afbjorklund/load81/tree/audio

@seclorum
Copy link
Author

seclorum commented Jul 7, 2024

Nice one, makes a lot of sense to add sfxr .. Hope @antirez antirez will consider merging it to the main branch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants