BBC BASIC for Windows
Programming >> Libraries >> HQSOUND module released
http://bb4w.conforums.com/index.cgi?board=libraries&action=display&num=1433932197

HQSOUND module released
Post by rtr2 on Jun 10th, 2015, 10:29am

I have released version 1.0 of the HQSOUND library module, which patches BB4W in memory so that the SOUND and ENVELOPE statements output 'CD quality' sound (see the related thread and the REMarks in the program). The module may be downloaded from the Files section of the Yahoo! group here (members only):

https://groups.yahoo.com/neo/groups/bb4w/files/Libraries/

If you are not a member of the Yahoo! group you can get it from this direct download link.

I have quite deliberately not added any 'fancy' features, such as being able to change the stereo mix or redefine the waveforms, but I have hopefully commented the code sufficiently well that anybody who wants to enhance its capabilities can do so themselves.

Richard.
Re: HQSOUND module released
Post by dfeugey on Jun 11th, 2015, 09:09am

Ah, very cool. Exactly what I need smiley
Re: HQSOUND module released
Post by rtr2 on Jun 21st, 2015, 06:20am

I would appreciate some feedback on this proposal for changes to HQSOUND:
Richard.
Re: HQSOUND module released
Post by dfeugey on Jun 21st, 2015, 10:08am

Seems to be clear and useful... for me smiley
Re: HQSOUND module released
Post by DDRM on Jun 21st, 2015, 9:28pm

Hi Richard,

That would be great - I've been playing along similar lines, but I don't understand it well enough to make it work! I can change it to give any INITIAL setting for the stereo channels, but I'm struggling to make it possible to come back and change it later.

I tried splitting out the original "setting up" elements, and a separate "write the wave table" section, but I'm struggling to pass the required info between them when calling the latter on subsequent occasions. I suspect I'm missing something that is local, and not preserving it properly - or maybe the address of a routine changes between calls?

Best wishes,

D
Re: HQSOUND module released
Post by rtr2 on Jun 22nd, 2015, 05:55am

on Jun 21st, 2015, 9:28pm, DDRM wrote:
I tried splitting out the original "setting up" elements, and a separate "write the wave table" section

My proposal does not support re-writing the wave table. To make that possible would require returning two values rather than one, so instead of a function FN_hqinit it would need (for example) to be a procedure with two RETURNed parameters.

If anybody thinks that re-writing the wave table is important then shout now before I make the suggested revisions.

Richard.
Re: HQSOUND module released
Post by DDRM on Jun 22nd, 2015, 08:48am

Hi Richard,

My plan to split things that way probably demonstrates my lack of understanding: I suspected that the wavetable would need to be updated to move the stereo position, since I couldn't see how to tease out the two elements. If one can simply rewrite that small block, that's obviously an easier and quicker solution, and is fine with me.

Best wishes,

D
Re: HQSOUND module released
Post by rtr2 on Jun 22nd, 2015, 2:36pm

on Jun 22nd, 2015, 08:48am, DDRM wrote:
I couldn't see how to tease out the two elements.

They're entirely independent. The stereo mix (pan position) is simply a function of the relative left and right amplitudes whereas the wave table determines the quality of the sound (e.g. what harmonics are present).

Richard.

Re: HQSOUND module released
Post by rtr2 on Jun 24th, 2015, 04:12am

on Jun 21st, 2015, 06:20am, g4bau wrote:
I would appreciate some feedback on this proposal for changes to HQSOUND

I conclude that there is insufficient interest to warrant any further effort.

Richard.
Re: HQSOUND module released
Post by rtr2 on Jun 24th, 2015, 12:54pm

on Jun 24th, 2015, 04:12am, g4bau wrote:
I conclude that there is insufficient interest to warrant any further effort.

To avoid any misunderstanding can I clarify that I already have fully-developed and tested versions of the HQSOUND library which support returning pointers to the stereo mix and wave tables.

Richard.

Re: HQSOUND module released
Post by afarlie on Sep 8th, 2015, 8:27pm

on Jun 10th, 2015, 10:29am, rtr2 wrote:
I have released version 1.0 of the HQSOUND library module, which patches BB4W in memory so that the SOUND and ENVELOPE statements output 'CD quality' sound (see the related thread and the REMarks in the program). The module may be downloaded from the Files section of the Yahoo! group here (members only):

https://groups.yahoo.com/neo/groups/bb4w/files/Libraries/

Richard.


Which version of BB4W was this intended for? AS I understand somethings changed in V6?



Re: HQSOUND module released
Post by afarlie on Sep 8th, 2015, 9:48pm

Sounds very nice. (Not that I can understand the code).

Were there long term plans to add more channels like on RISC OS based systems. ( which also have per channel wavetables)? I won't be disappointed if this isn't planned.

I will also note that somewhere in the BB4W notes is some assembler code for calling sound from assembler... Now if someone can figure out how to tweak that code so it can add it into the BB4WFORTH you wrote a while ago (Aside: Not sure if this needs patching for BB4W6.0a) then with BB4WFORTH+HQSOUND means a Windows based AMPLE is a lot more plausible again. Any takers?

IIRC the original Music 500 used 7bit samples, Hmmm....