element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi-Fest
  • Challenges & Projects
  • Design Challenges
  • Pi-Fest
  • More
  • Cancel
Pi-Fest
Blog It Came From The Synth - Mystery Melody Medley 1
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dougw
  • Date Created: 10 Jul 2022 6:52 PM Date Created
  • Views 2528 views
  • Likes 9 likes
  • Comments 6 comments
  • doug wong
  • raspberry pi pico
  • AY-3-8910
  • pi-fest
  • MIDI synthesizer
  • pi pico
Related
Recommended

It Came From The Synth - Mystery Melody Medley 1

dougw
dougw
10 Jul 2022

Intro
This Pi-Fest music technology Design Challenge project attempts to add interest to the blogs by including interactive elements for the audience. This involves challenging you to identify the mystery music in each blog, created of course by the project hardware itself.
My mission is to design and build a Raspberry Pi Pico MIDI synthesizer. This is part of a bigger plan to build up a capability to create rudimentary amateur music that I can embed in my blogs. One of the main reasons for this is the morbid focus in the music industry to extract fees from anyone who wants to play an excerpt of copywrite material. In sharp contrast to the electronics industry where there are any number of free circuits available. But enough with the soapbox, I want just do my own thing without worrying about draconian copywrite police bots and their vendettas.
Your mission, should you choose to accept it, is to identify the songs played by the synthesizer in the videos embedded at the end of each blog.
There is also a technical "Mission Impossible" in blog 3, should you choose to accept it.
Here is a simplified block diagram of the PICO MIDI Synthesizer System:

image

Conceptually the PICO Synthesizer simply translates MIDI data in real time into programmable sound generator (PSG) data and then the PSGs translate that data into audio that is played by speakers. In this project I will design a printed circuit card to implement this block diagram.

Programmable Sound Generators
The real magic happens in the programmable sound generator chips, so I will briefly describe some of their capabilities without bogging the blog down with register programming minutiae. The programmable sound generator (PSG) chips in this system each have three simultaneous digital-to-analog sound outputs. Each output has a mixer that can mix an optional tone generator with an optional noise generator and the result can be modulated by a programmable envelope shape. Add in the amplitude controls and you have a pretty flexible sound system capable of generating very complex waveforms, especially if all 3 outputs are added together. In this project I am only trying to generate musical notes, but the PSG chips are capable of a much wider range of sound effects. There are 16 memory-mapped registers that control all parameters, allowing sounds to be generated while the processor is busy doing other tasks. The registers only need to be updated when the sound parameters need to change.
As mentioned the system I am designing here takes standard MIDI (Musical Instrument Digital Interface) serial data and converts it to music coming from speakers. The Raspberry Pi Pico interprets serial MIDI data and generates appropriate PSG sound parameters, which it loads into the PSGs at the appropriate time. The basic components needed are listed below:

  • Optically isolated MIDI receiver
  • Raspberry Pi PICO
  • Two AY-3-8910 Programmable Sound Generators
  • PAM8403 stereo audio amplifier
  • A custom enclosure

Schematic Diagram
The components are decided, now we need a schematic.
I have been messing around with AY-3-8910 programmable sound generator chips recently using arduinos, but the programs are right at the limit of their available memory and I actually needed to perform a code reduction exercise to get the program to fit. The Pico has far more memory and is a much faster MCU, so all of those issues go away. However there are some features of the Pico that prevent a direct import of my arduino code.
The serial ports are different, the counter timers are different and the pinout is different, so I needed to work through those differences.
My big thing is designing PCBs for projects like this, and also 3D printed cases.
The circuit connects 2 synthesizer chips to the Pico which allows 6 sounds to be played at the same time. All sounds are combined in an audio amplifier that can drive large speakers.
Here is the schematic:

image

The PSGs are 5 volt NMOS while the PICO is 3.3 volt CMOS, so we need to ensure we are driving and receiving signals at valid voltages. The AY-3-8910 data sheet indicates it sees a logical "0" when the voltage is below 0.6 volts and a logical "1" when the voltage is above 2.4 volts. The PICO drives these logic levels with excellent margin even when its own supply is 3.3 volts. Since I am only sending data to the PSGs, I don't need to worry about how high the PSG can drive its output pins, even though they would likely work with the PICO.
The MIDI signal is also often 5 volts, but the optical isolator allows any MIDI voltage to be translated to the PICO's internal 3.3 volt levels.
All six (1 volt each) analog outputs from the PSGs are summed together before the audio amplifier is used to increase the signal power so it can drive low impedance speakers.
There are 4 optional switches that allow more features to be controlled in future firmware expansions.

Mystery Music Medley 1

Now here is the first Mystery Music video - a medley of MIDI music snippets played by the PICO Synthesizer to see if they are recognizable enough for you to identify:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Conclusion & Discussion of this Blog
This project was started months ago, but suffered from many delays and issues, which I hate to dwell on. These have forced some adjustments but I am happy to finally have a system working and be working through the blogs for this design challenge. I am making an effort to keep the blog content simple. this is always a goal, but ironically sometimes it takes more effort to make things simple. This schematic works however I did add an external oscillator at R1. This will be discussed further in blog 3.
The project will have 5 blogs:

  1. Introduction and circuit schematic description
  2. PCB layout and manufacturing
  3. Firmware and issues
  4. Mechanical enclosure design and features
  5. Project summary and discussion

Each blog will include a Mystery Music Medley.

Relevant Links:
Blog 1 - Introduction and circuit schematic description
Blog 2 - PCB layout and manufacturing
Blog 3 - Firmware and issues
Blog 4 - Mechanical enclosure design and features
Blog 5 - Project summary and discussion
Pi-Fest Music Contest page
AY-3-8910 Datasheet
Dual Synth link

  • Sign in to reply
Parents
  • alisterw
    alisterw over 2 years ago

    I have two or three unused AY-3-8910 ICs that I bought a long time ago to make an electronic organ pedalboard synth. But they have stayed in their anti-static tubes. You should be able to get a decent 1MHz clock from the Pico's PIO. If I get idle I will give it a go.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • alisterw
    alisterw over 2 years ago

    I have two or three unused AY-3-8910 ICs that I bought a long time ago to make an electronic organ pedalboard synth. But they have stayed in their anti-static tubes. You should be able to get a decent 1MHz clock from the Pico's PIO. If I get idle I will give it a go.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube