![]() | Logo by Alkaron (anonymous IP: 216.73.216.181,2396) | |||||||||||||
| ||||||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Total files: 4454 Full index file Recent index file
Amigans.net Aminet IntuitionBase Hyperion Entertainment A-Eon Amiga Future
Support the site
|
![]() ![]() ![]() ![]() ![]() ![]() Version A1222Mix FULL A1222mix 53.4 (09/05/2025) ©5.9.2025 Lyle Hazelwood, all rights reserved A simple audio mixer for the A1222+. A1222Mix ? NAME/K,IN=INPORTNAME/K,OUT=OUTPORTNAME/K,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N,P UBSCREEN/K,V=VERBOSE/S: NAME used as window title and CAMD Port ID. Default is name of program INPORT where incoming MIDI messages come from, default WM8776 OUTPORT where outgoing MIDI messages go, default WM8776 LEFTEDGE initial window position, default -1 TOPEDGE initial window position, default -1 WIDTH initial window size, default -1 HEIGHT initial window size, default -1 PUBSCREEN screen to open on, default Workbench VERBOSE dumps details to output as it runs. default FALSE All these startup arguments also work as tooltypes in the tool and project icons. The tool icon is parsed first, then any project icons are parsed after. You can exit the program with the window close gadget, Ctrl-C, BREAK, or by sending a MIDI_RESET message. It's perfectly safe to shut down the computer without closing the program first. Basic: This program provides simple mixing controls for A1222 audio. The first three sliders are Both, Left, and Right analog output level. The next three sliders give you Both, Left, and Right digital output level. The "Both" sliders pull the left and right along with them. Generally you will prefer the analog when possible, as it does not reduce the resolution of the audio signal. But if you need more control, the digitals are available as well. Finally, the last two sliders are the Left and Right levels for audio input. No installation needed, just run the program on your A1222. When the program opens, it will request all the current settings from the audio driver and the sliders will move to the suitable positions. If that's all you're looking for, you can stop here. The rest of this document is optional, and is not required for basic use. I decided to use camd.library as the "linkage" between mixer and the audio driver. Above I described eight sliders, which provide some of the controls that the A1222 sound chip supports. Here's a more detailed description of the way mixer works: When the audio driver starts, it creates a camd cluster named "WM8776". That is the name of the audio chip. The driver then listens for MIDI messages that arrive at that cluster. If it gets a Volume control message for channels 1 through 8, it moves that control to wherever the volume message told it to go. Easy. Channel 1 = Analog Output, BOTH channels Channel 2 = Analog Output, LEFT channel Channel 3 = Analog Output, RIGHT channel Channel 4 = Digital Output, BOTH channels Channel 5 = Digital Output, LEFT channel Channel 6 = Digital Output, RIGHT channel Channel 7 = Audio Input, LEFT channel Channel 8 = Audio Input, RIGHT channel And all eight use MC_VOLUME, which is control change 7. For all of these the control range is 0(silent) to 127(Maximum). The mixer program doesn't need to "hit the hardware" directly, all it needs to know is the name of the cluster, "WM8776", and the details of the message it wants to send. Send that message to that cluster, and the magic happens. We can have multiple programs or devices sending to WM8776, so that we can for instance run multiple copies of the mixer program, and they all have full control. We can also connect external devices, like maybe a MIDI control surface. Something like a Behringer BCF2000 would LOOK like an 8 channel mixer, and it would work exactly like the window does also. Each of these controls, whether a window or actual hardware, can also LISTEN to WM8776, and if it sees anything moving the first eight volume controls, can update the display to show the slider moving. Even the BCF2000 can do this.. You change the volume on the first slider (analog out, Both channels) and you see the first THREE sliders moving together on all connected devices, soft and hard. And we're not limited to windows and external devices. You can monitor controls using a program called "MidiWatch" from camdtools. This will show all the messages flowing through the named cluster. You can create volume changes in scripts using the MidiMsg program from camdtools. So anything the window can do, you can script as well. MidiMsg WM8776 0xB0 0x07 0x7F WM8776 is the name of the cluster (case sensitive, and use quotes if it has any spaces) 0xB0 = Control Change, Channel 1 (or use 176 if you prefer decimal) 0x07 = VOLUME control (or 7 decimal) 0x7F = FULL VOLUME (or 127 decimal) replace 0x7F with 0x00 for silence, all other volumes are in betweeen. MIDI is all about recording and playing back musical performances. So any program that can record and play back can also do that with the mixer controls. You can easily record a track in Bars&Pipes or Horny or any other MIDI sequencer, and when you play it back the mix is fully automated. Cool! Let's get back to the camd tools for a moment. They are all free, can be downloaded from OS4Depot, and most include source code. There's a "basic" mixing board program, was called CamdMixer, the newest version is just CamdMix, that lets you select how many channels, you can label each one, include Pan and/or balance controls, all configurable by command line options or tooltypes. This CAN be used to make a custom mixer for A1222 if you want to. Source is included and is surprisingly simple if you want to dig deeper into programming. CamdMix IN WM8776 OUT WM8776 CHANNELS 8 TUNEREQ is a brief, unlabeled copy of the A1222+Mixer The "TUNEREQ" message asks the driver for all current settings. Labels of your own can be added with the L1 through L8 arguments L1 Analog L2 Left L3 Right L4 Digital L5 Left L6 Right L7 Left In L8 Right In CamdMix IN WM8776 OUT WM8776 CHANNELS 1 FIRSTCHAN 1 TUNEREQ L1 Volume is a single volume slider for the A1222 audio output. Of course you can add LEFTEDGE, TOPEDGE, WIDTH and HEIGHT to control the size and placement of the CamdMix windows. Normal people have already stopped reading, for the rest of us, this gets even deeper: Writing an audio driver can get complicated. Each sound chip has a datasheet that describes everything that chip is capable of, and the goal of an AHI driver is to support JUST the controls in the AHI control window. We have no controls except the "standard window" so the extra stuff gets ignored. So I took the datasheet for the A1222 sound chip. I made a detailed list of every control register, every possible adjustment, every possible setting that this chip can do. I took the eight volume controls that I described above, and I "assigned" them to MIDI VOLUME(CC 7) on channels 1 through 8. These are the most supported controls on MIDI control decks. I added more controls, making them "connect" as close to the standards as possible, eventually having a list of every possible control that the chip has available. Then I write the driver to take ALL CONTROLS from WM8776 though camd.library When I wrote the AHI side of the driver, instead of "hitting the hardware" I simply send MIDI messages for everything. Finally I wrote a "super-Mixer" that lets me SEE and CONTROL every single thing that chip can do. (TaborMixer) You can literally watch the driver configure the chip using a very advanced mixer window. And you can reach in and fiddle with every feature that chip has, also from a window. Or from a script, or from any other source of MIDI messages. I'm NOT saying every control is useful. I AM saying that you can experiment at a level that has never before been "exposed" to a casual user. Of course the eight sliders from the simple window are here. You can also choose multiple audio inputs at once, you can choose any of None, Left, Right, Both for each of the two outputs. You can reverse the phase of each output separately. You can use the chip as a "volume processor" to do basic volume leveling or clipping with fully adjustable parameters. You can power down parts of the chip that are not being used, you can reset the entire chip. You can do a lot of stuff that AHI was never equipped for. This "super" mixer is here, and source is included. and ALL the advantages of MIDI that I mentioned above apply here too. Most of the tools I mention here are included in this archive. Or they will be if I remember.. :) Finally, this MIGHT make a "standard" mixer program possible, since the mixer no longer has to be device specific. Though it CAN be customized to match whatever the next chip coming around requires. The standard AHI control window is no longer good enough. What I am offering here is more "standard" and more "custom", both at the same time. It made a very powerful tool for developing the driver, and it offers the end user the ability to go all the way down to the hardware in a ridiculously easy way. All in I think it's a better way, and it's the way I'll be doing audio drivers from now on. The basic mixer is not 'pretty". But the examples I have provided should open the door for anyone who does "pretty" to make whatever they want. My examples WORK well. The code for CamdMix is as simple and as readable as I can manage. That should be a good starting point for more artistic types to start from. If you're still interested, here are a couple technical references that will help. The sound chip datasheet: Google "WM8776" or try https://www.mouser.com/datasheet/2/76/WM8776_v4.1-1141593.pdf The best MIDI reference website: http://midi.teragonaudio.com/ (especially "Technical docs and programming) My CAMD Tools on OS4Depot https://os4depot.net/share/driver/misc/camdtools.lha If you need a MIDI tool you don't have, ask. I might have made it already. Go have some fun and make beautiful music, Lyle lylehaze()gmail.com #included A1222mix source, exe and doc Stuff/TaborAudio source, exe and doc Stuff/CamdMix source, exe and doc Stuff/MidiWatch source, exe and doc Stuff/MidiSend source, exe and doc |
Copyright © 2004-2025 by Björn Hagström All Rights Reserved |