Author Topic: AY emulation library  (Read 1589 times)

0 Members and 1 Guest are viewing this topic.

Offline AugustoRuiz

  • CPC664
  • ***
  • Posts: 121
  • Country: es
  • Liked: 157
  • Likes Given: 49
AY emulation library
« on: 16:33, 31 August 15 »
Hi all,

I have uploaded to Github WYZTracker source code. One of its components is an AY emulation library that supports emulation with multiple chip frequencies (so it does emulate properly CPC sounds!). It uses floating point for calculations, and IMHO it's quite accurate... Targhan helped a lot testing it thoroughly!

It's been used also in Arkos Tracker.

If any emulator creator would like to use it for their AY emulation, feel free to use it! It's developed in C#, but porting it to C/C++ is almost copying and pasting...

WYZTracker/LibAYEmu at master · AugustoRuiz/WYZTracker · GitHub

Cheers!

Offline ssr86

  • CPC664
  • ***
  • Posts: 120
  • Country: pl
  • Liked: 48
  • Likes Given: 21
Re: AY emulation library
« Reply #1 on: 03:27, 05 September 15 »
Sorry for asking, but how hard was it to write a crosdsdev tracker? How long did it take for a first stable realease? What took the longest time (apart from debugging)
I'm considering trying to make one for the Enterprise's dave chip (in a distant future I guess) because there's none available and trying to do music for it is a pain (at least for me). Seeing that you put up the source code of your tracker (of which existence I haven't had a clue:( - sorry) put a big smile on my face, because one can see "how it's made":)
Thank's for the repo!

Offline AugustoRuiz

  • CPC664
  • ***
  • Posts: 121
  • Country: es
  • Liked: 157
  • Likes Given: 49
Re: AY emulation library
« Reply #2 on: 12:24, 06 September 15 »
Sorry for asking, but how hard was it to write a crosdsdev tracker? How long did it take for a first stable realease? What took the longest time (apart from debugging)
I'm considering trying to make one for the Enterprise's dave chip (in a distant future I guess) because there's none available and trying to do music for it is a pain (at least for me). Seeing that you put up the source code of your tracker (of which existence I haven't had a clue:( - sorry) put a big smile on my face, because one can see "how it's made":)
Thank's for the repo!

Well, it basically depends on your proficiency with the tools you use to develop, your base knowledge, and your ability to learn new things.

I developed the tracker using C#, and at that time I used it daily at work. But I had no idea about how to program sound with it. The longest time was implementing the player for WYZ's player. There was no documentation but the source,  and I used to chat a lot with WYZ to ask him things about the details. I got a C implementation of the AY emulation from Sergey Bulba's website, which seemed to sound OK (but as Targhan confirmed me,  it didn't), and ported it in a couple hours.

Then I made some tests writing to the chip registers and evaluating the output as raw numbers. When that seemed correct, I implemented the data structure that would hold instruments,  fx and the song. Created a sample song using code, and implemented the player. When all that was ready, I built the UI to manipulate it. So... my suggestion would be: think a lot about your data structures, how will you organise your data so that it is easy to read, display and manipulate.

Using C# Windows Forms binding mechanisms saved me a lot of code. Also using standard serialization to save/load songs really saved quite some work. But if I were to write the tracker today, I would have done it in Javascript and HTML 5 (I have done the editor and instrument editor already, but I don't think I'll go down that route, I need to focus on SF2CPC!). So that I could upload the tracker to some website and nothing needed to be downloaded.

Anyway, the first version took a couple weeks of work, and about a other week to remove bugs. But it's been improving slowly as some changes to the player were made by WYZ!

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 788
  • Country: es
  • Liked: 646
  • Likes Given: 445
Re: AY emulation library
« Reply #3 on: 16:58, 06 September 15 »
...I have done the editor and instrument editor already, but I don't think I'll go down that route, I need to focus on SF2CPC!...

Sorry for the offtopic, how is going the CPC port of SF2?

Can you update us with some news???  ;)

Offline AugustoRuiz

  • CPC664
  • ***
  • Posts: 121
  • Country: es
  • Liked: 157
  • Likes Given: 49
Re: AY emulation library
« Reply #4 on: 11:59, 10 September 15 »
Yes, I'll do that in the proper thread.