Jump to content


Photo

Gmpokey 1.1


  • Please log in to reply
74 replies to this topic

#1 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 06 June 2006 - 07:11 PM

Hi everyone! It's been a year, time for a new release. :GM6:

Straight from the documentation:

The C012294 chip - also known as POKEY - was developed by Atari in the late seventies for their first line of Atari 8-bit home computers. It has also been used for a number of arcade hall machines through the early eighties. The chip took care of keyboard interfacing, serial port input and output, hardware IRQs, the paddle controls and random number generation. It is however better known for it's sound playback. POKEY's name is derived from POtentiometers and KEYboard.

GMPokey is a port for a library that emulates POKEY's sound output. This package is meant to bring 'retro' sound to your games, reminiscent of 8-bit home computers and game consoles. Of course similar effects can be obtained through the use of samples, but GMPokey has the added advantage that you have full control over the audio registers, allowing you to make in-game adjustments to the sound output. You can also save GMPokey output!

GMPokey does not play samples in the traditional sense - it produces (variations on) square wave output. The sound output can be rather crude, and creating interesting effects or even music may take time and experimentation.

Works in ;) and :P, but the demo is ;) only.

This extension does not work on Windows 98 and ME.

UPDATE: New version available that allows saving wave file output.

Download GMPokey 1.1 (214 Kb)

And let ye olde days revive... :GM6:

Edited by Smarty, 02 March 2007 - 01:11 AM.

  • 0

#2 sn0wb0arder381

sn0wb0arder381

    GMC Member

  • New Member
  • 1153 posts

Posted 06 June 2006 - 07:15 PM

I had alot of fun playing around with the piano. The sound effects sounded just like the ones from the old consoles. Great job
-snow
  • 0

#3 -0NL1N3-

-0NL1N3-

    Network Programmer

  • New Member
  • 650 posts

Posted 06 June 2006 - 08:12 PM

I liked the "Zoom!" sound and the piano ;) Another great piece of work!

Thanks,
-0NL1N3-
  • 0

#4 smaksak

smaksak

    It's a matter of taste

  • New Member
  • 208 posts

Posted 06 June 2006 - 10:30 PM

very cool!
I liked the explosion sound, the piano and the zooming sound most
I had a fun time playing around with your demo ;)

EDIT: I did now realize how similair my post was to sn0wb0arder381's post and NL1N3-'s post. Sorry, didn't read them before i posted :P

-Isak

Edited by smaksak, 06 June 2006 - 10:33 PM.

  • 0
Who in their right mind would ever need more than 640K of RAM!?
Bill Gates, 1981

#5 Mousier Goatee

Mousier Goatee

    Mobile Cheese Factory

  • New Member
  • 48 posts

Posted 07 June 2006 - 02:13 AM

This is pretty good!
I enjoyed going through your example- some great sounds in there!

Nice job- very useful!

-Mousier Goatee ;)
  • 0

#6 I-code

I-code

    GMC Member

  • New Member
  • 33 posts

Posted 07 June 2006 - 03:14 AM

very cool !
  • 0

#7 emwearz

emwearz

    GMC Member

  • New Member
  • 566 posts

Posted 07 June 2006 - 03:19 AM

I thought that was really really awsome, great for those making retro games, great work Smarty.
  • 0

#8 agj32mrgibbits

agj32mrgibbits

    GMC Member

  • New Member
  • 139 posts

Posted 07 June 2006 - 07:36 AM

This is cool. I kept making it sound like I was playing Excitebike2d.
  • 0

#9 havoc

havoc

    GMC Member

  • New Member
  • 127 posts

Posted 07 June 2006 - 07:54 AM

That's some neat stuff. Is there a way it can be 3D directional sound ?
  • 0

#10 Fox-NL

Fox-NL

    I wanna fly high

  • New Member
  • 620 posts

Posted 07 June 2006 - 08:57 AM

In the readme.rtf file you can see this example:

gmpokey_init(44010,2,2048,8);

The parameters are: gmpokey_init(mixrate, pokeys, [updatemode, [buffersize, [buffercount]]])

first parameter: mixrate 44010 (right i think)
second parameter: pokeys 2 (right i think, stereo output)
third paramater: updatemode 2048 (wtf?!?!)
fourth paramater: buffersize 8 (lol)
fifth parameter: not there...

Is it me or is this wrong?

Edited by Fox-NL, 07 June 2006 - 08:57 AM.

  • 0

#11 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 07 June 2006 - 09:03 AM

Thanks for the positive comments, everyone! Judging from your reactions I might as well have made the piano a Creation of it's own... It was only intended to showcase!

Is there a way it can be 3D directional sound ?


Theoretically, yes. But the sound chip has a rather coarse volume range - there are only sixteen levels (0-15). You can already hear this quite distinctly when using panning. As directional sound is based on panning and value, the volume range is just not large enough to be able to place the sound in a 3D environment.

Together with panning and volume, you could try and make a directional sound yourself of course. But based on your method either the sound fades away quickly, or you will not be able to hear a difference between certain distances.

And anyway, using directional sound with an 80s square wave chip... I think we would be pushing it. ;)

Edit: didn't see your response, Fox-NL.

In the readme.rtf file you can see this example:

gmpokey_init(44010,2,2048,8);

The parameters are: gmpokey_init(mixrate, pokeys, [updatemode, [buffersize, [buffercount]]])

You're absolutely right, the example has a typo there. Behind the 2 there should be an indication for the auto-update. I'll fix that later on.

Glad to see someone is reading the manual. :P

Edited by Smarty, 07 June 2006 - 09:06 AM.

  • 0

#12 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 08 June 2006 - 12:28 AM

This is awesome!!! Sweet sounds, the synthesizer was awesome :)
  • 0

#13 Jack Meroc

Jack Meroc

    GMC Member

  • New Member
  • 264 posts

Posted 08 June 2006 - 02:40 AM

LOL, really nice.
  • 0

#14 FredFredrickson

FredFredrickson

    Artist

  • Global Moderators
  • 9225 posts
  • Version:GM:Studio

Posted 08 June 2006 - 03:57 AM

I enjoyed playing around with it... I'm not even into retro game creation much, but this made me feel like making something I could use it with. Brought back some nostalgia of my 8-bit gaming days. Excellent work!
  • 0

#15 Simpson_Software

Simpson_Software

    GMC Member

  • New Member
  • 215 posts

Posted 08 June 2006 - 07:20 AM

Awesome! I thought you might've been fooling us with real sounds so it just plays a sound but it wasn't, lol. Very nice work! I was also wondering if you know a of old school tune website? Cause I saw a friend at school with some cracks and they had the best tunes! What tunes/software would they use to make that sort of sound?

Cheers,
Simpson_Software
  • 0

#16 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:Unknown

Posted 08 June 2006 - 01:39 PM

is it ok to use this as part of ones program?
crdeit required?
liike the piano
  • 0

#17 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 08 June 2006 - 08:11 PM

Thanks again everyone for the positive comments.

I enjoyed playing around with it...  I'm not even into retro game creation much, but this made me feel like making something I could use it with.  Brought back some nostalgia of my 8-bit gaming days.  Excellent work!

<{POST_SNAPBACK}>

I did hope it would bring some inspiration. But you're a 3D man and this definitely cries for 2D pixelated thingies. ;)

Awesome! I thought you might've been fooling us with real sounds so it just plays a sound but it wasn't, lol.

Nah. The GM6 source would have been MUCH bigger if it was.

I was also wondering if you know a of old school tune website? Cause I saw a friend at school with some cracks and they had the best tunes!

This is a great one for the C-64: http://remix.kwed.org. The SID files are the actual C-64 originals, which can be played through Winamp using the SidAmp plugin - but these days I think you'd prefer the remixed MP3 versions.

What tunes/software would they use to make that sort of sound?

Not sure what they use, but I would personally recommend using a program such as Modplug Tracker. Load a few square, saw and sine wave samples into it and you're ready to go.

For the POKEY chip emulated here there is actually a Windows Tracker, but it looks rather DOS-like and cannot export into any regular sound formats. Still, it's nice to hear what the chip can do. See here.

is it ok to use this as part of ones program?
crdeit required?

<{POST_SNAPBACK}>

Information on this is in the documentation. But I wouldn't post it here if you couldn't use it, would I?

A last question to anyone who used it - the Sound Effects demo has an effect called Transposition. There is a song in there for which I remembered the notes, but I have no clue where the actual melody comes from. Does anyone have an idea?

Edit: Typo in manual fixed in download.

Edited by Smarty, 08 June 2006 - 10:48 PM.

  • 0

#18 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 10 June 2006 - 12:30 PM

Can i just ask, how does this 8bit sound actually work? (in your example)

Is the length of the entire sound a max of 8 bits (looping)
Or is 8bit the range of the frequency?

Because when you think about it, 8bit wavs are pretty high quality (almost mp3 quality), but the 8bit in 8bit wav is refering to the number of frequencies.

So im assuming that perhaps the 8 bit frefers to the harmonics?

Heres a diagram of range:
Posted Image

Is that what you mean?

Edited by /\lex, 10 June 2006 - 12:31 PM.

  • 0

#19 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 10 June 2006 - 12:51 PM

So im assuming that perhaps the 8 bit frefers to the harmonics?

<{POST_SNAPBACK}>

8-bit stands for the 256 different amplitudes (or output-voltage levels) you can generate (just like you've shown in your diagram).

Hope that clarifies it.
  • 0

#20 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 10 June 2006 - 01:09 PM

yeah but how does the sound that this engine output differ to a traditional 8bit wav? Because the difference in detail is fairly large. Im guessing perhaps the frequency of the sound is very low?

Edited by /\lex, 10 June 2006 - 01:10 PM.

  • 0

#21 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 10 June 2006 - 02:18 PM

yeah but how does the sound that this engine output differ to a traditional 8bit wav?

<{POST_SNAPBACK}>

This "Pokey" seems to use a form of PWM : Pulse-Width Modulation.

It means that the output just switches On or Off (full power/full amplitude, no power/no amplitude), and the length of that signal being on or off is determined by that 8-bit data.

Switching the power repeatedly on-and-of for the same duration means that that the over-all output-voltage is 50%, Switching 10% On and 90% off will simulate an over-all output-voltage of 10%, and so on.

The data-byte can be used as seperate bits indicating an On or Off state using a fixed frequency (a 1-bit data-stream), or it can be used as a delay-time, switching from on-to-off or vice-verse after every delay.

Hope that clarifies it (a bit).
  • 0

#22 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 10 June 2006 - 03:53 PM

It's even a little bit different from that.

Indeed POKEY produces sound by producing output-no output pulses (thus a square wave). It actually does so at a default frequency, but the value that we (wrongly) refer to as frequency in GMPokey is called a divide-by-N circuit: for every N pulses going in, one goes out (note that the range is actually 1-256 as opposed to 0-255, but POKEY automatically adds 1).

The following shows the output through N=1 and N=4:

Posted Image

This is why the sound lowers with higher values, and also the reason why it isn't linear.

Because when you think about it, 8bit wavs are pretty high quality (almost mp3 quality), but the 8bit in 8bit wav is refering to the number of frequencies.

No, it's referring to the level of sound output. 8-bit means pulses in 256 levels: 16-bit means pulses in 65536 levels, allowing for much more detail. The quality of sound output is of course also dependent on the frequency at which it is played (think in terms of 'pulses per second').

POKEY has only 16 volume levels, so the sound is really only 4-bit. Some games back in the 80s even tried playback of samples on these 4 bits, but you can imagine that the quality is no match to today's standards. Not to mention the fact that the computer was uncapable of doing practically anything else because these samples needed to be sent to the sound chip, let alone the high memory cost on what were usually 64Kb machines.

I have lazily referred to this as '8-bit sound' because the square wave, being a very easy wave form to modulate through a chip, is quite omnipresent on 8-bit and even 16-bit computers and consoles from the 70s and 80s.
  • 0

#23 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 11 June 2006 - 08:50 AM

Because when you think about it, 8bit wavs are pretty high quality (almost mp3 quality), but the 8bit in 8bit wav is refering to the number of frequencies.

No, it's referring to the level of sound output. 8-bit means pulses in 256 levels: 16-bit means pulses in 65536 levels,


yeah sorry thats what i meant i just couldnt figure out the right terminology.

So in other words your saying that the sound we get is 4bit, square and basically loops pulses of square waves?

The only thing i don't understand is the input and output system.

Im just wondering, what kind of flexibility does the engine provide for the manipulation of the square waves?

e.g We know we can place a square wave (or more than a square wave) but can we adjust where these square waves are and how large they are (in length not height)?

Sorry if that dosnt make any sence but i can't figure out how to explain this.

So would it be possible to create a looping pulse like the folowing example?
Posted Image



EDIT: Oh wait a minute i think i understand what your saying. So basically theres a input (always the same number of pulses) and you just use that and adjust how many of those pulses actually play (by dividing) and that gives you the different frequencies?

But if so, how do you adjust the volume, can you adjust the height of the square waves? Because after all you did say it had 16 different settings which it could take.

This is really interesting ;)

How do you use this to make sound effects like explosions though ;) without them sounding like single tone musical instruments?

Edited by /\lex, 11 June 2006 - 09:06 AM.

  • 0

#24 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 11 June 2006 - 09:54 AM

The methods there are for playback of square waves are really only meant for illustration. There really is no capability in this extension to form your own waves based on the square wave input.

It's really quite simple to use. See the command gmpokey_sound(channel, freq, dist, vol):

Channel defines which channel is used for playback. Freq defines the frequency which is based on division-by-N: the lower the number, the higher the frequency. Dist is the distortion (or noise) level, and there are only a few preset values (even values between 0 and 14): level 10 and 14 are square wave, other levels apply distortion at different rates. Vol is the volume, ranging from 0-15. Yes, the 'height' of the wave, if you wish.

The command gmpokey_control(flags) allows to affect a few of the defaults - for example, the main clock frequency can be lowered, so all sound output is much lower.

If you want to see how sound effects are created from this, look at the source in the demo. I've done an example of a explosion which basically makes a noise sound for which the volume goes down while the frequency is feeded some random values in each step. There is also a random panning applied (only at the start of the sound).

Distortion levels 0 and 8 are good noise levels for simple explosion sounds. For example, put this in the create event:

vol=15;

And this in the step event:

gmpokey_sound(0,40,8,vol);
if vol>0 vol-=0.5;

There you go. Poof. Always keep the room speed in consideration - sound is changed every step, so at higher room speed this sound would become shorter.

Edited by Smarty, 11 June 2006 - 10:05 AM.

  • 0

#25 Gabry Hyrule

Gabry Hyrule

    Gabry Hyrule Pro-Duction

  • New Member
  • 393 posts

Posted 13 June 2006 - 01:32 AM

This is a really good DLL! I add fun playing with it and trying to reproduce a little music. But I'm confused, when calling "gmpokey_sound()" at a moment, will the sound continuously play or will it stop after a "wave"? Because I place the function in the step event, and when my room speed is really low, the sound keeps playing.

Oh, and why the different levels of distortion aren't changing proportionaly the sound? I mean, it seems that the levels aren't linked, 2 and 4 are the same, but 3 or 5 sound really different.

Gabry Hyrule
  • 0
Wow... it's been a long time. I'll try and learn gml again this winter (college break).

#26 Ptolemy

Ptolemy

    ACDC Fan

  • GMC Member
  • 216 posts

Posted 13 June 2006 - 02:10 AM

Very nice! i think im probably going to do this if i ever get started on the retro game i plan on making. either way its pretty fun to play around with.
Always been very satisfied with your creations Smarty.
Good work.
~Ptolemy
  • 0
GM User since '02

#27 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 13 June 2006 - 10:57 AM

But I'm confused, when calling "gmpokey_sound()" at a moment, will the sound continuously play or will it stop after a "wave"? Because I place the function in the step event, and when my room speed is really low, the sound keeps playing.

The original chip produced uninterrupted sound output. By default (auto-update mode) the DLL does the same thing - if you change the parameters, the sound remains that way until you change them again. This is regardless of the speed of the game - I have made playback a background process.

You can do manual updates of the sound (see the readme file) but that means you will have to call gmpokey_update() continously (preferably once per step). However, to make this work correctly you may need to tweak some parameters.

Oh, and why the different levels of distortion aren't changing proportionaly the sound? I mean, it seems that the levels aren't linked, 2 and 4 are the same, but 3 or 5 sound really different.

What do you mean with 'changing proportionally'? Levels 2 and 4 are different. You may not hear that difference in the lower frequencies. Distortion levels 3 and 5 do not exist (only even numbers are used).

Don't think of the distortion level as a particular 'noise factor' - it's just a setting in which each number from 0-14 (even) represents a different sound output. This is just POKEY's way of indexing things.

Very nice! i think im probably going to do this if i ever get started on the retro game i plan on making. either way its pretty fun to play around with.
Always been very satisfied with your creations Smarty.
Good work.

<{POST_SNAPBACK}>

Thank you, I appreciate your comments. Good luck on the retro game. :)
  • 0

#28 Gabry Hyrule

Gabry Hyrule

    Gabry Hyrule Pro-Duction

  • New Member
  • 393 posts

Posted 13 June 2006 - 08:39 PM

Oh, and why the different levels of distortion aren't changing proportionaly the sound? I mean, it seems that the levels aren't linked, 2 and 4 are the same, but 3 or 5 sound really different.

What do you mean with 'changing proportionally'? Levels 2 and 4 are different. You may not hear that difference in the lower frequencies. Distortion levels 3 and 5 do not exist (only even numbers are used).

Don't think of the distortion level as a particular 'noise factor' - it's just a setting in which each number from 0-14 (even) represents a different sound output. This is just POKEY's way of indexing things.

<{POST_SNAPBACK}>

Sorry, I just forgot the numbers :) I speak of the 2 and 6 distortion that are the same and that 0 and 4 don't have any link with them.

What I mean is that the sounds are really differents in every levels, there is no "progression" between the distortion levels. 0 is like a whitenoise while 2 is a "clear" note, 4 is a razor-like sound, 8 is another whotenoise and 10 is a pure tone. Why are they changing so strangely?

Gabry Hyrule
  • 0
Wow... it's been a long time. I'll try and learn gml again this winter (college break).

#29 twisted_games

twisted_games

    GMC Member

  • GMC Member
  • 730 posts
  • Version:GM:Studio

Posted 13 June 2006 - 10:59 PM

this was very nice. i think im going to make(or try to make) a program to record these sounds so you can save them as ".wav"s

thanks for the time you put into this

~twisted
  • 0

Email: justinhalek@gmail.com
For some free help with GMstudio.

If you need lots of help, I'm always for hire as a consultant.


#30 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 14 June 2006 - 09:59 PM

Sorry, I just forgot the numbers :angry: I speak of the 2 and 6 distortion that are the same and that 0 and 4 don't have any link with them.

What I mean is that the sounds are really differents in every levels, there is no "progression" between the distortion levels. 0 is like a whitenoise while 2 is a "clear" note, 4 is a razor-like sound, 8 is another whotenoise and 10 is a pure tone. Why are they changing so strangely?

Ah, you may be confused by me calling it distortion level. This doesn't mean that the higher the number is, the more (or less) distortion is applied. Each even number in the 0-14 range just represents a particular noise setting. It is inherited from a nibble, half a byte, in which bit 0 isn't used - that's why it's numbers are even only. There isn't much logic to why level 10 and 14 are clear while level 0 and 8 produce white noise - they just DO. Take it for granted unless you want to dive in the chip's original architecture.

i think im going to make(or try to make) a program to record these sounds so you can save them as ".wav"s

I was wondering when the first would suggest something like wave file output. It's an option I have considered, but left out for the moment. I'll probably add that in an update, if there is enough interest in it. Would be easier for me than for you to do it anyway.
  • 0

#31 Ptolemy

Ptolemy

    ACDC Fan

  • GMC Member
  • 216 posts

Posted 15 June 2006 - 02:47 AM

Take it for granted unless you want to dive in the chip's original architecture.

Actually I would be interested in learning about the architecture. If you know of any resources point me at them.

Again, congratz on the awesome dll and keep up the good work.
~Ptolemy
  • 0
GM User since '02

#32 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 15 June 2006 - 01:16 PM

Actually I would be interested in learning about the architecture. If you know of any resources point me at them.

The complete technical description can be found in this PDF. Mind you, this chip is capable of more than sound production so you'll also find architecture in there with regard to IRQs, keyboard input, serial hardware I/O and some other things. Only a small part of it is reasonably understandable (I used one of the prints as a background for the synthesizer).

Again, congratz on the awesome dll and keep up the good work.

<{POST_SNAPBACK}>

Thanks, it's nice to know it's appreciated. -_-
  • 0

#33 ardnat

ardnat

    GMC Member

  • New Member
  • 421 posts

Posted 17 June 2006 - 02:50 PM

VERY GOOD! I LOVE IT!!! I was looking for something like this
  • 0

#34 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:Unknown

Posted 20 June 2006 - 12:10 AM

is it possible to use or create new tomes to use with the piano or a way to let the user create the tone to use.


second w; is it possible to instead of playing a "tone" play a wav sample at different pitches?
  • 0

#35 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 21 June 2006 - 01:35 PM

is it possible to use or create new tomes to use with the piano or a way to let the user create the tone to use.

Not quite, there are only a few types of noise that could actually be used for notes.

second w; is it possible to instead of playing a "tone" play a wav sample at different pitches?

<{POST_SNAPBACK}>

Sure, check out the examples. There are 256 different frequencies. Only about 40 of them are tones. That's why I put them in array.
  • 0

#36 neo8xp

neo8xp

    GMC Member

  • New Member
  • 590 posts

Posted 23 June 2006 - 09:47 AM

that was realllyyy goood -_-
never thought u could make sounds without sounds =O
later on I tried to edit the piano thing to make it able to press more keys at once but I failed -_-
I coudn't finish my song cause of that >=(
but really really good
  • 0

#37 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:Unknown

Posted 23 June 2006 - 01:56 PM

is it possible to use or create new tomes to use with the piano or a way to let the user create the tone to use.

Not quite, there are only a few types of noise that could actually be used for notes.

second w; is it possible to instead of playing a "tone" play a wav sample at different pitches?

<{POST_SNAPBACK}>

Sure, check out the examples. There are 256 different frequencies. Only about 40 of them are tones. That's why I put them in array.

<{POST_SNAPBACK}>

i want to play actual samples like on that has a guy saying "eh yo" at different frequenies using gmpokey is this possible or can only system sounds be used.

also exactly how would i use tones additoonal to thje two you have given (pure tones & bass) i want like a guitary sound and maybe a percussive sound.

thnaks.
  • 0

#38 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 23 June 2006 - 11:11 PM

later on I tried to edit the piano thing to make it able to press more keys at once but I failed :P

<{POST_SNAPBACK}>

I'm not surprised. Most keyboards don't allow for more than a few simultaneous keypresses. Besides that, the DLL doesn't allow for more polyphony than 4 channels. :D


i want to play actual samples like on that has a guy saying "eh yo" at different frequenies using gmpokey is this possible or can only system sounds be used.

There are only a few noise wave forms, yes. But experimenting with the control registers can give a few extra effects. Don't expect to be able to get the sounds you look for, though.

also exactly how would i use tones additoonal to thje two you have given (pure tones & bass) i want like a guitary sound and maybe a percussive sound.

<{POST_SNAPBACK}>

Guitar? On a chip like that? Nothing like it. Percussion-like sounds may be created by being creative (high-pitched white noise can e.g. be used for hihats), but you won't get close to the 'real thing'.

If you want to know what one of the maestros, Rob Hubbard, was able to do with the chip, listen to this. That's what chip music was about in those days.

Theoretically, the same is possible with this little DLL. :P
  • 0

#39 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 30 June 2006 - 10:58 PM

Good work. This will save some mbs off retro game executables. :D
  • 0
GM 8.1 / GM:HTML5 User

#40 DtD

DtD

    Owner of DtD Software

  • New Member
  • 207 posts

Posted 01 July 2006 - 12:59 AM

Cool, althought I got a little flangering with it.

~DtD
  • 0

#41 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 02 July 2006 - 07:57 AM

Cool, althought I got a little flangering with it.

<{POST_SNAPBACK}>

I would expect this to happen if you set a buffersize and buffercount in gmpokeygmpokey_init() that are both too low. Try increasing them.
  • 0

#42 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:Unknown

Posted 10 July 2006 - 01:35 PM

thanks for gm pokey

http://forums.gamema...howtopic=224339

now you can play along to your favorite beat!!!
  • 0

#43 jaspereenhoorn

jaspereenhoorn

    GMC Member

  • New Member
  • 5 posts

Posted 11 July 2006 - 03:43 PM

i would love a record function for the piano, i love the piano sound
very good job

Edited by jaspereenhoorn, 11 July 2006 - 03:43 PM.

  • 0

#44 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:Unknown

Posted 11 July 2006 - 04:36 PM

well if you use my muzik maker it should record the pinao
  • 0

#45 Nilz

Nilz

    GMC Member

  • New Member
  • 236 posts

Posted 26 July 2006 - 04:27 PM

Hey I love GMPokey!
Gonna use it in my retrogames :)
Good job m8
  • 0

#46 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 28 July 2006 - 02:56 PM

Thanks for the positive comments everyone.

http://forums.gamema...howtopic=224339

now you can play along to your favorite beat!!!

<{POST_SNAPBACK}>

There you go, the first implementation of GMPokey. Well done. I see you have, errr, borrowed my piano demo as well. :D

i would love a record function for the piano, i love the piano sound
very good job

<{POST_SNAPBACK}>

Square waves sound like that. I'll consider writing a PCM export.

Gonna use it in my retrogames :(

<{POST_SNAPBACK}>

Let me know when you finish one, I'm interested what is done with it.
  • 0

#47 jobro

jobro

    GMC Member

  • GMC Member
  • 1300 posts
  • Version:GM:Studio

Posted 28 July 2006 - 04:08 PM

Sorry, I just forgot the numbers :( I speak of the 2 and 6 distortion that are the same and that 0 and 4 don't have any link with them.

What I mean is that the sounds are really differents in every levels, there is no "progression" between the distortion levels. 0 is like a whitenoise while 2 is a "clear" note, 4 is a razor-like sound, 8 is another whotenoise and 10 is a pure tone. Why are they changing so strangely?

Ah, you may be confused by me calling it distortion level. This doesn't mean that the higher the number is, the more (or less) distortion is applied. Each even number in the 0-14 range just represents a particular noise setting. It is inherited from a nibble, half a byte, in which bit 0 isn't used - that's why it's numbers are even only. There isn't much logic to why level 10 and 14 are clear while level 0 and 8 produce white noise - they just DO. Take it for granted unless you want to dive in the chip's original architecture.

i think im going to make(or try to make) a program to record these sounds so you can save them as ".wav"s

I was wondering when the first would suggest something like wave file output. It's an option I have considered, but left out for the moment. I'll probably add that in an update, if there is enough interest in it. Would be easier for me than for you to do it anyway.

<{POST_SNAPBACK}>

Really that is only waste of memory imho. You have the sound generated live and direct, so why would you render it to wav files anyway?

Oh and btw I'm gonna give you 4 words: This plugin kicks ass!

So how would I go about to make a simple arpeggiator? You know the classic C64 style that plays a note, waits a while and then plays next note? I've been able to create 4 voice polyphonic sounds using just 1 channel:

var i;
if active
  if vol
   {
     for (i=0; i<32; i+=1)
       gmpokey_sound2(i,8+i*8,10,vol,pan);
     vol-=1.4;
   }

All I need to do is to put in the delay, and how is that done?
  • 0

Marketplace.png


#48 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 28 July 2006 - 11:50 PM

Really that is only waste of memory imho. You have the sound generated live and direct, so why would you render it to wav files anyway?

It may not be the favoured choice because you need to spread DLLs with the game, and because playing waves is faster than producing the sounds on the fly. It's less flexible, of course.

Oh and btw I'm gonna give you 4 words: This plugin kicks ass!

Thanks, I really appreciate it. :(

So how would I go about to make a simple arpeggiator? You know the classic C64 style that plays a note, waits a while and then plays next note? I've been able to create 4 voice polyphonic sounds using just 1 channel:

var i;
if active
  if vol
   {
     for (i=0; i<32; i+=1)
       gmpokey_sound2(i,8+i*8,10,vol,pan);
     vol-=1.4;
   }

All I need to do is to put in the delay, and how is that done?

<{POST_SNAPBACK}>

The code above doesn't use just one channel - the variable i loops 0-31 but can only go through channels 0-3 (there are 4 stereo channels with gmpokey_sound2()), so it just gives you 4 sounds at each a different pitch.

Arpeggio really uses one channel but changes the note on that channel rapidly. It's usually done with 2, 3 or 4 notes that make up a chord. In the old days such sound was created by changing the sound every redraw or 2nd redraw of the screen, which were intervals of 1/50 or 1/25 of a channel.

You can do the same in Game Maker except that you now change the sound every step or every 2 steps, dependent on the room speed. However, timing is rather bad in Game Maker - a step doesn't always take exactly the same time, so the arpeggio may sound irregular.

You only get a reasonably good timing when you use a high room speed that matches the monitor's refresh rate (60,75,85) and switch on the option Use synchronisation to avoid tearing.

It helps to use the notes array that was included, because it gives you the frequencies of all the correct note pitches.

Edit: Typo.

Edited by Smarty, 31 July 2006 - 11:41 AM.

  • 0

#49 MP2:E

MP2:E

    GMC Member

  • New Member
  • 152 posts

Posted 29 July 2006 - 08:57 PM

I wish I could use this :wacko: I have Windows 98SE though.........
  • 0

#50 Smarty

Smarty

    GMC Member

  • GMC Elder
  • 7522 posts
  • Version:GM:Studio

Posted 31 July 2006 - 12:03 PM

I wish I could use this :P I have Windows 98SE though.........

<{POST_SNAPBACK}>

These days it's becoming more and more difficult to support an OS that is 8 years old already.

Technical explanation: I'm using the Windows WaveOut device to play the sound. In Windows 95/98(SE)/ME this device can only be used by one application at the time, while newer Windows versions can mix it between applications. Game Maker is already using this device on old OSes so that's why you don't hear anything.

Or at least, that is the theory, because I've never actually tried it out. :D
  • 0