More features in AY/YM emulation

Post your feature requests/wishlist here

Moderators: eric_telemaque, davidv, seb@plogue

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

More features in AY/YM emulation

Postby Megus » Sun Oct 18, 2009 12:12 pm

Hello! First of all I want to say big thanks to Plogue for Chipsounds. Special thanks for Mac OS X version.

I'm a big fan of AY/YM chips and it would be great if Chipsounds will have better emulation of some features:

1. Tone + Noise sound: now we can select tone or noise but can't have tone + noise sound. It can't be emulated by putting 2 AY chips on separate slots because on AY it's not a sum of tone and noise but logical AND between tone and noise 1-bit sequences.

2. AY and YM have only 32 noise frequency values and I'm not sure if the noise generator is emulated properly in Chipsounds. I can provide a code that sounds really close (though not 100% exact) to the real one.

3. I'd like to have those cool tone+amp envelope sounds in Chipsounds. Now we have those cool saw and triangle sounds which we get when we disable tone and enable amp envelope for a channel. But when we enable tone and amp envelope we can get even more interesting sounds because periods of tone and envelope generator are a bit out of sync.

I have deep knowledge of AY/YM chips so if you will agree to implement these features and need implementation details - I'm ready to help you.

Thank you!

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Re: More features in AY/YM emulation

Postby davidv » Sun Oct 18, 2009 4:16 pm

Thanks!

Now for topic by topic:

Megus wrote:1. Tone + Noise sound: now we can select tone or noise but can't have tone + noise sound. It can't be emulated by putting 2 AY chips on separate slots because on AY it's not a sum of tone and noise but logical AND between tone and noise 1-bit sequences.


You are absolutely right, and its currently there because you would need a MIDI note for the tone and a MIDI note for the noise targeting the same voice to emulate those effects right. It really blew my design to bits so i've kept that for later.

But I think I could fix this by using some similar oscillators I made for POKEYs.

Megus wrote:2. AY and YM have only 32 noise frequency values and I'm not sure if the noise generator is emulated properly in Chipsounds. I can provide a code that sounds really close (though not 100% exact) to the real one.


You are right about the 32 step noise limit, however im 99.99% sure my noise pattern is right, having analyzed it and compared its the exact same
on AY-3-8910, YM2149F and YM2203 (hybrid pulse/fm chip)
(I can provide the 96Khz samples of each)

Ill fix the 32 pitch limit ASAP. I've read all the AY/YM pdfs I could find and that is a major stupid forgotten issue on my part.

Megus wrote:3. I'd like to have those cool tone+amp envelope sounds in Chipsounds. Now we have those cool saw and triangle sounds which we get when we disable tone and enable amp envelope for a channel. But when we enable tone and amp envelope we can get even more interesting sounds because periods of tone and envelope generator are a bit out of sync.


You can hear my prototype version of such noodlings here
http://plogue.com/davidv/CS/bidule_ay.mp3
(just the AY tone+ENV)

Again the problem here is not the difficulty in programming that effect, but more like how to present it to the MIDI/slot world.

If i made a full AY emu VST it would allow those, but would require
1 MIDI channel for the base note
1 MIDI channel for the NOISE note
1 MIDI channel for the env note

you get the idea... this is where the ;fun ready to play; paradigm clashes with 100% accuracy.

Megus wrote:I have deep knowledge of AY/YM chips so if you will agree to implement these features and need implementation details - I'm ready to help you.


Well i love people keeping me in check about things. I try to get it as accurate as possible without making it too hard for a musician (thats the biggest challenge of all).

I prefer i fix things by going back to my AY-on-a-breadboard-protoboard:
http://1.bp.blogspot.com/_KCkYZeOqz_I/S ... boards.jpg

Then having it double checked.... the scientific method if you will :)

Thanks again!
David Viens,
Plogue Art et Technologie Inc. Montreal.
http://www.plogue.com

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Re: More features in AY/YM emulation

Postby davidv » Sun Oct 18, 2009 9:18 pm

Ok

Did some test on a YM2149F clocked at 4Mhz (but with divider pin set to half - so 2Mhz)
Ive recorded all 31 noises (0 does not count):
http://plogue.com/davidv/cs_stuff/AY_32_noises.mp3

Fixed AY implementation
http://plogue.com/davidv/cs_stuff/AY.sfz

place into chipsounds/Programs/01. Pure Chip

It has a new KS (1) for the "accurate" Long Noise.

Indeed my previous pitch range allowed WAY too much bass noises.
(i think that's maybe why you thought the pattern was wrong, by being so LOW in pitch)

Ive kept the old KS(2) and renamed it Long Noise (deprecated)
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Mon Oct 19, 2009 1:34 am

Thanks for the noise update, I'll try it later today.

Considering tone+noise implementation: I think that noise pitch can be controlled via MIDI CC.

Tone+ENV: I checked the mp3, sounds nice. I totally agree that implementation of this feature isn't so easy because of 2 pitch values for the same voice. About a year ago I wanted to write my own chip soft synth and I had 2 ideas:

1. Auto-pitch for ENV: in AY trackers for ZX Spectrum when I enter a note in a channel and "auto-ENV" feature is on, tracker fills ENV register values automatically. And there was a ratio parameter for ENV pitch calculation which can be set to values like: 1/1, 1/2, 2/1, 3/4 etc. Just a small limited set of possible values. The most common usage of Tone+ENV is bass sounds and auto-ENV feature fits just great for such purposes.

2. Control ENV pitch with a note with velocity value 1. It's not usable for live playing but it's usable in sequencer.

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Mon Oct 19, 2009 10:06 am

Megus wrote:1. Auto-pitch for ENV: in AY trackers for ZX Spectrum when I enter a note in a channel and "auto-ENV" feature is on, tracker fills ENV register values automatically. And there was a ratio parameter for ENV pitch calculation which can be set to values like: 1/1, 1/2, 2/1, 3/4 etc. Just a small limited set of possible values. The most common usage of Tone+ENV is bass sounds and auto-ENV feature fits just great for such purposes.


Now that is very handy. I use such an "auto ratio" thing on the sync buzzer. since the Sync Buzzer is an emulated IRQ timer that restarts the HardWave i had to tune it with regards to the period lenght of the required note.

Making this would be doable inside a single oscillator code easily, but are you sure that would be enough?

Megus wrote:2. Control ENV pitch with a note with velocity value 1. It's not usable for live playing but it's usable in sequencer.


Another interesting approach, this one however would be difficult in my code. I could have a CC play the whole range the env can play instead i guess.
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Mon Oct 19, 2009 12:12 pm

Auto ENV approach is very useful for bass sounds and isn't suitable for various interesting effects.

I think that both approaches should be used so user can choose between them. But in case where there are 2 pitches - CC for env pitch might be not very good as, for example, to get interesting "acid" sounds we use env pitch as a base note and then make fast tone pitch slide from very high note to some low one. The way with 2 separate notes would be more flexible and easy to use for musician, though I understand that implementing it this way may be difficult. But I'd love to have it implemented any way :)

Thank you in advance!

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Mon Oct 19, 2009 2:11 pm

BTW, yet another question about ENV emulation: how much amp steps do you have for YM envelope? YM has 32 steps while AY has 16 steps.

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Tue Oct 20, 2009 8:18 am

Megus wrote:BTW, yet another question about ENV emulation: how much amp steps do you have for YM envelope? YM has 32 steps while AY has 16 steps.


That is correctly emulated.
The YM sync buzzer/hardwaves are MUCH smoother sounding than the AY,
please confirm by having a look at the oscilloscope, or render as wav.

Regards
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Tue Oct 20, 2009 10:51 am

Yes, I checked the oscilloscope and found more than 16 steps in YM hardwaves, thank you!

BTW, some important notices: AY/YM noise pattern shouldn't be reset on note on or any other pitch change, it should run continuously (free phase). The same goes to tone. Envelope phase should be reset when I change hardwave, when I just change pitch - phase should run continuosly too.

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Tue Oct 20, 2009 12:07 pm

Megus wrote:BTW, some important notices: AY/YM noise pattern shouldn't be reset on note on or any other pitch change, it should run continuously (free phase).


in chispounds, Since the voices stop start and you can have any number such voices playing at once (by using polyphony cheating), the "voice" design can't allow for a global clock counters.

However for other noise patterns that i know which don't reset all the time, I've used a "random position" trick on each note... its not totally accurate, however, it solves the "machine gun" pattern effect.

I just changed AY.sfz again here is the difference it makes:

Original machine gun noise, then random offset noise:
http://plogue.com/davidv/cs_stuff/AY_no ... t_comp.mp3


Megus wrote:The same goes to tone. Envelope phase should be reset when I change hardwave, when I just change pitch - phase should run continuosly too.


Tone would be difficult because you cant really choose a random start position between 0 and 1.

However for hardwave, dont trackers hard reset the ENV on note start?

Thank you!!! Where were you in my beta testing phase :)
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Tue Oct 20, 2009 2:17 pm

davidv wrote:in chispounds, Since the voices stop start and you can have any number such voices playing at once (by using polyphony cheating), the "voice" design can't allow for a global clock counters.

Well, as we have limited polyphony, then, I guess you should have "phase" (or clock) counter for each voice, so isn't it easy to not reset them on note on event? :)

davidv wrote:However for other noise patterns that i know which don't reset all the time, I've used a "random position" trick on each note... its not totally accurate, however, it solves the "machine gun" pattern effect.

I just changed AY.sfz again here is the difference it makes:

Original machine gun noise, then random offset noise:
http://plogue.com/davidv/cs_stuff/AY_no ... t_comp.mp3

Yes, now it sounds way better! Thank you once again.

davidv wrote:Tone would be difficult because you cant really choose a random start position between 0 and 1.

Well, this is how AY works internally:
It has internal counter which is increased by 1 each clock tick. When counter value become equals to 12-bit tone period value, counter resets to zero and tone voice output bit is changed - from 0 to 1 or from 1 to 0. And this counter is never reset on tone period value changes.
So, this counter value can be called a "position between 0 and 1" :)

Free-phase mode is very important for ENV+tone bass sounds. This way they're "flowing", each note is different because of little off-sync between tone and ENV periods. But if you have both ENV and tone phase reset on note on, each note will sound the same. That's why I'm asking for free-phase mode :)

davidv wrote:However for hardwave, dont trackers hard reset the ENV on note start?

ENV internal counter is reset when I write a value to ENV type register and isn't changed when I write values to ENV period registers. Some trackers allow changing only period registers without hard reset. This gives us a possibility to do pitch slides on hardwave sounds :)

davidv wrote:Thank you!!! Where were you in my beta testing phase :)

I'd be happy to take part in beta testing of Chipsounds but I heard of it first time only 9 days ago from some Russian 8-bit related blog.

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Tue Oct 20, 2009 2:50 pm

Hi

I think it would be very easy to implement that in pure C++ code using a modified version of my BiduleAY proto. In there i run an internal timeline at "master clock" rate, and downsample back to host samplerate, which is what most good emulators do imho.

The hardest part of this whole project was finding tricks to fit all chips and possible waveforms and textures onto separate slots using only my SFZ engine and my custom oscillators. This is a nice clean model that works for 95% of stuff. . (and also you realize that AY.sfz is a text file) ... so usually no need to recompile anything using that!

But for the rest, its really preferable to have custom code, and this is not hard to do. In fact its simpler usually. This approach will be used for my complementary SID and AY sound (possibly more) in 1.x
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Megus
Posts: 9
Joined: Sat Oct 17, 2009 3:00 pm
Location: Russia
Contact:

Postby Megus » Tue Oct 20, 2009 3:57 pm

There's absolutely best AY emulator and music player for Windows - AY Emul by Sergey Bulba. Its sources are available here: http://bulba.untergrund.net/progr_e.htm
It's written in Delphi but it's easy to port AY emulation code to C++. If you haven't seen this emulator before - you must check it. It's just the best. I hope it may help you :)

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Tue Oct 20, 2009 4:52 pm

Thanks Megus. However due to the commercial nature of this product, I'm forbidden to include public source code into a closed source applications, for legal, and ethical reasons... but mostly, because it wouldn't be as fun as coding it myself ;)

The license is funny:
"You can use this source code freely, only do references to author (Sergey
Bulba)."

Well ok, Ethical and Fun reasons apply not the legal one.

That said, knowing that is the best emulator might serve as good benchmark for my results, and to compare with HW. Thanks
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Postby davidv » Wed Oct 28, 2009 3:28 pm

news:

I've made my own AY emulator:

http://ploguechipsounds.blogspot.com/20 ... otype.html
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com


Return to “chipsounds Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest