Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Vitor Almeida

12
Posts
2
Topics
1
Following
A member registered Oct 25, 2017

Recent community posts

Mattias, thank you so much: you gave me all the tools I need to study more and understand the sound generation process.

The code you provided worked. I'm also using this video series (https://www.youtube.com/watch?v=tgamhuQnOkM) by javidx9 to practically understand the formula used in oscillator generation (to create a square wave, for example), but you've already tied up all the loose ends I needed to use a buffer and generate sound with control (amplitude, frequency, type, etc.).

Thank you for your help and precious time, my friend (I am really a beginner in sound synthesis, learning as I go).

Regarding the project, you've already helped me a lot (all the questions I had have been answered; now it's just a matter of understanding and programming).

Thank you and if you need help in your projects (promotion, testing etc.) I am available.

(1 edit)

Hi everyone, how are you?

I am trying to do sound manipulation by generating a beep (square wave) simulating a PC speaker with a certain frequency and amplitude.

Initially, I'll make the beep for a Pong game when the ball hits a surface.

I read the library's source code and looked for some YouTube videos to understand the audio concepts involved.

But the most I'm managing to do is generate noise for a short time.

Currently I have a variable where I create the sound dynamically (before playing):


    struct sound_t* sound_border;


I initialize the sound system with the code:


    setsoundmode(soundmode_8bit_mono_11025);


I create the sound with the code:


    int channels = 1;
    int samplerate = 11025l;
    short samples[] = { 0 };
    sound_border = createsound(channels, samplerate, 8, samples); // 8 = framecount


And then when it's necessary to play:


    playsound(1, sound_score, 0, 255); // full volume, no loop, channel 1

However, I still don't understand the concept of "framecount" (is it the number of times the samples will be copied into the sound buffer for each channel?).

I don't understand how nois is being played if my sample rate is zero (and the noise changes when I change the framecount).

Any tips would be very helpful.

Thank you everyone.

Thank you very much, Mattias.

Thanks to your explanation about colors, I was able to understand and implement some more effects (scanlines and green phosphor effect) in my pong game.

Now with a dithered decay color effect :)


I think I understood: the library only works in terms of a palette index: it means that when I use putpixel, getpixel (or setcolor) they will work with an index that will use the color  (rgb) specified in the setpal function.

One question: for example, the code "getpixel(x, y)" returns a color or an index from the palette? If it's a color, this color can be different from the defined/default palette?

Thank you Blodyavenger

I'm trying to simulate a color decay system (visually similar to how old phosphor monitors displayed graphics (not shown in the image)).

I'll post something when it's ready :)

Hey everyone!

I'm having trouble understanding how the color and palette system works in the library.

Currently, I'm drawing a simple Pong game (using white for the elements and other simple drawing functions like line and rectangle).

However, I've created a simple palette with some shades of green that I want to use to simulate a color decay effect using the framebuffer.

My problem is that I can't change (and especially compare) the colors in the drawn framebuffer to know which color I need to "decay".

I don't understand the combined concept of being able to change the framebuffer and the color palette.

Could you please help me?
Thanks.

Btw a simple pong prototype that I am developing with the library.

+1 -> A PC speaker would be a powerful addition to the library (and would be very "harmonious" with the existing features).

I myself would like to run several tests/keyboards with this potential functionality (I really like the sound of a PC speaker).

I'm developing a series of learning games using the library and I'm really enjoying it (it's easy to use; anything I draw looks very nice (even colored rectangles) thanks to the screen shader, features, etc.).

Thank you very much for developing something that makes creating games and programs with this aesthetic much easier.

Sorry to hear about your difficulties Tassilo. Family and health is always priority. Hope you can pass  through the best way possible.

Wishing you all the best.