Welcome! Log In Create A New Profile

Advanced

Playing Notes with ASNDlib

Posted by DaVinz 
Playing Notes with ASNDlib
June 17, 2010 01:54AM
Hi !

Is there a solution to play notes (or a frequency) with the ASND library ?

A function like, for example, in this good old BASIC : Sound( MyNote, Duration );

For the moment, the only solution I've found, is to get a sample of a note, and play it at different speed. Is it really the only way ?
Re: Playing Notes with ASNDlib
June 17, 2010 05:41AM
have you looked at the header file. If I remember right there are definitions for different note frequencies.
Re: Playing Notes with ASNDlib
June 17, 2010 03:01PM
Yes, you're right :)
and these definitions were the origins of my question.

I've found the very first function declared in asnlib.h : int ANote2Freq( int Note, int Freq_Base, int note_base );

but this function don't play any sound. It should just be a convertion function.
So I think this function is use for decoding MOD (were a root sample is play at different rate to make notes).

So the question remain, is it possible to play a frequency, without a sample ?



Edited 1 time(s). Last edit at 06/17/2010 03:20PM by DaVinz.
Re: Playing Notes with ASNDlib
June 18, 2010 01:15AM
[wiibrew.org]

If found this on the asndlib wiibrew page.

Taking a quick looking at the source. First for songlib.a try changing gecko to eabi in the makefile. And then with demo try swapping #include "snd.h" for #include asndlib.h.



Edited 1 time(s). Last edit at 06/18/2010 01:18AM by linus.
Re: Playing Notes with ASNDlib
June 19, 2010 05:28PM
Thanks a lot for this source Linus ! (... and Hermes ;) )

...but it prove only that it's impossible to emit a wave via asnlib. (Hermes use samples that he plays at different speed to simulate note and octave. It is the method used fo Mod, Mid, etc..)

After some research I finally found why it's impossible. Our "good old BASIC" drive a sound processor. This sound processor is a wave generator... so it does work with frequencies and period. This kind of processor is noisy ( remember :'( )

Today, sound cards are better, and can reproduce real sound, but the sound generator became useless... and disapear.


SO. Asndlib can not play frequency, cause the Wii cannot. The Hermes's method is the only way. (but the lib is quite hard&heavy to use).

Perhaps one day, if I've some free time, I will program a little library to play simply sounds at different octave :)
Sorry, only registered users may post in this forum.

Click here to login