Rybags Posted October 19, 2011 Share Posted October 19, 2011 I think the trick there is to capture the audio with a soundcard while playing back something simple like a triangle or saw - trial and error with the voice mixing, then work out what works best. Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 20, 2011 Author Share Posted October 20, 2011 Yeah, I need to do that again. The last time I did that I ran into some difficulties because there are a bunch of components with different time constants in the audio path, some long and some short, which makes it tricky to model the output. I should probably try some frequency sweeps this time. I tried analyzing the schematic once, but soon discovered that reading The Art of Electronics is not sufficient for that. By the way, a version of the emu with disk fixes: http://www.virtualdub.org/beta/Altirra-2.00-test45.zip http://www.virtualdub.org/beta/Altirra-2.00-test45-src.zip Quote Link to comment Share on other sites More sharing options...
serj Posted October 20, 2011 Share Posted October 20, 2011 Thanks for updating of Avery. Tell it last test build or will be still? Simply working out of 2.0 versions was tightened for very long time, more than five months. Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 26, 2011 Author Share Posted October 26, 2011 I managed to squeeze a fourth channel into the IRQ routine through a really bad phase update hack, basically updating the 16-bit accumulators round robin. This mixer interrupt executes in 87 cycles and so there's about 20 cycles per scan line (~17% CPU) remaining for mainline. The downside is that the waveform bank is now 8K and almost all of page zero is occupied by code. But hey, it's not like there's much CPU time to do much else. The decreased volume required for mixing four channels brings per-channel precision down to about 4.5 bits, although I could probably spare the 7 cycles per sample for compression again. As I have no musical talent, this is part of a MIDI tune from an old DOS game. quadchan.zip 1 Quote Link to comment Share on other sites More sharing options...
MaPa Posted October 26, 2011 Share Posted October 26, 2011 Wonderful ! Is it possible to have other instruments too? Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 26, 2011 Author Share Posted October 26, 2011 (edited) Yes, if you can cram them into the limited wavetable engine. Each channel references a 256 byte waveform that is repeated 2x in a 512 byte buffer; the per-channel volume is implemented by switching to one of 16 prescaled waveforms. Currently there's only one "instrument," although the tick routine could switch waveforms. The round-robin hack also introduces a slight amount of phase jitter (+/1/256). In this case it's not noticeable as the instrument is just a sine wave with a few low harmonics. Square wave, sine wave, and triangle should be trivial. The ADSR generators are much more relaxed as they run at 123Hz (every 128 scanlines) on an internal 8-bit volume with four ramps, a sustain level, and a gate bit (like SID). In this version, I just locked the four MIDI channel onto one playback channel each and hardcoded the low two and high two channels to have fixed ADSR envelopes. I raised the attack and decay rates on the non-bass channels to get more staccato notes. The profiler says that there is 20% of the CPU available, which should be plenty to multiplex both the waveform selection and the ADSR envelopes if there are more tracks or instruments than channels. Edited October 26, 2011 by phaeron Quote Link to comment Share on other sites More sharing options...
+MrFish Posted October 27, 2011 Share Posted October 27, 2011 Quite impressive. It's also nice to hear some music come out of the Atari that isn't in the popular blaring style. Quote Link to comment Share on other sites More sharing options...
andym00 Posted February 20, 2012 Share Posted February 20, 2012 That technique sounds really nice, especially if you stabilise the IRQ with a wsync as well, which gets you stable with the screen on.. Great idea Just a shame it takes the entire Pokey to achieve this.. (null) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.