Author Topic: Some audio stuffs  (Read 4139 times)

touko

  • Hero Member
  • *****
  • Posts: 953
Re: Some audio stuffs
« Reply #30 on: November 06, 2015, 08:05:47 PM »
Quote
Yeah. I try to limit my criticisms to stuff that's more on the extreme side of things. For PCE, it's usually sprite optimization - or rather approaching the system like an arcade machine with lots of sprite pixel line bandwidth.
i can understand that using the largest sprites size (32x64) for exemple is the easiest way(DD2 and strider did that) to avoid using metasprites,but i'am for a minimum of clean and/or logical coding, especially by a (supposed) professional .
There is a big marging between crazy ass optimised code, and crazy ass unoptimised one,and i did not expect that coders spend many hours optimizing their routines,but definitively not at this point . 
« Last Edit: November 06, 2015, 08:12:24 PM by touko »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #31 on: November 08, 2015, 10:52:09 AM »
Touko: What if I said that I could give you 8 PCM channels at 6bit depth, each with full volume control, driven at 7khz... all with a total cpu resource requirement of 21.5%?

Btw, those 8 PCM channels still leaves 4 regular PCE audio channels remaining (a total of 12 audio channels). What would you do with all those sample channels? Mind you, they would be fixed frequency (no pitch bending). Also, those PCM channels would be mono. But the regular PCE channels would still be stereo.

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Some audio stuffs
« Reply #32 on: November 08, 2015, 01:04:21 PM »
8 PCM channels? That fast?  :shock: ... Cool!  :D

touko

  • Hero Member
  • *****
  • Posts: 953
Re: Some audio stuffs
« Reply #33 on: November 08, 2015, 07:22:56 PM »
Quote
What if I said that I could give you 8 PCM channels at 6bit depth, each with full volume control, driven at 7khz... all with a total cpu resource requirement of 21.5%?
I will answer ,it's you manfred trenz !! ;-)

It would be awesome of course .
« Last Edit: November 08, 2015, 09:10:59 PM by touko »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #34 on: November 09, 2015, 05:07:13 AM »
Quote
it's you manfred trenz !! ;-)
Manfred Trenz!?!? But.. I don't have a beard ;>_>

So now I just need to deliver on the goods. I've written it all the routines, I just need make a split table and a volume table.


Quote
8 PCM channels? That fast?  :shock: ... Cool!  :D

I didn't think it was a big deal, because they aren't frequency scaled like fancy mod/xm channels. I always though it was apparent that the PCE could soft mix channels pretty fast, so I never really bothered with showing it off. But the other day, I was reading over the comments of single channel ADPCM demo I posted (I didn't write that demo, I just optimized/modified it to play faster; mednafen author wrote it).. and people seem to think they're impressive. The main point of those demos wasn't high frequency, high resolution PCM playback - but to demonstrate realtime decompression capabilities of the PCE (4bit storage for 10bit output is pretty decent savings). Then it dawned on me a couple of days ago.. I guess people really aren't aware of capabilities of the PCE to do soft mixed streaming samples. It's as if the 65x core were design to do this - lol. Super fast indexing, direct memory access, and look-up tables are the ingredients in the magic elixir for the 65x. Sprinkle a little self-modifying code and voila - power.

 Off topic of this, I was messing with frequency ranges from 7khz to 15.3 khz (256 samples per frame). And right about 9.5khz there is a sharp increase in clarity. The difference from 7khz to 9.5khz is bigger than any difference above it. Well, in response to this one clip. The Gameboy Advance "Sappy" driver, the driver Nintendo provided in the devkits, had 8 frequency scaled PCM channels feeding an 8bit DAC. There's two 8bit DACs, but if you're doing stereo it's still 8bit. The playback rate of that player is ~13khz. Advance Guardian Heroes on the GBA uses ~7.88hz playback. It kind of puts a perspective on things.


 All this assumes the direct write to DDA port method. I haven't explored abusing the waveform buffer.

 I'm also toying with the idea of maybe abusing some sort of bias into the analog signal, to create a lower frequency tone. Something bass-ish. An example would be if you ran a timer interrupt that always feed a DDA channel (even line zero data), but assuming the DDA channel really does respond to a ceiling of 3.58mhz, you could write two "pulse" values 40 cycles before the actual DDA sample. That pulse would exist at 178.9khz, changing at a rate of 7khz. Not really sure how it would sound, or how much of an impact it would have in terms of amplitude. Might not be worth the overhead, even if it is small. It needs testing. If it does work, it'll be one of those things that only works on the real system (unless an emulator can respond to DDA writes that fast).

 There are just so many different ways to create audio stuffs on the PCE. It's kinda like being a kid in a candy store. Which one to choose?

touko

  • Hero Member
  • *****
  • Posts: 953
Re: Some audio stuffs
« Reply #35 on: November 09, 2015, 05:43:05 AM »
Quote
There are just so many different ways to create audio stuffs on the PCE. It's kinda like being a kid in a candy store. Which one to choose?
Ahahah, too many ideas, and no enough time .

Quote
Manfred Trenz!?!? But.. I don't have a beard ;>_>
Lol true, but beard is not the most difficult skill to have . ;-)

Better quality for samples means more space in rom eaten,it's not a big deal if you have a 20MB(or more) card or AC, but definitively with classic ones.
« Last Edit: November 09, 2015, 05:48:15 AM by touko »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #36 on: November 09, 2015, 06:23:20 AM »
Hmm.. this thread is soo off topic. I'll continue audio stuffs in the other pin'd thread.

 For those that can test the rom that I'll provide a link for.. just give me a few days. :)

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Some audio stuffs
« Reply #37 on: November 09, 2015, 12:31:32 PM »
The Gameboy Advance "Sappy" driver, the driver Nintendo provided in the devkits, had 8 frequency scaled PCM channels feeding an 8bit DAC. There's two 8bit DACs, but if you're doing stereo it's still 8bit. The playback rate of that player is ~13khz. Advance Guardian Heroes on the GBA uses ~7.88hz playback. It kind of puts a perspective on things.

Apparently, the GBA DAC converts the PCM channels through PWM (at 65Khz) which degrades the sound quality *lots*.

I speak for myself, but one of the reasons not a lot of people hit the sample hardware (& make trackers, etc.) on the PCE is complete lack of musical know-how.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #38 on: November 09, 2015, 03:34:05 PM »
Quote
one of the reasons not a lot of people hit the sample hardware (& make trackers, etc.) on the PCE is complete lack of musical know-how.

You mean music composition?
« Last Edit: November 09, 2015, 04:20:33 PM by Bonknuts »

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Some audio stuffs
« Reply #39 on: November 09, 2015, 04:15:32 PM »
Not even composition -- if a person doesn't know how musical time signatures work, note lengths, etc. etc. then he wouldn't even know how to make an optimal music format or player.  You know, the stuff that aids in composition.

touko

  • Hero Member
  • *****
  • Posts: 953
Re: Some audio stuffs
« Reply #40 on: November 09, 2015, 08:19:20 PM »
Quote
on the PCE is complete lack of musical know-how. if a person doesn't know how musical time signatures work, note lengths, etc. etc. then he wouldn't even know how to make an optimal music format or player.
i agree with you chris,i'am able to do a sfx driver(the more easy part), but i'm not able to create any sfx(except white noise) from scratch,music (driver and compos) is simply out of questions for the reasons you said .
« Last Edit: November 09, 2015, 08:25:22 PM by touko »

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Some audio stuffs
« Reply #41 on: November 10, 2015, 04:38:13 AM »
Not even composition -- if a person doesn't know how musical time signatures work, note lengths, etc. etc. then he wouldn't even know how to make an optimal music format or player.

I totally agree with this.

When I wrote my first music driver, I started off completely ignorant of all of those things, and it was only because I was working directly with a musician, and basically coding to his design requests, that I began to get even a simplistic understanding of how music was put together.

If I hadn't been working with that guy, I wouldn't have know where to start.

As a programmer, I still don't understand how musicians think and how they work their magic.  :oops:


Quote
You know, the stuff that aids in composition.

IMHO this is the critical part these days. To be productive, the musician must be given a way to easily edit the music that gives them rapid feedback.

There is plenty of cheap software to create music now, and I suspect that anyone working on a "new" driver needs to tie into (and extend?) some existing format that has a mature and comprehensive editor ... or else it may see little use. Most folks just don't like to have to learn completely new stuff in order to use something.
« Last Edit: November 10, 2015, 04:42:43 AM by elmer »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #42 on: November 10, 2015, 02:13:42 PM »
Depends on the musician. Some of the competing chiptune musicians nowadays want ultimate flexibility in sound design and aren't too afraid to get their hands a bit dirty.. in the mix of it (pun intended).

 But I think an interface that allows both a simplistic and easy approach, at the same time while also offering a complex side for more flexibility when the user gets acquainted with the setup - is the best approach. Nothing sucks more than, "oh! I love this engine but... if I could only do this.." Well, almost. I guess there could be worse things.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Some audio stuffs
« Reply #43 on: June 26, 2016, 10:46:04 AM »
Ok guys, I need some testers to test this out on the real hardware:
http://www.pcedev.net/audio/SamplePlayer/test_sm_note_stereo.zip

Let it cycle through the high octaves, and then wrap around to octave one. You can stop it at octave three on the wrap around.

 I just want to make sure it works on other real hardware. This is just a single channel and note incrementing. I have other tests coming up with finestep and multiple channel stuffs.
 

touko

  • Hero Member
  • *****
  • Posts: 953
Re: Some audio stuffs
« Reply #44 on: June 27, 2016, 01:01:38 AM »
I'll test asap on my sgx .

EDIT: tested ,it works fine, there is some noise on the sample playback, but the pitch change works very well,but sound is only on the left speaker .

Display is ugly thought, the text is distorded .

« Last Edit: June 27, 2016, 08:25:50 PM by touko »