Detune Pedal (Based off Octaver code)

8 years 5 months ago #369 by ZagatoZee
Is there likely to be any benefit in changing the Due+PedalShield code, to run at 48KHz (same sample rate as the rocksmith realtone cable uses), from a noise or other random artefacts point of view?

I still really need to get my head around programming again - haven't done any in over 20 years - But I'm thinking of a way to use this code as a base, then use the second toggle switch and pot to control things like off a440 tuning. (switch totally bypasses/enables that part) I also think that could be used to correct the slight re-tune currently needed on some of the tuning drops.

Think of it as a fine tune adjustment on the steps already used.

I don't even know the computational limitations of the Due+PedalShield combo however, so if I'm getting too ambitious with the ideas in my head - please let me know.

Please Log in to join the conversation.

8 years 5 months ago - 8 years 5 months ago #370 by Phaedrus74
It shouldn't matter since the pedalshield DAC converts the sampled sounds back to a (continuous) analog signal, this signal is then converted by the Rocksmith ADC @ 48 kHz samples.

As an aside: your previous post had me going back to the drawing board to attempt a continuous pitchshifter, and I actually managed to get it kinda working. (I was wrong :lol: you don't need a hexaphonic pickup!)

However the performance isn't really good enough for my taste (it lags really bad) which is probably due to all the floating point math it has to do. When I get home this afternoon I'll upload the code so you can play around with it.

With regards to getting your head around programming again: I hear you, this project was my first in a long long time. Which is the reason it turned out I was wrong about continuous pitchshifting, I saw your post this weekend and thought: "Wait a minute! What if I try this..."

Your brain is a muscle ;) It needs practice.... I can slowly feel my Math-intuition coming back.

Please Log in to join the conversation.

8 years 5 months ago #371 by Phaedrus74

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

8 years 5 months ago #372 by Ray

Is there likely to be any benefit in changing the Due+PedalShield code, to run at 48KHz (same sample rate as the rocksmith realtone cable uses), from a noise or other random artefacts point of view?


From the sampling theory point of view, increasing the sample rate will always benefit the noise reduction, there is a nice topic explaining how to modify the sampling frequency:
DSP and Setting the Sampling Frequency in Arduino

In a nutshell, sampling at 44.1 or 48Khz will satisfy the Nyquist theorem but if we go even higher i.e 96Khz the anti-aliasing filter will reduce the undesired harmonics even better.
Unfortunately increasing the sampling rate will use more resources, for instance a delayed signal will take more memory to be saved.

There is also a nice article about The Science of Sample Rates (When Higher Is Better — And When It Isn’t)

Please Log in to join the conversation.

8 years 5 months ago #373 by Phaedrus74
Cool, I'll definitely be looking into that :)

Please Log in to join the conversation.

8 years 5 months ago - 8 years 5 months ago #375 by ZagatoZee
I finally got around to having some time to play with your new version of the code with the continuous pitch shift - it works well.

Yes there is a slightly more latency than using the previous versions and there is an odd crackle sound while tuning - but that doesn't seem to obvious while playing songs.

I just tested on a guitar tuned in Drop-d - playing songs in EbdropDb and DdropC without any retuning of the guitar required at all - so from that aspect your code is good!

* edit: If I can give some feedback however - I just retuned to e-stnd and then played a song in B-standard tuning (86% on first attempt!!). The range of the pot to get that detune (already technically lower than Rocksmith is capable of "detecting"), is only 12-oclock to 10-oclock, while the pot has the range to go to 7-oclock. I'm not sure exactly on the math required, but perhaps a lowering (or raising) of the ratio value may allow more of the pots range to be used - and in the process - maybe allow the easy adjustment to off a440 tuning?

Please Log in to join the conversation.

8 years 5 months ago #376 by ZagatoZee
Ignore me if I'm talking crap here and this is impossible - just spitballing for now...... I saw the post about mixing effects on 1 pedal and that got me thinking;

Is it possible to use SW3 (the right hand toggle switch) to enter a "program mode" where the continuous pitch shift program can have its value set, then when the switch is moved to the other position - the value at the time the switch was moved, is the one now used as a solid point for all ongoing math?

Eg: SW3 up = continuous pitch shift code while reading for changes in the value of RV2.
SW3 down = pitch shift code but using a hard value for RV2 - as defined by the last value of RV2 when switch moved.

So, you move the switch up when tuning to a non E-standard/DropD tuning. As soon as the tuner likes your position for RV2, flick the switch down and go through the other strings.

Would doing something like that - theoretically reduce the computational overhead when it's really needed - ie, in a song?
The following user(s) said Thank You: Ray

Please Log in to join the conversation.

8 years 5 months ago - 8 years 5 months ago #377 by Phaedrus74

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

8 years 5 months ago #378 by ZagatoZee
Hey, I've been using this revised code for a while now and it's pretty much perfect! I've played about with changing the range adjustments, but I'm no longer certain it's really "needed". I was able to adjust to correct for the Jimi Hendrix pack and it's off a440 tuning without touching my tuning pegs and am regularly switching around between Estd/dropD to every tuning I want within rocksmith. No idea if using the switch for the tuning lock actually reduces the computational load, but it seems cleaner sounding to me - and that is ultimately the goal.

Just something I'd like to note;

Phaedrus74 wrote: ... but since the potentiometer (or my powersupply) is a bit noisy I think this will help with the soundquality.


I found with my pedal shield that not pushing the pins that connect the shield to the Duo all the way down, but leaving about 5-6mm of the pins showing, reduces noise from the shield drastically. Maybe I goofed on something somewhere, but that "fix" works for me. As does using a non usb based power supply, I'm using a boss style PSU that I've wired up an adapter to go from center-ve to the center+ve that the arduino needs.

I do also run the output from my shield into a DI box and connect my amp to the pass-through and the rocksmith realtone cable with the ground lift feature activated, on the balanced output side. This setup essentially removes ALL extra noise from my setup, but is needed more because I'm using my amp and rocksmith at the same time, rather than anything to do with the PedalShield.
The following user(s) said Thank You: Phaedrus74

Please Log in to join the conversation.

8 years 5 months ago #379 by Phaedrus74
It's good you didn't give up on the dream of continuous pitchshifting :lol:
This version of the code does work better and it sounds cleaner.

Regarding the noise issue, when I use the pedalshield over my amp or listening directly in windows the noise isn't too bad, just a mild clicking when the buffer jumps back to the start (I think that's it at any rate).

Rocksmith however applies extra processing to the signal which boosts the highs to the extent that the clicking interferes with the tuner. (The output level of my EMG's isn't particularly high and that doesn't help I think)

I'll check out your suggestions to solve it, although the DI route will probably make my neighbors sad. :)

The easiest solution is probably to create a custom amp setup in Rocksmith specifically for tuning.
And I think I will build a physical low-pass filter (I have a bunch of caps and resistors lying around) as soldering practice.

Please Log in to join the conversation.

Time to create page: 0.095 seconds