Shop OBEX P1 Docs P2 Docs Learn Events
pitch shifting using Fourier transform and the Propeller 1 — Parallax Forums

pitch shifting using Fourier transform and the Propeller 1

shadoclawshadoclaw Posts: 4
edited 2023-06-15 01:04 in Propeller 1

Salutations!
In today's episode of SCIENCE!!!, I am considering building a pitch shifter using a PCM5102 DAC, an MCP4725 ADC, and a Propeller 1 development board, in a similar vein to the Digitech Drop pedal, the ultimate goal of which would be to create a pedal based interface that would allow me to change the tuning of my guitar in a live setting. The interface would use pushbutton switches to change parameters on the pedal, LEDs or an LCD to provide visual feedback, and a 3 pole double throw "Stomp" switch to bypass the pedal when not in use.

I know that the Coyote pedal exists, which uses a similar concept. I also know that the Spin objects in question would require Fourier transform math in order to accomplish the pitch shift, as well as Spin objects to drive the ADC and DAC, but I do have some other questions.

*Would I need to build a preamp to amplify the incoming signal in order to facilitate the conversion?
*How many Cogs would I need in order to implement this?
*What external components would be required for this, other than what is mentioned above, the input and output jacks, and possibly an SD card reader?
*What kind of Audio latency can I expect from this?
*Has anything like this been tried before? I know that there are folks that have experimented with the Prop 1 for MIDI applications, not so sure about straight audio.
*Are there any sample Spin objects that can be modified in order to facilitate this?

Warmest regards

Edit: I realized after writing this that the MCP4725 is actually a DAC. Mea Culpa. I'll be searching for an actual audio ADC as I conduct my experiments.

Comments

  • tritoniumtritonium Posts: 542
    edited 2023-06-15 11:52

    Hi
    Sadly it looks as if Jon's link to parallax then refers you to visit the OpenStomp website for more information.
    And that Openstomp website is up for sale and can be yours for a mere £5,295.
    A gem that seems to have disappeared.

    Oh but wait- I missed the inspiration download attachment box that has a zip of the code. :)
    All spin files- so I guess no circuit.
    Dave

  • @shadoclaw said:
    Salutations!
    In today's episode of SCIENCE!!!, I am considering building a pitch shifter using a PCM5102 DAC, an MCP4725 ADC, and a Propeller 1 development board, in a similar vein to the Digitech Drop pedal, the ultimate goal of which would be to create a pedal based interface that would allow me to change the tuning of my guitar in a live setting. The interface would use pushbutton switches to change parameters on the pedal, LEDs or an LCD to provide visual feedback, and a 3 pole double throw "Stomp" switch to bypass the pedal when not in use.

    I know that the Coyote pedal exists, which uses a similar concept. I also know that the Spin objects in question would require Fourier transform math in order to accomplish the pitch shift, as well as Spin objects to drive the ADC and DAC, but I do have some other questions.

    *Would I need to build a preamp to amplify the incoming signal in order to facilitate the conversion?
    *How many Cogs would I need in order to implement this?
    *What external components would be required for this, other than what is mentioned above, the input and output jacks, and possibly an SD card reader?
    *What kind of Audio latency can I expect from this?
    *Has anything like this been tried before? I know that there are folks that have experimented with the Prop 1 for MIDI applications, not so sure about straight audio.
    *Are there any sample Spin objects that can be modified in order to facilitate this?

    Warmest regards

    Edit: I realized after writing this that the MCP4725 is actually a DAC. Mea Culpa. I'll be searching for an actual audio ADC as I conduct my experiments.

    Hi,
    FFT needs a lot of multiplications. P2 can do this very much better than P1, which has got no hardware multiply instruction. If you wanted to do pitch shifting with FFT, you would need a very high number of bins. In any case you will very likely need to code in assembler, if you want to use P1 or P2. Which can be learned..... Such project is definitely not a "one day's episode". There is an ADC set offered for P2 by Parallax and P2 can do DAC with a certain quality.

    Instead of using FFT pitch shifting is often done varying the sample rate between record and playback, which does not need too much math. This can be done with P1 and of course with P2 too.
    I think this: http://www.spinsemi.com/programs.php is a really great source of methods for sound effects. There is some code for pitch shifting.
    Good luck! Christof

  • I have three of these:

    I brought this up in the past. I would love to see a P2 version.

    Autotuning
    Instant alternate tuning
    Perfect intonation that's just impossible on any other guitar.

    Craig

  • I'm also a Digitech fan. I have six GNX4 units. Ancient but still nothing on the market has the features.

    Craig

  • More AT-200 info attached.

    Craig

  • @tritonium said:
    Hi
    Sadly it looks as if Jon's link to parallax then refers you to visit the OpenStomp website for more information.
    And that Openstomp website is up for sale and can be yours for a mere £5,295.
    A gem that seems to have disappeared.

    Oh but wait- I missed the inspiration download attachment box that has a zip of the code. :)
    All spin files- so I guess no circuit.
    Dave

    Yeah, I noticed that too. Funny how that works.
    Also funny how, despite the Coyote-1 being an "Open Source" application, after doing a search online, I could find None of the schematics for it whatsoever- despite the fact that I remember them being online at one point. Must have been a Mandela effect type thing.

  • @"Christof Eb." said:

    Hi,
    FFT needs a lot of multiplications. P2 can do this very much better than P1, which has got no hardware multiply instruction. If you wanted to do pitch shifting with FFT, you would need a very high number of bins. In any case you will very likely need to code in assembler, if you want to use P1 or P2. Which can be learned..... Such project is definitely not a "one day's episode". There is an ADC set offered for P2 by Parallax and P2 can do DAC with a certain quality.

    Instead of using FFT pitch shifting is often done varying the sample rate between record and playback, which does not need too much math. This can be done with P1 and of course with P2 too.
    I think this: http://www.spinsemi.com/programs.php is a really great source of methods for sound effects. There is some code for pitch shifting.
    Good luck! Christof

    Yeah, I am thinking that the sample rate method might be the best way to go myself. Considering that I am thinking the device would be set to raise or lower the pitch in predetermined intervals (+/- an octave at most), this is probably the best way to go. I'll check out the webpage you recommended.

    Now I just need to figure out what ADC solution I am going to be using.

    Thanks!

  • If memory serves me, the Coyote OpenStomp came with a CD with all the files (design files and app files). Perhaps @"Ken Gracey" can locate that CD in the Parallax archives and have the files made available online. That said, I agree with others that if one is going to create a new version of this device, the P2 is a better choice. Not that it won't requires some external ADCs and DACs, but the memory, speed, and smart pins should make executing this kind of project.

  • I downloaded the Coyote OpenStomp files (pdf and a zip of the source files) back in 2012.

    The pdf file is too large to attach here in the forum, so you can get the files here

    The pdf does seem to contain schematics, but I don't know if those are the ones you were looking for

  • There is a video where Chip demonstrated a very easy way to do pitch shifting with the P2 and ring buffers instead of FFT. It uses two pointers for read and write which rotate with different angular speeds in the ring buffer. To avoid click noises when one overtakes the other a blending (soft fade in/out) is used. Could surely also be done with the P1 if external ADCs are used.

Sign In or Register to comment.