(OLD)Code updated: -Remove unused variables. -Add some comments. -Optimize some parts of code and memory usage. (Thanks MarkT)
#########################################################
Hello, I want to introduce myself with this project; I greatly appreciate those who make the Arduino world and this community possible, because thanks to all this, programming a microcontroller has become very easy. Thanks to everyone.
Speaking of the current project:
Hammond Organ Synthesizer / Simulator
-9 independent Drawbars controlled via MIDI.
-3 Leslie rotary effects; Stop / Slow / fast / Superfast.
-6 Vibrato effects (c1, c2, c3, v1, v2, v3).
-8 Note pholyphony.
-Supports USB serial MIDI over ttyMidi.
-Supports MIDI Shield (Not tested, but theorically works).
Finish line:
-Remove bugs.
-Percussion effect on the corresponding drawbars
-Overdirve effect.
-Reverb effect.
Bugs:
-Sound glitch on change any midi potentiometer. -noteOFF message lost when change drawbar setting and keys are playing.
-many more; It is an early version of the software.
If you extend the wavetable size, 0xFF will become 0x1FF or whatever of course and wave array will
need to be larger too.
I don't understand counter1 - you seem to be repeatedly updating the live wavetable without
outputting samples for 255 clocks after changing the harmonic levels?
If you extend the wavetable size, 0xFF will become 0x1FF or whatever of course and wave array will
need to be larger too.
I don't understand counter1 - you seem to be repeatedly updating the live wavetable without
outputting samples for 255 clocks after changing the harmonic levels?
yeahh !! I deeply appreciate your help;
I have tested the code and I get the impression that it has improved performance when you have to render the harmonic mix.
There is also considerable memory savings ...
And you have taught me something very valuable to me ... how to add a variable infinitely! I didn't know anything about that.
You have opened a new door of possibilities for me, this information gives me other very useful ideas.
Many thanks!
About the counter1;
When it reaches 0 (when a drawbar changes the value), the function adds the corresponding waves to make it a single wave with its corresponding harmonics.
I know this is a slop ... but I have not found another way to do it with the Arduino Nano.
I have seen that other people with an avr called Tensy, can do a lot of polyphony, but they are 200mhz against 14mhz of the Nano.
I'm sorry if I have errors in my writing, I don't know much English.
Code updated: -Percusion Key added. -2 way Leslie simulation (horn & drum) added. -fixed last octave (repeat 3 last drawbars) same as old organs. -Change some int variables to char. -Add some comments. -Optimize timer2 for effects, rest of code is in to loop() function. #########################################################
FUTURE:
I will try in the future, to use 4 outputs to generate the sounds and to filter them independently to obtain more quality, in the style of the digital organs of yamaha; Each drawbar is filtered separately, for example:
pin9 = 3 first drawbars
pin10 = 3 middle drawbars
pin11 = 3 last drawbars
pin3 = Percussion keys
In this way, you could filter each output with some resistors and capacitors and reduce noise. There would also be a significant quality improvement.
I had also thought to place two opamps and control them using the analog pins for the leslie effect; I think that would improve performance and sound quality. The arduino would save some work by not having to multiply the sound output for rotary effect.
I appreciate any suggestion or help, maybe together, we can build an ultra cheap tonewheel emulator with an acceptable quality ... at the moment it sounds very very Vox, Farfisa ... I would like a little more from Hammond;).
Thanks for everything and I apologize for the translation.
Code updated:
Complete midi implementation with MIDI.h
Best sound quality on general drawbars.
Volume boost.
Percussion keys now sounds good.
Added slow and fast decay on Percussion key sound
Corrected Leslie effect when fast mode go to stop mode.
Serial baudrate is 31250 for std midi use.
Added 0.022uF ceramic capacitor to gnd and out; This filter some strange sounds.
I regret the errors, I am a novice in programming and I use Google Translator a lot.
I attach two audio files and the 0.4 source code.
The second audio is a sample of the improvements in percussion keys.
The first audio .... is processed with external leslie effect ... sounds great this way. I will have to investigate more about the Leslie speaker, the rotary emulator of my code does not sound so good):
Israsta:
This is a GREAT project! Good job! The fact that this isn't on a more powerful Arduino family member is amazing! I would like to try this at some point. I'm currently using a VOCE MicroB for Hammond sounds but it doesn't allow me control over the drawbars. Any chance key click will be added? My MicroB also does noise after key release but it is too loud. You probably don't need to add that. I currently use a Roland Leslie simulation pedal that includes overdrive. Probably a simple outboard overdrive guitar pedal will help you sound more like a Hammond. Good luck!
Thank you very much for your comments antman49443.
I have been watching some videos about the Voce MicroB, it is a very interesting device.
I've been testing with a guitar amp with an overdrive, the results are great; It looks more real / old.
Today I bring a new version, I am very happy because now the Leslie effect does not use a patched dry vibrato; Now use a buffer to generate an authentic chorus effect!
Personally I like the sound more now, since in the previous version, the Leslie effect only made a tremolo effect.
I'm going to take a while to upload more versions of this project because I'm going to focus on using an Arduino Nano only for the Leslie effect (DSP type) and another arduino to generate the sound of the keys. I will also try to use the 4 available pwm outputs to generate the sound and thus improve the quality of the final audio.
I am sorry not to have audio demos ... but here I leave the source code.
Israsta:
I have a question on electrical connections. Your sketch shows audio out on pins 9 and 10. Would that be the physical pins 9 and 10 which are D6 and D7 or D9 and D10 which are physical pins 12 and 13? It seems all these pins have multiple names
Hi, thanks for the interest.
The pins for audio output are:
DIGITAL PWM 09 (12)
PWM SPI, ss DIGITAL 10 (13)
The MIDI signal can be sent directly via usb or to the pin:
RX232.RX DIGITAL 00 (2)
I apologize if there are translation errors; I understand some English, but to write a lot of text I use a translator, and maybe in the comments of the source code and in the posts I make some mistakes.
israsta:
Today I bring a new version, I am very happy because now the Leslie effect does not use a patched dry vibrato; Now use a buffer to generate an authentic chorus effect!
Personally I like the sound more now, since in the previous version, the Leslie effect only made a tremolo effect.
Great, now you've split out the packet handlers into separate functions you can write a demo mode using them if you want!