Sinewave sound
Sinewave sound
Hi there,
I have recently started with devkitARM for NDS and I have been working with square waves using the soundPlayPSG function . I have been searching for a function to generate sine waves before I attempt to write one myself (instead of reinventing the wheel). I understand that from a hardware sense the PSG is Square Wave, but I am thinking that there must be ways to manipulate this.
Thanks in advance.
I have recently started with devkitARM for NDS and I have been working with square waves using the soundPlayPSG function . I have been searching for a function to generate sine waves before I attempt to write one myself (instead of reinventing the wheel). I understand that from a hardware sense the PSG is Square Wave, but I am thinking that there must be ways to manipulate this.
Thanks in advance.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Sinewave sound
The PSG generates square waves, you can't make it generate sine waves, sorry.
Re: Sinewave sound
if you can change volumes quick enough you might generate something that resembles a PCM.
Re: Sinewave sound
Thanks WinterMute and sverx.
The idea of changing volumes is a good one. I have the Korg DS-10, and it got me wondering how did they do that? I guess they could have also used samples, but I want to stay clear of samples.
I'm starting to read your libnds sound.c WinterMute to get my head around what the DS can and can't do as I am new to this system
The idea of changing volumes is a good one. I have the Korg DS-10, and it got me wondering how did they do that? I guess they could have also used samples, but I want to stay clear of samples.
I'm starting to read your libnds sound.c WinterMute to get my head around what the DS can and can't do as I am new to this system
Re: Sinewave sound
You don't actually need to change volumes quickly; because DS sound channels already support playing back PCM samples.
Donate to devkitPro - help us stay alive!
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Sinewave sound
Is there a good reason to avoid samples? They can easily be generated on the fly - it's much easier than modulating PSG volume.
Pretty sure the Korg DS-10 uses samples.
Pretty sure the Korg DS-10 uses samples.
Re: Sinewave sound
IMHO I wouldn't use the PSG at all, given the hardware can do much more than square waves, but if you really don't want to use the samples it's up to you
Re: Sinewave sound
Thanks guys,
You have got me thinking, I could generate some PCM data and stream it. I will read up on this now as I wish to build a very basic synthesiser with, for example Sine, Square, Triangle waves and ADSR. Thanks
You have got me thinking, I could generate some PCM data and stream it. I will read up on this now as I wish to build a very basic synthesiser with, for example Sine, Square, Triangle waves and ADSR. Thanks
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Sinewave sound
Maxmod can do streaming, see https://github.com/devkitPro/nds-exampl ... /streaming which should also be in your /opt/devkitpro/examples/nds directory.
There is more documentation at https://maxmod.devkitpro.org/
There is more documentation at https://maxmod.devkitpro.org/
Re: Sinewave sound
Thanks WinterMute
That is excellent material and will really help me get on track!
That is excellent material and will really help me get on track!
Who is online
Users browsing this forum: No registered users and 0 guests