electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
FPGA 2-OP FM Polysynth
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 2 [27 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Tue Apr 28, 2009 5:04 pm    Post subject: FPGA 2-OP FM Polysynth Reply with quote  Mark this post and the followings unread

This project was inspired by work done by good friend Eric Brombaugh who helped me understand the basics of FM synthesis and whose own 2-OP FM project pushed me over the edge.

I've just finished a proof of concept design of an 8 voice 2 operator FM MIDI polysynth implemented on an FPGA.

The structure is 4 2-OP FM sound generators per voice (for a total of 64 oscillators).

EDIT ADD: As such, the design is really an 8 operator synth with a fixed 4 x 2-op structure.

Sample rate is approximately 65 KHz.

The next major phase of this design is to go to 16 voices of polyphony.

I've attached a wav file of some notes played with a patch I threw together of synth bells.


8vFM-2x4_synth_bell.wav
 Description:
Sample of Synth Bells done with 8vFM-2x4

Download
 Filename:  8vFM-2x4_synth_bell.wav
 Filesize:  1.66 MB
 Downloaded:  421 Time(s)


_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima

Last edited by JovianPyx on Sat Jul 04, 2009 4:29 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
jksuperstar



Joined: Aug 20, 2004
Posts: 2486
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Wed Apr 29, 2009 6:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Scott, this is really sweet. I've been trying to set enough time aside to play with these on Spartan IIELC or Virtex 4 boards that I have around, as well as revive some old things I had been working on, and always thinking about Wink Thanks for keeping that memory awake, and not too distant!
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Wed Apr 29, 2009 6:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey JK, Use that board! Cool

And here's a write up:

http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.8vFM-2x4

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Thu Apr 30, 2009 1:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

I put another sample file on the FPGA synth wiki, it's a high quality mono MP3 file made from me noodling with settings while the recorder was running. Then edit out the crap and silences. This shows a wider range of the kinds of tonal sounds I've obtained. There is also a range of dissonant sounds possible that are not represented.

http://www.fpga.synth.net/pmwiki/uploads/FPGASynth/8vFM-2x4_random_samples.mp3

synth site again:

http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.8vFM-2x4

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sun May 03, 2009 9:50 am    Post subject: Reply with quote  Mark this post and the followings unread

The 16 voice test code is now working.

I need to more extensively test the test code to see if it's testy...

At 16 voices, the design uses less than 1/2 of the FPGA (Spartan-3E 500 K Equiv. Gate).

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sun May 03, 2009 12:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here's another sample, I made the decay a little long on these bells to show off the polyphony, I do love the sound of FM bells. The ADSR I designed has selectable linear or exponential release. I use expo on these because real bells do that naturally.


16vFM-2x4_bell_notes.wav
 Description:
Note noodling with FM bells.

Download
 Filename:  16vFM-2x4_bell_notes.wav
 Filesize:  5.42 MB
 Downloaded:  348 Time(s)


_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Wed Jun 03, 2009 6:48 am    Post subject: Reply with quote  Mark this post and the followings unread

The bell sounds are impressive. I am also impressed with the Gong sounds in the low registers. Nice work Scott.

Does each 2-OP FM generator have it own independant ADSR controlling modulation index AND output amplitude?

So now you have 16 voices. That means you have 16 vioces x 4 generators/voice for a total of 64 generators with two oscillators each generator for a total of 128 oscillators? Less than 1/2 utilization on the device !! Nice .... Cool

Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Wed Jun 03, 2009 7:00 am    Post subject: Reply with quote  Mark this post and the followings unread

Yes, there is an ADSR for modulation index and an ADSR for generator output amplitude for each 2-OP generator. So each voice is controlled by 8 independantly configurable ADSRs.

The low device usage is due to using RAMs to hold configuration values and shared hardware for implementation.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Wed Jun 03, 2009 10:07 am    Post subject: Reply with quote  Mark this post and the followings unread

Scott,

Is there a MIDI implimentation chart or MIDI map available for the 8 or 16 voice designs? Are the patches controlled via SYSEX messages and if so, are they documented anywhere?

Can you tell us more about your control setup? Are you using a PC Based sequencer, MIDI Keyboard?

Sounds like you might even have enough room in the Spartan 3E device to add patch "presets" and add program change messages to your MIDI front end processor for selection Wink I figure that preset information could either be stored in the program memory space of the Picoblaze. If not there , maybe on the serial EEPROM on board.

Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Wed Jun 03, 2009 12:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

I can't remember if I mentioned that the DAC I used for this is the on-board 12 bit DAC...

State Machine wrote:
Scott,

Is there a MIDI implimentation chart or MIDI map available for the 8 or 16 voice designs?


No, that would be too much like work... Cool The synth is/was an experiment that turned out really well. By experiment, I mean that it's a proof of concept exercise that motivates a much bigger project. The implementation is pretty basic, running status and velocity are supported, but pitch wheel, channel pressure etc. are not included.

The "bigger project" is a more powerful FM synth that will be capable of most of the DX7 algorithms and will have 8 operators per voice to work with. The operators can be split up into "generators" so that, for example, a voice could be driven by two 4-op generators, or two 2-op and a 4-op, or two 3-op and one 2-op. As long as they add up to 8 maximum. In fact, it will also function as an 8 sinewave additive synth if desired. It will be 16 voice polyphonic and will allow much more in terms of modulation sources.

Quote:
Are the patches controlled via SYSEX messages and if so, are they documented anywhere?


Yes, SYSEX messages are used to communicate patch configuration data to the synth's hardware registers. A VB.NET (express) program is used to send this data using a serial (COM) port. The same data may also be sent over MIDI. There is currently no documentation other than the VB.NET program and the address decoder in Verilog. (remember that this is an experiment and not a finished synth)

Quote:
Can you tell us more about your control setup? Are you using a PC Based sequencer, MIDI Keyboard?


Although I have nice Korg keyboard, I suck at keyboard playing. That is, I'm no Rick Wakeman. I diddle fart around and stumble across things that sound cool. Then I move to a PC based sequencer and make real music that way using the diddle fart patterns as a start. As already mentioned, I wrote a VB.NET patch editor with sliders for a lot of the parameters (for easy visual compare). My sequencer is an old copy of CakeWalk that runs on a Win98-SE system which is dedicated to that purpose.

Quote:
Sounds like you might even have enough room in the Spartan 3E device to add patch "presets" and add program change messages to your MIDI front end processor for selection Wink I figure that preset information could either be stored in the program memory space of the Picoblaze. If not there , maybe on the serial EEPROM on board.


It might be possible to include presets - gotta think about that. The interface to the synth's registers is via the PicoBlaze instance, so PicoBlaze would certainly be involved. I'd be more inclined to use an additional block RAM as a ROM that PicoBlaze can read and transfer patch data from the ROM to the synth hardware registers on some sort of command. There is plenty of extra free space in the PicoBlaze ROM for such code. It implements MIDI and some LCD functions.

But again, this synthesizer was an experiment that turned out to be a nice sounding musical instrument. My focus is really more on the bigger 8-OP project. Unfortunately, that will probably not run on the Spartan-3E board. I have a board with a bigger device (Spartan-3A DSP 1800) that will accomodate the new bigger FM synth I've started. Oh and the bigger project will have at least one SVF per voice and will operate at a sample rate of 198 KHz through a 24 bit stereo DAC.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Wed Jun 03, 2009 5:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

Scott,

OK, thanks for revealing your plans. This is really some great work your doing. Cool Probably just better leaving the presets on the controlling computer end and send presets as SYSEX data like your already doing and just write a preset manager in VB.NET.

The MS VB.NET express edition is free I see. Cool I suppose a JAVA applet would do just as well.

As far as being a so so KB player, that's OK. You see, most great keyboard players can't code up things in Verilog like you do .... Laughing

Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Fri Jun 05, 2009 11:05 am    Post subject: Reply with quote  Mark this post and the followings unread

Leaving the presets as PC files sent by the patch editor/sender certainly works for my use. I do know, however, that having a PC at a gig makes a bad impression on many audiences. I don't gig anymore. However, the published code is there for someone to modify... And there is available Flash on the board.

I've included an image of the patch editor/sender. As an aside, I didn't find this synthesizer any harder to program than any other digital synth, probably because it allows FM generators no larger than 2 operators, so it's really more like an oscillator and a waveshaper.

Yes, the Express edition works well enough. The only weirdness I had to deal with was getting the COM port list and 8 bit serial communications at 115.2 Kbaud working correctly. From what I've seen of Java, I would think you'd have the same kind of thing going on. At the moment, the only thing bad about using the serial port is that any activity on the keyboard will interefere and corrupt the SYSEX transmission. So one musn't play notes during the short transmission of SYSEX data over TTY. The PicoBlaze code needs to be fixed to accomodate this.

It just now occurred to me that even the 16 voice version should fit in one of the little Avnet Spartan-3A boards. (my two were $39.00 each, I think they are now $49). I've tested the USB COM port with VB.NET and it works so the same patch editor/sender would work for both. I will have to try that.


FM-2OP-Editor.JPG
 Description:
Patch editor/sender for 2-OP FM synth. It is currently set for a basic FM bell sound
 Filesize:  142.9 KB
 Viewed:  169 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

FM-2OP-Editor.JPG



_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sat Jun 06, 2009 8:24 am    Post subject: Reply with quote  Mark this post and the followings unread

I just finished the main work on porting the design from the Spartan-3E Starter Kit to the Avnet Spartan-3A 400 board.

The Spartan-3A FPGA (400K equiv. gates) on the Avnet board is a little smaller than the Spartan-3E (500K equiv. gates) on the starter kit.

This synth (16 voice version) works on the Avnet board using 64% of the device's slice resources.

EDIT ADD: The USB programming serial port (under Windows XP) shows up on my system as COM3 configured for 115.2 Kbaud and works nicely to send patch data to the Avnet board.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Tue Jun 09, 2009 4:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a sample of some bells played by the 16 voice version using an Avnet Spartan-3A 400 dev board and a Cirrus CS4344 (24 bit stereo) DAC.


16_voice_fm_demo_002.wav
 Description:
sample of FM bells.

Download
 Filename:  16_voice_fm_demo_002.wav
 Filesize:  7.65 MB
 Downloaded:  374 Time(s)


_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
Dan Lavin



Joined: Nov 09, 2006
Posts: 620
Location: Spring Lake, Mi, USA
Audio files: 21

PostPosted: Wed Jun 10, 2009 6:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

Scott,

Excellent work, as usual. The timbres with 2 operators are quite impressive. I can't imagine when you get to 8....well I guess I can since I used to own a DX-7. It would be cool to have that power in a DIY format. I remember when the DX-7's were out for a while and people started to diss FM and I could never figure that out. I mean I owned mine for 6 years and never ran out of potential with it..and this was when I was both gigging and recording almost exclusively with it. Keep up the good work, I'm cheering for you!

-Dan
Back to top
View user's profile Send private message
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Thu Jun 11, 2009 7:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Sounds great Scott !! Glad you adapted the patching option. The interface looks nice that you posted as well. I agree with Dan, this should sound fantastic using the 8 operator implimentation you planning.

I have a VST version of a DX7 like synthesizer called FM7 by Native Instruments and the sounds blow me away. I have used this synthesizer on several of my recordings.

This would be cool to have a powerful FM synthesizer on a DIY hardware platform. Cool

I hope you dont mind a few questions Scott, I may have asked some of these before:

Concerning your NCO/Wavetable technical specifications:

In your current 2-Operator Design:

1) What is bit width of your Phase Accumulator?
2) What is the bit width of your Tune Word?
3) How many accumulator high order bits are you using to address your wavetable? (Wave Table Depth)
4) How many bits wide is your wavetable output data (sample resolution) ?
5) Are you implimenting a 1/4 Sine Wavetables (pi/2 radians)
6) NCO Sample Rate?
7) Output data format of your wavetable (Sign Magnitide, 2's Comp, Unsigned Binary ??)

I would assume question 7 would be dependant on the DAC type being used.

Sorry for all the questions. I am surveying other DIY NCO/Wavetable Synthesizer designs for comparison to my own ....

Great work Scott !
Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Thu Jun 11, 2009 8:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks State-Machine and AntMan for the kind remarks.

Quote:
1) What is bit width of your Phase Accumulator?

32 bits

Quote:
2) What is the bit width of your Tune Word?

17 bits. The tuning words represent the 12 lowest pitches that the synth can produce, they are binary left shifted by the octave amount to get the full phase increment value.

Quote:
3) How many accumulator high order bits are you using to address your wavetable? (Wave Table Depth)

12 bits - This is for the full wave sinewave generation system. The actual 1/4 wave ROM uses 10 address bits.

Quote:
4) How many bits wide is your wavetable output data (sample resolution) ?

18 bits signed

Quote:
5) Are you implimenting a 1/4 Sine Wavetables (pi/2 radians)

Yes. This extends the address range of the sine output system from 10 bits to 12 bits.

Quote:
6) NCO Sample Rate?

Everything that is sampled is sampled at the DAC sample rate of 65.1 KHz. The synthesizer hardware state machine is triggered by the DAC enable signal. DAC enable occurs once every 768 system clocks. System clock is 50 MHz.

Quote:
7) Output data format of your wavetable (Sign Magnitide, 2's Comp, Unsigned Binary ??)

It is unsigned as stored in the wavetable itself.

The logic that presents a full wave of the sine waveform from the 1/4 wave table generates a signed binary word.

The DAC I'm using accepts 24 bit wide signed binary data. So throughout the synth's computational logic, signed arithmetic is used.

I've also just yesterday changed the carrier:modulation ratio from 14 bits to 18 bits - giving better control over the tuning of harmonics produced and adds more available complexity to the sounds that can be produced.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima

Last edited by JovianPyx on Fri Jun 12, 2009 7:01 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Thu Jun 11, 2009 6:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Everything that is sampled is sampled at the DAC sample rate of 65.1 KHz. The synthesizer hardware state machine is triggered by the DAC enable signal. DAC enable occurs once every 768 system clocks. System clock is 50 MHz.


Thanks Scott for taking the time to answer those questions.

One other question, what is the accumulator update rate? I should have specified the accumulator sample rate (F_clk to accumulator). I know that the above rate, 65.1 KHz, can't be the accumulator sample clock because using a 32 bit accumulator,, and the largest TUNE value (2^17-1), you would be barely hit 2 Hz. I will assume this 65.1 KHz will be the sample rate at which the DAC gets it's updates from the output of unsigned_binary-to-signed_binary logic that follows the waveform LUT.

Quote:
12 bits - This is for the full wave sinewave generation system. The actual 1/4 wave ROM uses 10 address bits.


OK, so you cycle through the 1/4 wave ROM 4 times then for each cycle (your first 10 bits of address) while the upper 2 bits are used for the "math" logic ... Wink nice !

Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Fri Jun 12, 2009 6:38 am    Post subject: Reply with quote  Mark this post and the followings unread

Ah, I see, you did the math...

I used a linear interpolated tuning system to allow for microtuning of any NCO.

Since a multiplier is required for linear interpolation, I decided to truncate the bit width of the tuning tables (there are two for interpolation) to 17 bits unsigned (or 18 bits signed where the sign bit is always zero) so that a single 18x18=36 hardware multiplier could be used to do the interpolation arithmetic. So there is left shifting going on that isn't so obvious having to do with the selection of bits from the multiplier's 36 bit wide output.

The phase accumulators really run at a 65.1 KHz sample rate.

I started using this technique with the original GateMan synth and since the tuning was quite good, I used the method in later synth designs based on the GateMan's structure. More significant bits than 17 could have been used (nontruncated wider tuning tables), but that would have forced the use of more than one hardware multiplier to perform the interpolation.

ALSO: I edited a previous response to say that the tuning ROM's 12 values represent the LOWEST 12 notes the synth can produce, left shifting allows for creation of the octaves above the lowest register.

EDIT ADD: Minutia: The MIDI controller takes in the MIDI note numbers and converts them to a base note number and an octave number using a simple divide by 12 routine. The note number is a 4 bit wide entity that expects to hold values from zero to 11. The octave entity is 4 bits wide as well.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sat Jun 13, 2009 3:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

This is why I like polyphony.

I was just messing around and out came this.

The piece is done using a single Avnet Spartan-3A dev board and a 24 bit DAC (thanks to Eric Brombaugh) running the 16 voice 4 x 2-OP FM synth. It was recorded dry.


avnet_16voice_2-OP_FM_demo.mp3
 Description:

Download
 Filename:  avnet_16voice_2-OP_FM_demo.mp3
 Filesize:  1.38 MB
 Downloaded:  439 Time(s)


_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima

Last edited by JovianPyx on Sun Jun 14, 2009 7:13 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Sat Jun 13, 2009 6:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Scott,

Wow, this is a very inspiring sample of this synthesizer and really shows off the polyphony ! The notes really jump out at you with that brassy, metallic sound ! Thanks ....

OK, wrapping my head around the LINEAR INTERPOLATION method.

Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sun Jun 14, 2009 2:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

I think it sounds more complex than it really is. I have two tables of 12 locations each. In the "lo" table, I have (essentially) phase increment values for notes 1/4 tone (or 1/2 a semitone) below the standard pitch for that note. The "hi" table has the same kind of data, but for 1/4 tone above the standard pitch.

Given a note number integer N where 0 <= N <= 11
Given T is a fixed point tuning variable 0.0 <= T < 1.0. A value of 0.5 represents "concert pitch".

Diff = hi[N] - lo[N]

PhaseInc = Diff * T + lo[N]

That's it. You can use T for other things, like the pitchwheel or portamento. You can also use tuning tables with much wider separation. If the tables are 2 octaves apart, you can implement a +/- 12 semitone pitch wheel.

In this FM synth, all I'm currently using T for is to individually microtune any of the NCOs. This microtuning is one of the reasons the tones this synth can generate are animated.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sun Jun 14, 2009 5:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

AHHHHHH!!!! I found a problem in the sample above... The problem is in the MIDI data, some stuff got pasted where it didn't belong and it makes the first chunk of the sample sound wrong (to me). Shocked Shocked Shocked Shocked

So I've redone the whole thing. And I added another instrument. I figured since I have several dev boards, and there's another one that can run this synth, why not use 2? There's left and right hand parts to this piece, so one synth gets the left, the other gets the right. This made it easy to get a stereo image.

So the attached sample uses the corrected MIDI file and 2 instruments for stereo. I hope you will enjoy it. (it should now be more clear what I intended to do with this in the first place)...

One of the parts is played by the Avnet board, the other is played by a Spartan-3E Starter Kit.


avnet_16voice_2-OP_FM_demo_001.mp3
 Description:
Second attempt at a demo sample for the 16 voice 4 x 2-OP FM synth.

Download
 Filename:  avnet_16voice_2-OP_FM_demo_001.mp3
 Filesize:  1.42 MB
 Downloaded:  382 Time(s)


_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2745
Location: New York
Audio files: 24

PostPosted: Sun Jun 14, 2009 6:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Scott,

Quote:
I think it sounds more complex than it really is. I have two tables of 12 locations each. In the "lo" table, I have (essentially) phase increment values for notes 1/4 tone (or 1/2 a semitone) below the standard pitch for that note. The "hi" table has the same kind of data, but for 1/4 tone above the standard pitch.


OK, I see. as you say, your MIDI controller takes in the MIDI NOTE number, converts it to a base note number and octave entity. The base note number then indexes these "Hi" and "Lo" phase increment tables that represent you 0.5 semitone offsets.

Quote:
Given a note number integer N where 0 <= N <= 11
Given T is a fixed point tuning variable 0.0 <= T < 1.0. A value of 0.5 represents "concert pitch".

Diff = hi[N] - lo[N]

PhaseInc = Diff * T + lo[N]


OK, I see ... easy .. now I would assume the octave entity comes into play here to determine how many "left shifts", which is essentially a x2 multiply, to create the octave you need. Now you have your final note frequency adjustable by +/- 1 semitone. Nice Scott.

What is the resolution of "T", your tuning variable?

Oh, the second sound demo is really good Scott Wink

Thanks
Bill
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1232
Location: West Red Spot, Jupiter
Audio files: 157

PostPosted: Sun Jun 14, 2009 7:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

I think you understand the interpolation.

T is 18 bits signed. It's currently driven by an interface that delivers a 14 bit value via sysex however.

And thanks for the sample compliment - I think I got it right now...

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 2 [27 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use