Shop OBEX P1 Docs P2 Docs Learn Events
Tonewheel Organ with Propeller Chip - Hammond B3 — Parallax Forums

Tonewheel Organ with Propeller Chip - Hammond B3

PropB3PropB3 Posts: 10
edited 2012-05-13 10:06 in Propeller 1
Hello to all musicans,

i have just programmed a Tonewheel Organ simulation on the Propeller (Hammond organ).
I uses a MIDI interface and 9 drawbars like a real B3. The audio output is done by a 12bit R2R ladder.
the hardware is very simple, but worked nice.

Know I want to clean up my code, and make it a littel bit more 'readable / understandable'.
It seems that all memory declarations in the propeller language are 'global', so that i need a lot of names for one variable in several cogs.
o.k. this is my first popeller project - i did it like this way:

PUB MySpinInitCode

Cog1Var := @AMemoryCell_in_the_HUB
Cog2Var := @AMemoryCell_in_the_HUB 'the same memory address
Cog3Var := @AMemoryCell_in_the_HUB '.... ... -> 4 names for one cell !

'know assembly code: I want to communicate between 3 cogs

DAT
ORG 0
Cog1Programm
wrlong Acc1,Cog1Var
........

DAT
ORG 0
Cog2Programm
rdlong Acc2,Cog2Var
........


DAT
ORG 0
Cog3Programm
rdlong Acc3,Cog3Var
........

And I need in every cog an unique name for my 'accumulator'

Is there a better way ?

If anyone is interested on my work, or wants to rebuild the organ, send me an message or mail

thanks

H.Bollig

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-15 15:36
    PropB3: Welcome to the fabulous world of the prop.

    I am in a hurry ATM so will leave it for others to help you. There are plenty of very capable people on this great forum, so if you have a problem, please ask.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-15 15:44
    In PASM code, you can use "local" variables for things like accumulators and such. Such variables have names that start with a colon, and their scope includes only the area where they're declared, between one global label and the next. To use them for PASM variables means that nearly all labels in a given PASM block, except for the first label, have to be local. The advantage, of course, is that you can reuse local names as many times as you want. The disadvantage is that they're completely inaccessible outside of their scope (e.g. from Spin code), unlike in SX assembly, where they could be accessed globally using a global:local notation.

    -Phil
  • David CarrierDavid Carrier Posts: 294
    edited 2011-12-15 17:16
    H. Bollig,
    I am interested in your project. I have an electric organ console that is in pristine condition, but the electronics no longer work because the capacitors have all dried up. I want to put a Propeller-based synthesizer inside. I probably won't be able to work on it until after Christmas, but if you send me your code I wouldn't mind looking at it and improving upon it. Better yet, if you attach it to a forums post, then everyone who is interested can look at it or work on it too. Even if you haven't honed your Propeller programming skills it will still be a benefit to the community, and no one will critisize you just because you are learning while you are programming.

    Thank you,
    David Carrier
    Parallax Inc.
  • mrainbow1mrainbow1 Posts: 9
    edited 2011-12-22 07:26
    Very interesting - I have also been developing a Hammond organ sim for a while using Beans brilliant Propbasic - it uses all 8 cogs to give midi in, 5 octaves, 12 note polyphony, 9 drawbar settings - nearly finished the Leslie effect (very challenging) - then will do percussion and sustain - the sounds are really very good. I'm using 2 pins for normal and Leslie PWM output. All done on a demo board. I will post something nearer completion. Keep up the good work.
    Mike R
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2011-12-22 09:15
    Hi Mike,

    Welcome to the Propeller forum. Your project is very interesting as well. Is the URL below is for your website and cool Midi products? I'm looking forward to hearing the Leslie effect in action.

    http://www.rainbowelectronics.co.uk/midi%20wsg.htm

    Bob
  • AntoineDoinelAntoineDoinel Posts: 312
    edited 2011-12-22 09:54
    I've contacted the author and had a chance to try it, after adapting to pwm output and different pins.
    I can say that it's nothing short of spectacular, it sounds really nice, maybe just a little bit too loud keyclick (to my ears).
    Can't judge it compared to the real thing since I don't own one, but I'm really surprised that it doesn't even consume all the cogs.
    Disabling debug up to 3 cogs are free (I used one for pwm), so there's still room for attempting to add leslie (and crossover filter, and overdrive maybe?).
  • mrainbow1mrainbow1 Posts: 9
    edited 2011-12-22 23:03
    Hi Mike,

    Welcome to the Propeller forum. Your project is very interesting as well. Is the URL below is for your website and cool Midi products? I'm looking forward to hearing the Leslie effect in action.

    http://www.rainbowelectronics.co.uk/midi wsg.htm

    Bob
    ====================================

    Hi Bob,
    Yes, that is my website - needs updating badly, just some of my hobby projects. I'm on holiday at the moment, 6000 miles from home but will continue with the organ sim project when I get home.
    Mike
  • mparkmpark Posts: 1,305
    edited 2011-12-23 08:51
    Some of you might remember Mike Rainbow's name from this thread: http://forums.parallax.com/showthread.php?109498-Rainbow-synthesizer-polyphonic-multitimbral-wavetable-synthesis

    Mike, good to see you posting here!
  • PropB3PropB3 Posts: 10
    edited 2011-12-23 12:00
    Hello,

    for all people who are interested on the PropB3, I put an audio Demo on the thread. On Demo 1 you hear the pure organ.
    You hear at sequence with 3 setings, FULL Drawbar / Jimmy Smith Sound / Gospel Sound. One time in mellow and once in bright (more keyclick)
    PropB3_demo1.zip

    Beacause Hammand Organ without Leslie speaker is rather boring, I put here a second Demo, it uses a multieffects with rotary speaker and reverb (Its a DIY effects unit from ELEKTOR magazin). The PropB3 has (at this time) no leslie effect.
    PropB3_demo2.zip

    Heres a pic and the schematics of the organ

    The PropB3 has following config:
    Cog1 = Midi Decoder
    Cog2 = generate Tonewheels 61
    Cog3 = generate Tonewheels 62 -79 and Vibrato / Chorus / Output
    Cog4 = generate Voice 1-8
    Cog5 = generate Voice 9-16

    The output is done via 12Bit D/A converter using a simple R2R Ladder and a smothing analog filter. - Very simple.
    During the working on this project, i figured out that the R2R ladder sounds much better than an PWM output. You can run at lower clocks and get more time for calculations inside a cog.

    Thanks

    H.Bollig
    1024 x 731 - 76K
    1024 x 1365 - 114K
  • hover1hover1 Posts: 1,929
    edited 2011-12-23 12:55
    PropB3 wrote: »
    Hello,

    for all people who are interested on the PropB3, I put an audio Demo on the thread. On Demo 1 you hear the pure organ.
    You hear at sequence with 3 setings, FULL Drawbar / Jimmy Smith Sound / Gospel Sound. One time in mellow and once in bright (more keyclick)
    PropB3_demo1.zip

    Beacause Hammand Organ without Leslie speaker is rather boring, I put here a second Demo, it uses a multieffects with rotary speaker and reverb (Its a DIY effects unit from ELEKTOR magazin). The PropB3 has (at this time) no leslie effect.
    PropB3_demo2.zip

    Heres a pic and the schematics of the organ

    The PropB3 has following config:
    Cog1 = Midi Decoder
    Cog2 = generate Tonewheels 61
    Cog3 = generate Tonewheels 62 -79 and Vibrato / Chorus / Output
    Cog4 = generate Voice 1-8
    Cog5 = generate Voice 9-16

    The output is done via 12Bit D/A converter using a simple R2R Ladder and a smothing analog filter. - Very simple.
    During the working on this project, i figured out that the R2R ladder sounds much better than an PWM output. You can run at lower clocks and get more time for calculations inside a cog.

    Thanks

    H.Bollig

    I am very impressed with the sounds! I own a Hammond A-100 and have been working with Hammonds for 30 years, so I know what to expect. Leslie effect is awesome!

    Any chance you will put the code in the OBEX, or is going to be a commercial venture.

    Either way. it's great work.

    Jim
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-12-23 14:34
    Great work !!
    I must say that the rotating speaker simulation does a lot of difference.

    Some questions...
    What is the sample rate?
    Is this pure additive synthesis?
    Pardon my ignorance but does the real thing have some kind of volume envelope?? (It sounds like there is no volume envelope applied at all in your examples)

    /Johannes
  • mrainbow1mrainbow1 Posts: 9
    edited 2011-12-24 00:23
    Nice work H. - I hope to show you what I have done soon.
    Mike
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-12-24 12:21
    Mike this is awesome !

    This makes we wanna play E-piano and hammond again.
    Will you upload the code to the obex?

    best regards

    Stefan
  • lardomlardom Posts: 1,659
    edited 2011-12-24 17:38
    Wow. I played a B3 for many years. It's nice to know so many are familiar with it. I bet many of us prefer the tube sound.
  • PropB3PropB3 Posts: 10
    edited 2011-12-25 06:16
    Here some answers to the questions:
    - sample rate is 20KHz, means audio bandwith 10Khz
    - it works like a real tonewheel organ, 79 free running ozilators mixing together with 9 drawbars....
    - No clasical volumen control like in synth (ADSR) - o.k. theres a Percusion, but like real Hammond only on first note
  • PropB3PropB3 Posts: 10
    edited 2012-05-13 07:21
    Hello,

    the "new" PropB3 is online. You can have a look here :

    http://bolltone.de/Projekte/PropB3/PropB3_US.html
  • lardomlardom Posts: 1,659
    edited 2012-05-13 10:06
    Nice work! I really like the sound of the leslie turning on and off.
  • I have built the cicuit, unfortunately I can't get it to work. Trying to load the EEProm (or the RAM) it seems to load but afterwards I get 'Write failure on com4'.
    So the propeller is found (5/80MHz is quoted), but the programming doesn't work. With a logic analyser the signals seem to be weird - although of course I don't really know what I should be seeing - there is never a start sequence (data going low with clock high) at the EEProm inputs. Doubtless a stupid mistake somewhere from me, but I've checked everything, changed the ICs, checked the circuit, measured signals, checked for shorts etc etc. Obviously though a bit in the dark when one doesn't have the spin code. Only thing I haven't done is changed my CH340 USB/Serial Adapter for a FTDI one (supposed to be better).
    Gordon
  • Have you ever successfully programmed a Prop with your CH340 adapter? If not, take a look at the documentation for the Prop Plug, which is the Parallax USB/serial adapter specifically for the Prop (product #32201). There's a NPN transistor on the Prop Plug that can pull the Prop reset line low to restart it. Does your adapter include a way to reset the Prop?
  • pik33pik33 Posts: 2,387
    Excellent :) And this 12 bit resistor ladder DAC...
  • pik33pik33 Posts: 2,387
    edited 2017-03-07 18:42
    During the working on this project, i figured out that the R2R ladder sounds much better than an PWM output. You can run at lower clocks and get more time for calculations inside a cog.

    Did you try noiseshaper for PWM audio? I used it in this player: http://forums.parallax.com/discussion/140767/a-new-topic-for-vga-not-only-sid-player

    Then if you have 12-bit r2r ladder already implemented, you can still combine this with PWM and noiseshaping, which can give ~20 bit audio resolution
  • continued from march 4. I got a Parallax USB to RS232 adapter, and with this the programming works. But I still can't get the PropB3 to work properly. If I alter the output from the DAC to the OpAmp I can get it to work - but with very bad distortion. Running out of Ideas!
    Gordon
  • Hi everybody,

    I have purchased the TDA1543-chip as the DAC.
    But I have found that there are two different versions
    one for japanese input format: time multiplexed two's complement

    and
    one with I²S-input format

    But I don't know which format is used in the PropB3-code

    Does somebody know this?

    best regards Stefan

  • mparkmpark Posts: 1,305
    StefanL38 wrote: »
    Hi everybody,

    I have purchased the TDA1543-chip as the DAC.
    But I have found that there are two different versions
    one for japanese input format: time multiplexed two's complement

    and
    one with I²S-input format

    But I don't know which format is used in the PropB3-code

    Does somebody know this?

    best regards Stefan

    At 5:33 in this video, Mike Rainbow discusses the different versions of the TDA1543. The relevant portion lasts about a minute. Basically, the Japanese variant has an A suffix (TDA1543A) and does NOT work. Unfortunately, Mike discovered that the lack of a suffix on the chip does not guarantee that the chip will work, so you pretty much have to just try it.
Sign In or Register to comment.