These forums are read only, please use our new forums here.

Main :: ToneCore Development Kit



Simple Tutorial?
by cheezor on 2012-04-11 15:06:12

I have owned one of these things for a while and I would really love to get into programming it. Assembly does not really scare me. However, it is a bit over whelming to try to read through the complete effects that I have seen posted online. Are there any beginners tutorials? Something that starts off super basic, like a volume pedal, mute pedal, or something similar, but explains most or all of the code for beginners like myself. I have walked myself through some of the source out there and I understand parts of it, but not enough to make something simple like I just said.

It seems like a mute pedal could be easily changed to a volume pedal and from there changed into a stutter effect and that would show all the beginners how to work with volume, knobs, and timing. If someone would be interested in making a tutorial or point me to some info like this that would be awesome! Basically, what I want is a "Hello World!" program to get me started. Any help would be appreciated. Thanks!



Re: Simple Tutorial?
by RedPandaCurt on 2012-04-11 17:05:20

I'm not aware of any simple tutorials out there, but you could start with the two band stereo EQ sample code.  First build it and download to the pedal.  Once you have that working, strip out the processing code so it is just a pass through.

Here is the code that processes both channels:

    ;Process Left Channel   (left input sample is in a)       

        move    #>Switch_1,r6           ; point to x:mem (switch states)

        move    #>Filter_1_K,r4         ; point to x:mem (coefficients)

        move    #>Filter_1_A_Left,r3    ; point to y:mem (filter mem)

        bsr     TwoBand_EQ              ; input in a, output in a

        move    a,y:LeftOutput

    ;Process Right Channel  (r6 is currently pointing to Switch 1)        

        move    y:RightInput,a          ; load right input sample in a

        move    #>Filter_1_K,r4         ; point to x:mem (coefficients)

        move    #>Filter_1_A_Right,r3   ; point to y:mem (filter mem)

        bsr     TwoBand_EQ              ; input in a, output in a

        move    a,y:RightOutput

To make it a pass through, change the above block to:

    ;Process Left Channel   (left input sample is in a)       

        ; do your own processing here

        move    a,y:LeftOutput

    ;Process Right Channel  (r6 is currently pointing to Switch 1)        

        move    y:RightInput,a          ; load right input sample in a

        ; do your own processing here

        move    a,y:RightOutput

Everything under "Common Subroutines" can be deleted (unless you want to use them).  Then start building a simple volume pedal.  Use git/subversion/whatever and commit/checkin frequently so you can back up as soon as you take a wrong turn.



Re: Simple Tutorial?
by RedPandaCurt on 2012-04-12 05:09:52

You don't have to worry about timing for a simple volume pedal.  The processing in the TwoBandStereoEQ sample code happens in one of the sample receive interrupts (called once per sample).  The knob and switch registers are defined at the top of the sample file (Knob_1, Switch_1, etc.).  For debugging, you can also write to the Debug_Read_from_DSP_x registers to display values in the UI.

Here are a few simple things to get started:

  1. Remove the calls (bsr) to Generate_Coeffs and TwoBand_EQ to create a pass-through (see previous reply).
  2. Set Debug_Read_from_DSP_1 to 0x000001 when the effect is on and 0x000000 when the effect is off.  Look for the code that turns LED_Green on/off based on the footswitch.  (Note that the Generate_Coeffs subroutine also writes to the debug registers.)
  3. Mute the signal (e.g., by multiplying input by 0) when the effect is off.
  4. Multiply the signal by the Knob_1 value to create a simple volume pedal.

Once you get those basic things working, you can smooth the volume changes to avoid clicks and zipper noises.  Then add log scaling to give the knob a better response.



Re: Simple Tutorial?
by cheezor on 2012-04-13 12:52:42

Thanks for all the advice! I successfully made a mute pedal last night.  I couldn't figure out the mpy command the way I wanted to use it so I used the mov command instead to make the signal 0.  This weekend I'll hopefully get a chance to try my hand at a simple volume pedal. Thanks again!

Also, could someone tell me what registers we have available? Sorry for the total noob question. I think I will start making a tutorial to help other complete beginners out and help concrete my thoughts.



Re: Simple Tutorial?
by RedPandaCurt on 2012-04-14 17:35:43

All of the DSP56364 registers are available.  However, I think a couple of the address registers are reserved for interrupt processing in the sample code.




The information above may not be current, and you should direct questions to the current forum or review the manual.