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
Programmable Logic
  • Challenges & Projects
  • Project14
  • Programmable Logic
  • More
  • Cancel
Programmable Logic
Blog Vidor's Toccata
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Programmable Logic to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: alisterw
  • Date Created: 25 May 2019 12:06 PM Date Created
  • Views 1655 views
  • Likes 12 likes
  • Comments 9 comments
  • programmablelogicch
  • mkr_vidor
  • arduino vidor 4000
Related
Recommended

Vidor's Toccata

alisterw
alisterw
25 May 2019

Please excuse the dreadful joke!

 

Something I have been trying to build for the last N years, where N is >0x30, is to build an electronic organ. Every time I start building something, technology moves on. The first attempt uses a top octave generator IC followed by loads of divider IC, and keying was done by a shed-load of SN74L00N quad NAND gates. Sadly they leaked  some audio when supposed to be off.

 

I see someone has built an organ tuner for his Trio electronic theatre organ ( an excellent project!). That uses two free-phase oscillators per note, so you can get beat notes when things are very slightly out of tune, and this is often considered a good thing. Organ music can sound a bit dull if everything is spot on; those beat notes give an added dimension.

 

I also have an organ console, but this is much smaller. It is a Riha Allegro, and probably made around 1970; sadly there is very little information available. Each key has about 6 contacts, one per octave, and that is its main problem: the contacts are now very unreliable.

 

This project will use an Arduino Vidor 4000  and some digital-to-analogue converters, type and quantity so far undecided.

 

The master plan is to take in MIDI serial data commands. Many people convert their organ console over to MIDI and that in itself would make a nice FPGA project using the cheap Cyclone II boards available with 0.1-inch pins such that all 65 notes could be fed into the FPGA ( one per manual ) and the output would of course be MIDI data. This technique of DC keying avoids one diode per key when multiplexing and all that EMC noise generation of high rise time signals emitted from the long cables.

 

My last organ attempt used a dsPIC30F6014 if I remember correctly. It used the DSP section to generate sine waves. These could be added together in variable proportions to give a note its tonal quality. That was reasonably successful as it could generate 60 sine waves simultaneously. But that is not really enough. 60 sine waves allows 10 keys to be pressed and each key could have a fundamental tone plus 5 harmonics. But pipe organs are far more complicated. In order to change volume, either a selection of pipes would be enclosed in a box with shutters that could open and close, or more pipes could be used by pulling out more stops. Then there are stops which are octave couplers, which play an octave above, and mixtures, which can play 4 or 5 extra pipes for each note pressed by the organist. Net result is probably 1,000 sine waves would be a good place to start, to properly emulate a large pipe organ.

 

I think an FPGA would not have any trouble achieving this number of simultaneous sine waves.

 

Each sine wave  has its own frequency value and would be generated as a numerically-controlled oscillator using the FPGA's multipliers/accumulators. An FPGA has many of these so the workload can be shared out. The frequency table therefore allows all notes to be just a tad off their ideal frequency, and also the ability to change tuning scale from equal temperament to anything else is very easily done. In fact it would be simple to generate both sine and square waves so our friend with the Trio could feed those signals into the analogue filter circuitry and get the same audio output but with zero tuning hassle!

 

Generating all the sine waves and adding up harmonically-related ones to generate the correct tone only achieves a steady-state correlation with a real organ pipe. What is missing are the interesting bits when air is first fed into the pipe and the sound coming out varies dynamically. This can probably be simulated by generating white noise in a shift register and then filtering that with digital filters ( FIR or IIR) whose parameters could vary as a function of time.

 

Real pipe organs have each rank of pipes carefully ordered such that two pipes of similar frequency are not physically placed together, because they can act like couple tuned circuits. So this FPGA organ will need multiple loud-speakers and hence multiple analogue output channels, to achieve the same effect of sound coming from different directions for each note. How many loud-speakers? Answer: as many as possible!

Attachments:
image
  • Sign in to reply

Top Comments

  • alisterw
    alisterw over 6 years ago +1
    Hi Dubbie, Thanks for those excellent comments. Building a real organ pipe must be quite a challenge, especially if you want it to sound correctly. Unfortunately I do not have a large enough room for a…
  • alisterw
    alisterw over 6 years ago +1
    That raises an interesting point: will this kind of project fit into the Vidor 4000? My initial thoughts were to use the built-in multipliers. In terms of bare metals, the Cyclone 10 10CL016 has 15,408…
  • alisterw
    alisterw over 6 years ago +1
    Day 16085. Further thoughts: the clock seems to be 48MHz. If we use an audio sampling rate of say 48kHz ( DAT-Digital Audio Tape ) then we could if we really wanted use one 32-bit NCO if it had zero latency…
  • alisterw
    alisterw over 6 years ago

    I was unable to attach the block diagram- illegal file type or some such message, so I took the PDF file and stuck it into Paint then printed as JPEG. Not ideal...Bottom bit is first...imageimage

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

    Project day 16086.

    Here is a block diagram of the system. It is a 1024-channel stereo sine wave generator. However I have not wired up the inputs, outputs or clocks and one or two other bits.

    Also I have not yet worked out how to add two 10-bit data address generator block for the multiplexed NCO. The subtlety is that the second DAG needs to count 7 behind the other one, as 7 is apparently the latency of the MAC.

    If anyone can assist I would appreciate it!

    It assumes the NCO can run in one cycle. The NCO is multiplexed over 1024 channels. A sine look-up table converts the top part of each NCO output to a sine wave. The sine wave is multiplied by the left gain for that channel and accumulated.

    Same goes for the right stereo channel.

    After 1024 accumulates the left and right accumulators need to be cleared, which again is something left off.

    Everything is pipelined and each block should run in one clock cycle.

    It should be easy to copy this block N times until we either run out of silicon or get to 8,000 channels, which should be enough!

    That is if it fits of course...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • alisterw
    alisterw over 6 years ago

    Day 16085.

    Further thoughts: the clock seems to be 48MHz. If we use an audio sampling rate of say 48kHz ( DAT-Digital Audio Tape ) then we could if we really wanted use one 32-bit NCO if it had zero latency and could do the MAC (multiply and accumulate) operation in one cycle. The 32-bit phase and accumulator registers would each consist of 1,000 word blocks of RAM sequentially addressed by a data address generator. That storage is 32 x 1,000 x 2 = 64,000 bits and is well within the 504kbits available. So the question is how many clock cycles are needed to perform the MAC.

    Needless to say, these are approximate figures and reducing the audio sampling rate to 44.1kHz (CD-Compact Disc) would allow us to use a nicer number of 1024 for our blocks of registers, assuming single-cycle MAC performance.

    If it takes say 3 clock cycles for each MAC, then we simply use more MAC units as we could have 28 36x36 multipliers.

     

    I don't really need a multiplier unit to simply add a phase resister to an accumulator register, but in the world of DSP you tend to get given a MAC in the silicon and can use the coefficient of 1 as the 'other' input.

     

    But the FPGA designers are far brighter than me and they can offer soft multipliers that probably do exactly what I need. So I had better investigate the MegaWizard and see what things like altmemmult will do.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • alisterw
    alisterw over 6 years ago

    That raises an interesting point: will this kind of project fit into the Vidor 4000?

    My initial thoughts were to use the built-in multipliers. In terms of bare metals, the Cyclone 10 10CL016 has 15,408 logic elements, 504Kb of memory and 56 18x18 multipliers. The multipliers can be split into 2 9X9 or cascaded. A 32-bit NCO is required to get a frequency resolution of well under 1Hz, so first question is how to cascade two multipliers to get a 36-bit width, and does it require two or four 18x18 units?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • alisterw
    alisterw over 6 years ago

    Hi Dubbie,

    Thanks for those excellent comments. Building a real organ pipe must be quite a challenge, especially if you want it to sound correctly. Unfortunately I do not have a large enough room for a large pipe organ but I guess one of the portative organs would fit.

    As to the Lincolnshire organ, you are quite correct that large organs can have over 10,000 pipes easily, and synthesizing each pipe with say 8 sine waves would require 80,000 NCOs all running together.

    I have done the design slightly differently in that the maximum number of pipes likely to be played at a given moment will be far less than that.

    Say an organist uses 10 fingers and 2 feet, and each foot could press two pedals, then that gives 14 notes. If all the stops are pulled out, and say there are 20 speaking stops that gives 280 pipes sounding. Then there could be an octave coupler which could double that to 560 and finally there could be keyboard couplers which could double it again to 1,000-ish. Of course, that is a gross over-simplification, but is likely to be in the right sort of order of magnitude.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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