Top Banner
31

2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

Dec 24, 2015

Download

Documents

Elfrieda Flynn
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.
Page 2: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

2

Outline

• Digital music• The power of FPGA• The “DigitalSynth” project

– Hardware– Software

• Conclusion• Demo

Page 3: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

3

Digital music

• Music has a powerful presence in our culture.

• Instruments have evolved from rocks and bones to digital devices, becoming more and more sophisticated.

Page 4: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

4

Digital music

• Music has a powerful presence in our culture.

• Instruments have evolved from rocks and bones to digital devices, becoming more and more sophisticated.

• Digital instruments have been around for a long time already.

• High performance = high prices?

Page 5: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

5

The power of FPGA

• Newer families of FPGA are both powerful and cheap. But are they suitable for digital instruments?

• The main advantage is that the architecture is easily reconfigurable.

• FPGAs have started to offer most of what expensive chips do:– high speed circuits,– large memory blocks,– multipliers, etc.

Page 6: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

6

The “DigitalSynth” project

• The design is based on two components:

– hardware (the synthesizer with four-note polyphony, capable of applying digital audio effects (delay, echo, reverb, vibrato, flange), capable of playing MIDI files and recording MIDI files),

Page 7: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

7

The “DigitalSynth” project

• The design is based on two components:

– hardware (the synthesizer with four-note polyphony, capable of applying digital audio effects (delay, echo, reverb, vibrato, flange), capable of playing MIDI files and recording MIDI files),

– software (the user interface that handles the MIDI files, displays their music sheet and controls the audio effects).

Page 8: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

8

Block diagram

Page 9: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

9

Oscillator unit

• The design uses oscillators to generate two kinds of waves:

– sawtooth

– square

Page 10: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

10

Oscillator unit

• There are four oscillators. Each of them generates one wave whose type can be selected by the user.

• The amplitude of the generated wave is modulated AM (amplitude modulation) synthesis.

Page 11: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

11

Amplitude modulation

• The ADSR envelope model is used for modulation.

Page 12: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

12

Amplitude modulation

• The attack phase starts when a key is pressed.The decay phase follows.The sustain phase lasts as long as the key is pressed.The release phase starts when the key is released.

• Modulation is realized by multiplying the audio data by the values of the ADSR envelope.

Page 13: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

13

Amplitude modulation

Page 14: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

14

Note selector unit

• There are two sources of control:– the keyboard,– the software application.

• When the user plays a MIDI file on the FPGA board, the software application controls the four oscillators.In the rest of the time, the keyboard controls them.

Page 15: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

15

Keyboard unit

• The design uses 17 keys of the PS/2 keyboard. Pressing a valid combination of one, two, three or four notes will generate an equal number of waves.

Page 16: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

16

Polyphony arbitration

• There are 17 keys and only 4 oscillators, so a polyphony arbitration rule is needed:– if there are more than four keys pressed, the

“excess” of notes will not be rendered,– if one of the four pressed keys is released, then

a new key can be handled.

• By keeping track of the status of the 17 keys, the design determines which notes get to be rendered by the four oscillators.

Page 17: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

17

Polyphony arbitration

Page 18: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

18

USB unit

• The design implements the Digilent Parallel Interface Model.

• The software application controls the wave type, the audio effects parameters and the oscillators during MIDI file playing.

Page 19: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

19

USB unit

• On the software side, USB communication means calling the methods that are defined in the “dpcutil.dll” dynamic library.

• On the hardware side, USB communication needs implementing a parallel communication protocol that uses an 8-bit data bus and strobes.

Page 20: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

20

Audio effects unit

• The design allows applying audio effects such as delay, echo, reverb, vibrato and flange on the sounds generated by the oscillators.

• The design generates audio samples with the frequency of 48 kHz.

• These effects use samples generated at various moments in the past, and for this purpose they use a circular buffer.

Page 21: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

21

Audio effects unit

• Writing in the circular buffer is done with the frequency of 48 kHz.

• Reading is allowed in the rest of the time.

• Writing is done at a certain address which is increased for every new sample of data.

• Reading at various offsets in relation to the write address leads to accessing older data.

Page 22: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

22

Audio effects unit

Page 23: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

23

Audio effects unit

• Audio effects can be represented as a system:

Page 24: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

24

Audio effects unit

• The delay effect requires reading data with a constant delay.

• The echo effect is similar to the delay effect, but its system has feedback, for more depth.(The larger the feedback, the longer the effect is perceived.)

• The reverb effect requires reading several data with constant delays.

Page 25: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

25

Audio effects unit

• The vibrato effect requires reading data with a modulated delay. The modulation can be sinusoidal or triangular. The system outputs only the processed data.

• The flange effect is similar to the vibrato effect, but its system has feedback for more depth, and outputs a mix of the original and the processed data.

Page 26: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

26

SPI unit

• The result of the oscillators is processed by the effect units or it can pass unmodified.

• In order to be output by the speaker, data must be serially sent to the digital-to-analog converter.

• The converter receives the samples and outputs corresponding voltages. The speaker transforms voltage values into sounds.

Page 27: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

27

The software application

• “DigitalSynth” provides a user interface that allows:

– opening format 1 MIDI files and displaying the music sheet,

– playing the MIDI file on the FPGA board,– recording a new MIDI file from the FPGA board,– controlling the audio effects.

Page 28: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

28

The software application

Page 29: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

29

The software application

Page 30: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

30

Conclusion

• FPGA architecture is suitable for digital instruments (and more).

• DSP functions can be easily implemented.

• The Digilent Nexys board offers the possibility to experiment and even innovate.

Page 31: 2 Outline Digital music The power of FPGA The “DigitalSynth” project –Hardware –Software Conclusion Demo.

31