Author |
Message |
Thomas_Henry
Joined: Jul 24, 2009 Posts: 170 Location: N. Mankato, MN
Audio files: 3
|
Posted: Thu Jun 28, 2012 2:32 pm Post subject:
|
|
|
Oh, more thing. I gather that Yamaha also put out a version of the chip but with double the resolution on the envelope. Same pinout though. I wonder if we should follow up on that part.
Thomas Henry |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
|
Back to top
|
|
|
Thomas_Henry
Joined: Jul 24, 2009 Posts: 170 Location: N. Mankato, MN
Audio files: 3
|
Posted: Thu Jun 28, 2012 5:46 pm Post subject:
|
|
|
Hiya THeff,
So, I gather you think the envelope is a bit dodgy, too?
Thanks a ton for the link. I went ahead and ordered some myself.
Anyway, all is not lost for several reasons:
1. I learned a lot of new things about the Picaxe 28X2 and am in fact at this very moment designing a couple new MIDI things using that new knowledge.
2. The AY can probably still be shaped into something useable, just not with the envelope generator.
3. For that matter, even if a person ignored the sound stuff, the two IO ports will probably prove useful for something later. It certainly wasn't money wasted.
4. Maybe this Yamaha rendition will turn out fine.
I'll give your code a try with my one (!) good chip.
Thanks again,
Thomas Henry |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Thu Jun 28, 2012 6:31 pm Post subject:
|
|
|
Yamaha chip order placed and fingers crossed Thanks for the source, THeff...I bet they're going to wonder about the spike in business.
No headway to be made tonight or I will get myself into trouble |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
Posted: Thu Jun 28, 2012 8:01 pm Post subject:
|
|
|
Glad you were both able to get in on the Yamaha chips, their stock was limited.
Seems like somebody took BG Micro for a ride on the 60 AY chips they got.
It's weird that my 1982 chips work fine and the newer ones are the bad ones. I thought they stopped making them way before 2004. Seems like they still "don't make um like they use to"
Thomas,
Thanks for the AY-Voice concept and firmware so far! I have enjoyed learning the PicAxe as well. I look forward to the midi stuff that you have in mind.
I'm sure it will be unique and cool like all of your EM designs past and present.
elmegil,
I'm sure you are right about the spike in YM2149 sales. They are probably trying to find more as we speak.
Regards,
-THeff |
|
Back to top
|
|
|
Thomas_Henry
Joined: Jul 24, 2009 Posts: 170 Location: N. Mankato, MN
Audio files: 3
|
Posted: Thu Jun 28, 2012 10:02 pm Post subject:
|
|
|
Hi all,
I ran a few more careful tests on the 5 chips I have (1 from three years ago, four of this week). Here are the results:
---the tones work in all
---the noise generator works in two (both new)
---one has a very bad S/N ratio when either tones or noise are on
---two fail to drive the LCD; faulty Port IOB, I guess
---the envelope stinks in all (bad clicking).
Only one of five works from top to bottom.
This ain't the touchstone, methinks. Anyone up for interfacing the SN76477 with the Picaxe 28X2 via a DAC?
Thomas Henry |
|
Back to top
|
|
|
theglyph
Joined: Aug 15, 2008 Posts: 31 Location: Jachsonville, FL
|
Posted: Fri Jun 29, 2012 1:34 am Post subject:
|
|
|
I've got 10 AY chips from BGMicro so I'll test all and as long as I get one fully functional I'll send any extra to all who need one! Please PM me if you're looking for a solid AY! |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
Posted: Fri Jun 29, 2012 4:55 am Post subject:
|
|
|
Hi Thomas,
I noticed that the YM2149 chip has a SEL pin 26 that allows for master clk/2, so you can use a 4 MHz clk if you want. SEL = High - normal AY-3-8910 mode, SEL = Low - sets clk/2.
I would definitely be interested in interfacing the SN76477 with the Picaxe 28X2 via a DAC. Microchip makes a great little dual 12 bit DAC, MCP4822 with a SPI interface for about $3 bucks. Why not put the YM2149 and the SN76477 together. Then you could have chord generation, VCO, LFO, tuneable noise, etc., etc.
http://www.acxsynth.com/midi2cv/midi2cvfr.htm
ACXsynth uses the MCP4822 for MIDI2CV adapters and they work very. I built both the 2 channel and the 4 channel.
Regards,
-THeff |
|
Back to top
|
|
|
Mongo1
Joined: Aug 11, 2011 Posts: 411 Location: Raleigh NC
|
Posted: Fri Jun 29, 2012 7:57 am Post subject:
|
|
|
I hadn't gotten a chance to chime in on this til now.
Way back in the old days when I had my trusty Apple II+, I managed to get 3 of the AY chips, and slap them in a prototype card I could control with my apple. It was pretty frustrating - I could get the tones, but as you guys have discovered, the envelope control makes the final result pretty non-musical.
I think with variety of embedded processors available today you could really do a whole lot better than spending time with the AY - just do everything in software and dump the results to a 10 or 12 bit DAC.
Vintage and obsolete aren't always the same thing .
Gary |
|
Back to top
|
|
|
sompost
Joined: Aug 17, 2010 Posts: 58 Location: Switzerland
|
Posted: Fri Jun 29, 2012 8:16 am Post subject:
|
|
|
According to the Wikipedia page on the AY-3-8910 the chip does indeed have that vintage sound known from 80s arcade game consoles (cf. sound sample on Wikipedia). Do your chips sound worse than that or did you expect something different?
I bought 3 AY-3-8910A (0047 CBY, US$ 6 apiece at arcadechips.com) when I first heard about the AY voice, so I was looking forward to this project. But I'm also on board if you choose to switch to a different, better chip. It's a cool project so far, and while I haven't built the board yet (being a slow board designer/solderer) I actually do read the code!
BTW, I also have 2 MOS Technology 8580 SID chips in my drawer, and if you believe this, those are real rockers ... _________________ Built: MFOS SLMS plus, SL Ultimate & Expander, 10 step seq; SLMS MkII; PAiA FatMan, Mutable-Instruments Shruthi-1; Jasper Wasp Clone
Building: Maddox MonoWave; Auduino; ASM-2; Minimoog Clone
Backlogging: MFOS 16 step seq; TH SN Voice; Takeda One Board Farm; Okita Vocoder; Page TR-9090; TH GM Voice, AY Voice |
|
Back to top
|
|
|
Thomas_Henry
Joined: Jul 24, 2009 Posts: 170 Location: N. Mankato, MN
Audio files: 3
|
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Fri Jun 29, 2012 5:58 pm Post subject:
|
|
|
I'm game, and I've done MIDI stuff before, but I'm still fighting with my hardware. |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Fri Jun 29, 2012 9:09 pm Post subject:
|
|
|
I debated trying to code the other MIDI bits blind, but I figured unless no one else is willing to take a stab at it, that would probably be a bad thing, given that I don't have enough HW working to do any real testing (I've gone backwards, and the LCD which was working isn't any longer). |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
Posted: Sat Jun 30, 2012 3:48 am Post subject:
|
|
|
Hey Thomas,
The menu/navigation system works great! Man that is quite a chunk of code!
I heard back from Billy at BG Micro and he was very apologetic about the defective chips. He has pulled them from the sight and said we could return them if we wanted to. He was very surprised and said that he has been selling this same date code chip for the last five years...weird huh?
I guess GI had a real process problem when they made this batch of chips.
elmegil,
Your note table looks good, but it actually starts with C0, which is MIDI note #12, 16.35 Hz. So all of your table addresses need to be shifted down by one octave.
I wonder if your LCD problem is because of a funky I/O port on the AY chip?
While you are trouble shooting you can at least use the SerTxd( ) and send the data to the PC terminal.
BTW, I just got laid off from my job of 4 years at Foxconn on Friday morning, so I am not sure how much I will be on here for a while.
Regards,
-THeff |
|
Back to top
|
|
|
sompost
Joined: Aug 17, 2010 Posts: 58 Location: Switzerland
|
Posted: Sat Jun 30, 2012 5:12 am Post subject:
|
|
|
Here's a sketch of a MIDI processing subroutine. It is to be called for each byte received on the MIDI channel. It will assemble the required bytes and then call a handler for each message recognised. It handles only channel messages.
These are the assumptions:
1. Real time messages can be received anytime, even within other messages. They don't reset running status.
2. System common messages do reset running status. I don't process system common messages here. Data bytes (e.g. of a sysex dump) are simply ignored until the next valid channel message arrives.
I have not tested it, because I lack equipment, and the syntax is likely spurious.
Code: |
;*************************************************************
;* *
;* Process MIDI byte *
;* Input parameters: byte *
;* Static variables: status (must be=0 at startup), data, byte0 *
;* Local variables: temp *
;* *
;*************************************************************
symbol MIDI_NOTEOFF = %10000000
symbol MIDI_NOTEON = %10010000
symbol MIDI_PAT = %10100000
symbol MIDI_CTRLCHG = %10110000
symbol MIDI_PGM = %11000000
symbol MIDI_CAT = %11010000
symbol MIDI_MODWHL = %11100000
process_midi:
if byte >= %10000000 then ;status byte
if byte >= %11110000 then ;system common
if byte >= %11111000 then goto sys_rt
;all other system common msgs, including sysex
status = 0 ;reset running status
else ;channel message
status = byte
;check channel, if not ours set status = 0
data = 0
endif
else ;data byte
if status > 0 then ;status sent or valid running status
temp = status & %11110000
;the following messages require 1 data byte, which we just got
if temp = MIDI_PGM goto prog_change
if temp = MIDI_CAT goto chan_atouch
;the following messages require 2 data bytes
if data = 0 then ;we need another one
byte0 = byte
data = 1
else
data = 0
if temp = MIDI_NOTEON goto note_on
if temp = MIDI_NOTEOFF goto note_off
if temp = MIDI_CTRLCHG goto control_change
if temp = MIDI_MODWHL goto mod_wheel
if temp = MIDI_PAT goto poly_atouch
endif
;else ignore
end
endif
return
note_on:
;note=byte0, vel=byte
if byte = 0 goto note_off
;process note on here
return
note_off:
;note=byte0, vel=byte
;process note off here
return
;unhandled MIDI msgs (fill-in as appropriate)
poly_atouch:
;note=byte0, value=byte
control_change:
;control=byte0, value=byte
mod_wheel:
;lsb=byte0, msb=byte
return
prog_change:
;prog=byte
chan_atouch:
;value=byte
sys_rt:
;msg=byte
return
|
_________________ Built: MFOS SLMS plus, SL Ultimate & Expander, 10 step seq; SLMS MkII; PAiA FatMan, Mutable-Instruments Shruthi-1; Jasper Wasp Clone
Building: Maddox MonoWave; Auduino; ASM-2; Minimoog Clone
Backlogging: MFOS 16 step seq; TH SN Voice; Takeda One Board Farm; Okita Vocoder; Page TR-9090; TH GM Voice, AY Voice Last edited by sompost on Sat Jun 30, 2012 9:29 am; edited 1 time in total |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
|
Back to top
|
|
|
Thomas_Henry
Joined: Jul 24, 2009 Posts: 170 Location: N. Mankato, MN
Audio files: 3
|
Posted: Sat Jun 30, 2012 12:19 pm Post subject:
|
|
|
Hello all,
Here are a few random comments on the recent posts.
The chip should work down to B0. If you check the MSB below this you'll see it exceeds the required four bits. I elected to start things at C1 just to start on a C like a typical keyboard might, but include B0 if you want.
On the high end I decided to stop a B9 just to have 9 complete octaves. By this time the MSB has been zero for quite a while and the LSB doesn't allow much wiggle room for accuracy. (See the chart I posted earlier for the divisors). In fact, the tuning is pretty bad from C6 on up.
So C1 to B9 seems like a reasonable scale.
I think the data sheet for the Yamaha chip is inconsistent. The divide-by-two feature could add one more useful octave, but it's unclear to me the chip really can handle a 4 MHz clock. Look at the first spec on page 10. Now if it said when !SEL is low, then I'd believe it. But with our current 2 MHz clock, we could get a very accurate C0-B0, supposing anyone could hear it! (Feel it might be a better phrase).
I haven't checked to see if the Picaxe can put out an accurate 4 MHz clock on the PWM pin. That might be pushing it, for all I know. But the 2 MHz one sure is accurate.
For anyone having trouble getting the LCD going, THeff's comment should be kept in mind. Out of my five AY chips, two had defective ports. Did I mention that in one of the chips, absolutely nothing worked properly?
Some twenty years ago I bought 1000 NOS Reticon SAD-4096 analog delay chips for a pretty penny. After testing, only around a dozen worked!
The MIDI code is most welcome. I like the fact it implemented without subroutines, believe it or not. The Picaxe has a limited stack (8 deep if I recall), so we need to keep the calls-to-calls under control. But more importantly, even with a 64 MHz clock I worry a little bit out the speed. In-line code with lots of gotos will probably be faster, even if harder for humans to follow.
Keep up the good work gents!
Thomas Henry |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Sat Jun 30, 2012 10:24 pm Post subject:
|
|
|
Unfortunately it seems that my ancient Keyspan USA-19HS (High Speed, HA!) is not liking 76800 baud with the MAC drivers (even the latest ones available). Since that is a fixed rate (from what I can tell of the PICAXE Docs), I'm pretty well out of luck there too, in the short run at least. The Keyspan docs aren't 100% clear, but everything I can find online implies that it tops out at 57600. Even when I try using other serial programs (the MACAXEPad terminal tops out at 38400, but I can use other built in utilities to watch the port), I get nothing but gibberish, even when explicitly specifying 76800,8n1.
Another day I will resume trying to work with the sparkfun adapter.... I have another headphone adapter so I think I will try to wire it with the termination we were discussing and no 22K resistor and see where I can get that to go.
Another alternative is to boot windows; I have a couple different virtual machines available, or worse comes to worse I can boot windows in bootcamp (set up already for other software that doesn't play nice). So I'll get there...it's just the long way around right now.
As Douglas Adams said, Technology is stuff that doesn't work yet. |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Sun Jul 01, 2012 10:09 pm Post subject:
|
|
|
The russian stacking dolls of impediments to moving forward just keep getting deeper. Have had no success yet getting an environment set up that I can actually view the debug info, and my second AY chip appears to have deteriorated further. More are on their way, as well as the Yamaha chips.
I'm stubborn, so I will keep beating on this until something happens |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
Posted: Mon Jul 02, 2012 12:06 pm Post subject:
YM2149 sub for AY-3-8910 |
|
|
I got a couple of the YM2149 Yamaha chips today and plugged them into the perfboard. The I/O ports work, meaning the LCD and Gates, but there is no audio, tones or noise. I figure it is probably a subtle setup change that is needed between the YM & AY, but not sure.
Looking at the two datasheets I don't seen any differences yet.
-THeff |
|
Back to top
|
|
|
THeff
Joined: Sep 01, 2006 Posts: 229 Location: Florida
Audio files: 33
|
Posted: Mon Jul 02, 2012 5:21 pm Post subject:
DON'T SEND YOUR AY-3-8910 CHIPS BACK! |
|
|
I played around with the new date code AY-3-8910 chips and found out that they are NOT BAD after all.
I connected the Reset pin of the AY chip to pin 17 of the PicAxe and sent it a reset pulse after power up and the noise works fine on all four of my 0426 chips.
After that I connected a pullup (1.8k) resistor and a (4.7 uF) capacitor to the reset pin and that works too. Just putting a pullup resistor will not work. Apparently it wants a solid reset after power up.
I still have not been able to get any sound out of the Yamaha chips. I don't think they are bad. I think it is going to be a programming sequence/timing issue. I played around with the Reset just like the AY, and also the BDIR pulse width, but neither gave me sound.
THeff |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Mon Jul 02, 2012 7:03 pm Post subject:
|
|
|
Well....this is quite interesting.... I now have debug data. However, it's not what I expected it to be/how I expected it to be. Just to document my journey, in case anyone else gets into the same space...
I went back to my original Windows XP virtual machine (VM), uninstalled the drivers, and ran a utility called "CCleaner" to clean up the registry. It took several tries before it ran clean. I was not able to use the AXE027 drivers, because the SparkFun board identifies itself differently, so i was back to using the FTDI drivers.
I plugged in the board, installed the standard FTDI drivers, and then I followed the instructions on this page:
http://sourceforge.net/projects/bacnet/forums/forum/402140/topic/4595380
With regard to changing the registry settings.
HOWEVER
Selecting 300 baud (per those instructions) still did not work, and selecting 76800 did not work either. Initially (before the registry change) selecting 76800 would complain that I needed to use the AXE027 drivers to get non-standard baud rates. AFTER the change, it would allow me to select that value, but I was still getting gibberish.
I tried all the other standard baudrates, and anything beyond 600baud was getting me output, just not the output I expected.
I figured I'd try all the "Non-standard (AXE027 only)" baud rates as well, and I found that 48000 IS working and showing me the output in normal text.
Honestly, I have NO idea why this would be the case, but I'm pleased that I have successful serial debug output, so I'm not going to look the gift horse too closely.
Edited for clarity.... |
|
Back to top
|
|
|
elmegil
Joined: Mar 20, 2012 Posts: 2177 Location: Chicago
Audio files: 16
|
Posted: Mon Jul 02, 2012 10:29 pm Post subject:
|
|
|
Well, we have an explanation for that.
i had the wrong resonator in... So in addition to the serial port being off (and that makes sense; a 4MHz clock gives 4800 baud, so of course 10 x 4 = 40MHz clock gives 48000 baud), my MIDI input was seriously off.
I was led here because I was seeing 2 bytes fo any given MIDI key event rather than 3. As I started to write about what was going on, it occurred to me that a slow clock would do this; I had been switching resonators when I was doing early-mode testing and so I picked up the one sitting on the bench and sure enough it was the 16, not the 10. |
|
Back to top
|
|
|
|