Reproduce instrument tibre with PSG

Page 1/3
| 2 | 3

Par aoineko

Paragon (1144)

Portrait de aoineko

26-02-2023, 12:45

Hi all,
I wonder if you know any documentation of how to reproduce instruments' tibre with PSG (AY-3-8910).
I know that it's not possible to reproduce a high fidelity sound with a squared signal updated only at 50/60 Hz, but I would like to know the techniques that make a sound sound like a piano or a guitar for example.
I'm looking for information within the features of ayFX editor or trackers intrument editor like Arkos Tracker 2 (where we can change the tone, noise and volume over time).

!login ou Inscrivez-vous pour poster

Par wolf_

Ambassador_ (10135)

Portrait de wolf_

26-02-2023, 12:59

If you want a piano or guitar, why bother with a PSG? If you want a pet animal, why bother asking whether a giraffe fits your house?

Both a piano and a guitar have in common that they rely on an impulse trigger, after which the volume decays gradually. So, apply an envelope! But that's where it ends, regarding the tonal color, you won't get very far, unless you playback samples.

Par aoineko

Paragon (1144)

Portrait de aoineko

26-02-2023, 13:33

wolf_ wrote:

why bother with a PSG?

Because I want to. ^^
Retro gaming development is all about play with limitation.

I've heard PSG sounds that sound a bit like instruments before.
I know that we can't do miracles with these limations, but that shouldn't stop from trying to get as close as possible.

I'll try to sample piano notes.

Par Timmy

Master (200)

Portrait de Timmy

26-02-2023, 14:16

aoineko wrote:

I know that it's not possible to reproduce a high fidelity sound with a squared signal updated only at 50/60 Hz

It's really simple. You can make good sound with 4MHz instead of 50/60Hz.
The PSG doesn't work only at 50/60 Hz.

Par Pencioner

Scribe (1612)

Portrait de Pencioner

26-02-2023, 20:46

I believe that the instrument perception in this case is envelope based. So if you can emulate typical envelope of the piano it will sound more pianish, if you emulate envelope of a clavicord it will sound more clavicrodish etc. If you take noise and make a cymbal envelope it will sound cymbalish. Envelope plays quite a role. Standard PSG envelopes are limited but i believe that trackers use some manipulations which could do much more with it, like proper attack-decay-release form

Par santiontanon

Paragon (1833)

Portrait de santiontanon

26-02-2023, 23:29

Haha, I am with @aoineko here, what's the fun of doing X if the hardware does it for you hehehe, the fun is in the challenge Wink

What Timmy says is very interesting: we usually update the PSG in the interrupt routine, and hence only at 50Hz, but there is no reason for which one could not set it up in a different way, so that you update it more frequently. An extreme case would be a dedicated loop (where your application/game stops completely), and the CPU is devoted completely to update the PSG, in that case you can update it at full speed, and achieve very finegrained control of he sound. But probably is some controlled scenarios (e.g., in the title screen of a game, where the CPU is mostly idle), it might be possible to set it so that one can update the PSG at 100/120 or 200/240 Hz probably.

Par aoineko

Paragon (1144)

Portrait de aoineko

26-02-2023, 23:39

Yes, for piano, playing with amplitude over time to create an envelope and add tone variation to create note end's distortion, allow to have something that sound about like piano.

For the guitar, I have some ideas by playing with the tone variation, but I wonder if I'm not reinventing the wheel.

Nobody has already tried to cut instruments notes into elements emulatable with the AY-3-8910 features?
If we could deduce for each instrument a variation in amplitude, tone and pitch over time, then it would be easy to create those instruments for the PSG.

In particular, how do programs that play MIDI music using PSG do it?
They do need an instruments bank. Are there none available or at least documented?

Par aoineko

Paragon (1144)

Portrait de aoineko

27-02-2023, 00:09

santiontanon wrote:

An extreme case would be a dedicated loop (where your application/game stops completely), and the CPU is devoted completely to update the PSG, in that case you can update it at full speed, and achieve very finegrained control of he sound.

This is what ARTRAG's pcmenc replayer do (I added it to MSXgl some time ago).
It allow to play PCM data up to 44 KHz but use 100% of the CPU.

It's a wonderful tool, but it is out the scope of my question.
I'm looking for a ISR based instruments emulation like those used in trackers.

Par thegeps

Paragon (1260)

Portrait de thegeps

27-02-2023, 04:36

Well, the fact is: musicians create instruments when working to a song in their favorite trackers. Maybe they could create a common library where upload instruments. The more common ones, at least (they could be particolary proud about some and not share them)

Par Metalion

Paragon (1629)

Portrait de Metalion

27-02-2023, 08:45

The problem is that an instrument library would rely on a common denominator: a 50Hz/60Hz PSG update. All other solutions are very hardware and software specific.

Par gdx

Enlighted (6447)

Portrait de gdx

27-02-2023, 10:31

santiontanon wrote:

What Timmy says is very interesting: we usually update the PSG in the interrupt routine, and hence only at 50Hz, but there is no reason for which one could not set it up in a different way, so that you update it more frequently. An extreme case would be a dedicated loop (where your application/game stops completely), and the CPU is devoted completely to update the PSG, in that case you can update it at full speed, and achieve very finegrained control of he sound. But probably is some controlled scenarios (e.g., in the title screen of a game, where the CPU is mostly idle), it might be possible to set it so that one can update the PSG at 100/120 or 200/240 Hz probably.

I think it's possible to do something by exploiting sprite collision. (A bit like the MSX logo of the MSX2+.)

Page 1/3
| 2 | 3