It is currently Fri Nov 24, 2017 11:47 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Squeedo sound synth
PostPosted: Sun Nov 28, 2004 9:42 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
I'm currently experimenting with my Squeedo cart, using one of the high-performance 18F PICs.

I've got some ideas on how to add expansion sound to the NES with it. It uses (relatively) very little of the NES's CPU time, but it has to interrupt it (currently) at 22.05kHz. The mixing rate will be controllable by the NES.

http://2a03.org/forum/viewtopic.php?id=259

See my post there also, and let me know what you think. Would anyone be interested in using something like this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 9:57 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19256
Location: NE Indiana, USA (NTSC)
I'd consider clocking it at 113.667 CPU cycles per sample so that it can be used from cycle-timed code.

And it shouldn't be too hard to support wavetables at any power-of-2 length: just have an AND and an OR between the frequency counter and the address generator.

Does this mixer have volume control? Does the PIC even have a multiplier?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:31 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
tepples wrote:
I'd consider clocking it at 113.667 CPU cycles per sample so that it can be used from cycle-timed code.


Yeah, good idea. That way the NES could do scanline effects and sound output in the same IRQ routine. Would be faster than having 2 seperate IRQ routines timed differently, for sure. It might not have enough time to do much mixing in 113.667 NES cycles, though. One channel, maybe two, I'm guessing. My goal currently is to get 4 channels at 22050Hz.

It'll be tricky to set up with that 2/3 CPU cycle, but I've got 3 different clocks. The 10Mhz PIC clock is timing the mixer, then there's the 1.789Mhz NES clock (not much advantage over the PIC clock in this case), and the scanline counter (which stops counting during vblank, can't let that happen in a mixer).

Polling the register could work instead of IRQs also, but keep in mind that reading the register too often will steal time from the PIC (since it get's interrupted).

Quote:
And it shouldn't be too hard to support wavetables at any power-of-2 length: just have an AND and an OR between the frequency counter and the address generator.


This newer PIC has an indirect indexed mode, also greater/less than comparison opcodes. So I think an optimal thing to do might be to have a max 256 byte sample and make registers to allow a program to set the start and end points of the waveform. Keeping it pointed towards the same 256 byte table especially would save time.

Quote:
Does this mixer have volume control? Does the PIC even have a multiplier?


Yeah, the PIC18F-series has an 8x8 hardware multiplier. Single cycle operation, it's great. The PIC16F that I was planning on using originally doesn't. The 18F is really powerful, faster, and much more fun/easier to code for. I'd like to use it exclusively, if anyone planning on buying a Squeedo cart wouldn't mind paying the extra $4-$5.

Volume is what I plan on adding next, that multiplier should make it practical to do. Yesterday I added 24-bit frequency control (though the highest bits are kinda useless, you usually don't want to skip 127 bytes in a 256 byte sample, heheh.

In other news, I'm getting an EPROM programmer, and should have it in a couple weeks. So I can finally figure out if my flash programming design works or not, heh.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 2:25 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Here's the results from my first sound tests. These are all samples being played through $4011 (the NES is only sitting in a JMP loop and receiving IRQs). Not doing anything really fancy yet.

Also.. these samples aren't the best quality. They're coming from an NES toploader RF modulator, to a TV, out the TV's headphone hack, to my pc.

sine wave:
http://mywebpages.comcast.net/memblers/squeedo/samps/001.wav

four sine waves at diffrent octaves:
http://mywebpages.comcast.net/memblers/squeedo/samps/002.wav

pulse-width sweep (that's 128 duty cycle steps) :D
http://mywebpages.comcast.net/memblers/squeedo/samps/004.mp3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 8:00 pm 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
Extra noise channels would be good. (or being able to set a channel to a "noise mode" instead of wavetable mode)

Is this a software synth?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 9:41 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Yep, it's a software synth. I've wanted to make one of these for a long time. :) Writing it in PIC asm, but the NES still needs to support it with a short IRQ routine.

I should be able to do pseudo-random noise without any trouble, that would be interesting. Maybe even let the NES set the seed for the random # generator? That might be fun.

The frequency control for it would be extremely fine compared to NES's 4-bit noise control, but it couldn't do the insanely high-frequencies that the NES does.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 12:51 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19256
Location: NE Indiana, USA (NTSC)
What I'd like to see is actual filtered noise, where you generate noise every sample and then pass it through a low-pass filter. It'd probably make drums sound a bit more realistic. Is that possible?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 2:11 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Yeah, it should be doable. I've got a basic idea for a low-pass filter that I could try out. It could sound interesting with any other waveform, too.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 4:53 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Here's a sample of the first noise test, playing at maximum frequency.
http://mywebpages.comcast.net/memblers/squeedo/samps/005.wav

I'll try writing a filter next.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: MrNorbert1994 and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group