Apple2.gs Forums
Discussions for Apple IIgs Programming and other fun stuff. // Infinitum!

Home » Apple IIgs Programming » Audio » Thinking about the big picture of sound on the IIGS ((Newbie question))
Thinking about the big picture of sound on the IIGS [message #24] Thu, 18 September 2014 15:16 Go to next message
mcpderez is currently offline  mcpderez
Messages: 12
Registered: August 2014
Contributor
This question is probably one I could spend some time looking up an answer to, but perhaps it is easier to just ask someone experienced.

I did not have a IIGS until recently and am not very knowledgable about how its sound works.

To try to get a conceptual framework, in the context of writing code that includes sound, I am wondering if you can load a sample into the sound hardware and then let it manage the playback, or do you have to process sound in the same time you are trying to update graphics as the frames are drawn? I am thinking more along the lines of background music as it seems like any event driven sound effects would be initiated along with collision detection for instance.

If the answer is yes, the sound hardware can take a clip and run with it, what format do those sounds take, usually?

If the answer is no, is there a customary place in the code where it makes sense to do the sound?


Re: Thinking about the big picture of sound on the IIGS [message #26 is a reply to message #24] Fri, 19 September 2014 14:55 Go to previous messageGo to next message
Dagen is currently offline  Dagen
Messages: 27
Registered: August 2014
Location: United States
Member

There are two main ways to access the sound, programming the sound hardware (specifically the Ensoniq DOC) directly or using Toolbox Calls. There are official Apple tools to play single sounds or midi sequence sounds, and there are third-party sound Tool sets to play music files that are like Amiga MODs, the SoundSmith and NoiseTracker tools (219&220).

Basically, either one works like this, 1) you load sounds into the 64k DOC RAM and 2) you trigger something to have the doc play your note(s).

So generally speaking, there is not much, if any overhead to playing many samples at once. NoiseTracker allows you to use more than 64KB of samples by swapping sample data in and out. That's probably going to eat some CPU.

I'm sorry for the general answer. I don't have enough background in sound programming to give detail to the response, but I do know that if you have a sample in DOC RAM, you can get the DOC to play it back and the CPU doesn't incur any load.
Re: Thinking about the big picture of sound on the IIGS [message #27 is a reply to message #26] Sat, 20 September 2014 08:37 Go to previous messageGo to next message
mcpderez is currently offline  mcpderez
Messages: 12
Registered: August 2014
Contributor
That's exactly the general big picture answer I was looking for. The names of soundSmith and NoiseTracker will help focus my searching.

By the way, the audio forum still shows empty to me (I had sent you a PM), but I was able to find your post by searching for "sound" using the Forum Search field at the very top of the page. Weird.
Re: Thinking about the big picture of sound on the IIGS [message #29 is a reply to message #27] Wed, 01 October 2014 10:39 Go to previous messageGo to next message
Oz is currently offline  Oz
Messages: 21
Registered: October 2014
Location: France
Member
There is a very good documentation about the low level programming of the DOC and the sound RAM in the IIgs Epluché book :

www.apple-iigs.info/doc/fichiers/iigsepluche1.pdf

Starting from Page 413 to 464. You will find there the core routines to initialize the DOC, to write/read sound data data to/from the DOC memory, to play sounds...

Even if it is in french, you will find there a lots of small source code samples (Assemby Language, Merlin 16+ style).

No doubt that such part should be translated in english.

Oz
Re: Thinking about the big picture of sound on the IIGS [message #32 is a reply to message #29] Sat, 04 October 2014 23:42 Go to previous messageGo to next message
mcpderez is currently offline  mcpderez
Messages: 12
Registered: August 2014
Contributor
Great! Finally a chance to use the four years of high school French I endured. Surprisingly, after 25 years I'm still able to read enough to get the big picture of this book. Once I learn some of the computer-specific words, I'll see if I know enough to make a translation.
Re: Thinking about the big picture of sound on the IIGS [message #35 is a reply to message #32] Sun, 05 October 2014 02:29 Go to previous messageGo to next message
Oz is currently offline  Oz
Messages: 21
Registered: October 2014
Location: France
Member

We can help for the translation. you will find here several French speaking people.

I think the first step would be to run some OCR over the PDF file so we could grab the text. That will be easier to translate and format the source code using a Courrier font (much more easier to read than the font used in the book).

If you can extract the test, paste it here and we will do a first step translation : French -> Bad English, so you could take it from there and turn it as good English.

I think there is a real interest for this Sound part. It has been written by Dany Bar who did the FTA early music code (Nucleus).

Oz
Re: Thinking about the big picture of sound on the IIGS [message #72 is a reply to message #35] Wed, 29 October 2014 20:20 Go to previous messageGo to next message
kumele is currently offline  kumele
Messages: 3
Registered: August 2014
Poster
Would anyone mind if I took the suggestion and just did the whole thing? I found Olivier's suggestion to be a timely opportunity to learn, an interesting exercise, and a welcome distraction.

So I've created two documents. An OCR'd (and cleaned up) French version and an English version.

While the English version is probably good enough to use as it is, be aware that it likely isn't defect-free. If speakers of either language would care to help proofread and offer feedback, I will make a final version available at a later date. Some attention to technical accuracy between the versions is quite welcome, as I wasn't 100% certain at all times. As a secondary concern, the fidelity of the OCR to the original printed French might also benefit from a review.

Some notes:

These are plain text files, and were translated line-for-line in as practical a manner possible. This means that the line of code on line 2115 in the French version is the same code on line 2115 in English. This makes for a very easy side by side comparison, which aided greatly in the translation effort. The drawback is sometimes the English paragraphs have odd line lengths. This is just the nature of translating incongruent sentence structures, plus in a few places I've made slight additions for clarity.

For French speakers: I'm not an expert on French orthography (which sometimes gives me the impression of being less stable and less agreed-upon than English - although it is just an impression and could be untrue). There were some obvious errors in the original, and then some other things that just didn't look right. I tried to correct these in the French OCR version, but probably messed up some things and missed others. Please forgive me. My basic approach was to usually incorporate whatever made the spell-checker calm down, while also including some Google translate suggestions, all quite inconsistently.

So, to the files:
http://www.thunderheadbay.com/gs/IIgsEpluche_SoundAndMusic_F r.txt
http://www.thunderheadbay.com/gs/IIgsEpluche_SoundAndMusic_E n.txt

-Don
Re: Thinking about the big picture of sound on the IIGS [message #73 is a reply to message #72] Mon, 03 November 2014 05:23 Go to previous messageGo to next message
Oz is currently offline  Oz
Messages: 21
Registered: October 2014
Location: France
Member

Terrific job !

I have no time this week to review it but I'll do it soon. I have already noticed few typos, especially in the translation of LABELS in Source Code parts (FIN is used as label to define the end of the source, and it has been translated as END, which is correct but we find some BRA FIN at some locations).

I'll first validate the French OCRization and so I'll check the English translation (at least the Code parts). Do you remember which parts didn't look rights ?

Olivier
Re: Thinking about the big picture of sound on the IIGS [message #74 is a reply to message #73] Sun, 09 November 2014 00:18 Go to previous message
kumele is currently offline  kumele
Messages: 3
Registered: August 2014
Poster
Thanks Olivier!

I did not keep notes on what didn't look right going from the original PDF to OCR-French. When I was unsure of the French, I just made a decision and kept on going. These questions were mostly about spelling and typos, and are probably inconsequential.

When going from French to English, there were a few parts I made notes about. For example, the paragraph on lines 188-193 was a significant one; the French proved difficult for me, so I resorted to checking the GS schematic. Having no previous experience using that hardware, I took a best guess, and remain uncertain.

I had several French speaking friends which were able to provide enough confidence to eliminate the rest of my notes. One of those conversations was the use of UNCOUP as a label. As best I can tell, it required idiomatic knowledge of French, plus flexibility of understanding context. That was beyond my abilities. As you can see, I translated it as the technically correct but uninspired WHICHONE.

I'd guess Dany would prefer a more UNCOUP-ish English label. Please suggest one!

-Don
Next Topic: NinjaTracker
Goto Forum:
  


Current Time: Wed Feb 05 12:02:01 MST 2025

Total time taken to generate the page: 0.01232 seconds