Frantz’s Status Report for April 26

This Week’s Accomplishments:

This week, I finished the delay and sequencer, and I have nearly finished the real-time pitch shifter, with the exception of some debugging and edge-case testing.

As it turns out, using statically allocated memory is a lot easier than dynamic memory. Using pre-allocated memory buffers for storing the data is easier to implement, and it doesn’t take as many resources to run. With latency being such a concern, trading off space in favor of time is an easy decision. With window length down to 512 (instead of 2048), that also cuts our memory usage for the pitch-shifter. Nevertheless, with so much extra memory, this is not an issue.

After some debugging, the pitch-shifter does not segmentation fault anymore. Still, the output doesn’t match what it should be – I will check for implementation mistakes, testing with simple signals and moving on to actual guitar audio is going to help.

We will be finishing tomorrow.  We are almost there!

Team Status Report for April 19

Our most significant risks are if the Daisy Seed microcontroller doesn’t work as planned. We have already had to modify multiple segments of code to sidestep issues that have popped up, including not being able to access most of our microcontroller’s memory without a specific keyword. The Daisy user forums have been helpful for solving a lot of issues like this one, thankfully. Nevertheless, we are planning to complete more intermediate tests to catch any more issues that arise. We are also awaiting the arrival of our PCB, but we have connected our components with a wired circuit prototype, which works in our tests. We will build a soldered devboard as backup.

The only major change in our implementation was inserting an RC low-pass filter both before and after the signal passes through the microcontroller to cut out high-frequency noise. Also, we have made a few implementation tweaks. We have modified some code to account for quirks in the microcontroller, and we have made backup circuits for connecting our components.

We are slightly behind schedule, due to the PCB arriving late. However, we have been making major progress in integrating our parts together. Our tests have been fruitful. We will be testing extensively this week as we bring our individual components together.

Frantz’s Status Report for April 19

This Week’s Accomplishments:

This week, I made some more progress on the real-time pitch shifter. In the meantime, I also wrote code implementing the “delay” and “sequencing” functions.

We spent plenty of time testing our microcontroller with input from a function generator and a guitar, sending the output to an oscilloscope. We got our microcontroller to succeed in a few tests: first, we had it send input to output unmodified; then, we had it repeat an input once; next, we had it operate with the delay and sequencer functions. For the second of these, we played the output on a small speaker and heard the repeated strum. For the third, we verified that the time delay and the amplitude scaling matched our hard-coded parameters.

Early in our testing, realized that most (64MB of 65MB) of our microcontroller’s memory was in SDRAM that wasn’t able to be allocated normally. After a while, we discovered a way to statically allocate memory into SDRAM on the Daisy Seed microcontroller: using the keyword “DSY_SDRAM_BSS” when initializing an array. This allowed our microcontroller to fit our delay and sequence buffers, each containing 2 s worth of samples, into memory.

We also have worked on our presentation slides for next week. We took images and video of some of our results as documentation of our progress and testing.

Schedule-wise, we are catching up and nearly finished. We are integrating a lot of our independently-creating components, and the resulting progress has been quite a relief. We will continue integrating this week, and I will finish the delay and sequencer code, accounting for some edge cases and more user input. I will also finish the pitch-shifting as soon as I can.

During capstone, I have honed skills such as task delegation, communication, considering end users, and prototyping code. However, I have also learned a very concrete skill: coding in C++. I started learning the basics using a couple short online video tutorials. I started by building a function that I could use to test the pitch-shifter. This allowed me to make progress while making a program that would be easy enough for me to get the hang of the language. I also have used a lot of online resources, such as the C++ documentation site and Stack Overflow, to answer questions in regards to implementation.

Team Status Report for April 12

The most significant risks we face are the PCB not working, the microcontroller taking too much time to complete the operations, and the output being too noisy. We have contingencies for all of these possibilities: we are making a backup devboard for connecting our components if our PCB is faulty, we are using a low-pass RC filter to remove high frequency noise from our output signal that could cause aliasing before our microcontroller’s ADC, and we are prepared to change macros in the code that will change the window size in case 2048 samples is too many for low-latency pitch shifting.

We slightly changed our implementation, primarily in the physical structure of our pedal. We are accommodating a PCB with a larger size than originally anticipated. Overall, this shouldn’t change costs too much; it may require slightly more 3-D printing material.

We are slightly behind schedule, so all of our remaining work will be compressed into the remainder of our time. We will each be devoting a lot of time to covering the last touches of our implementation, testing, and our final deliverables.

We are planning to test our pedal by measuring its output by ear and using an oscilloscope. This should allow us to measure our latency (by calculating the difference between the peaks and troughs in our input and output signals) and signal-to-noise ratio with precision, and we can ensure our pedal works within our use-case requirements. We will be sending musical signals into our pedal via a function generator and a guitar (including multiple styles of playing) as well as chaining our pedal in series with other pedals, to ascertain that our pedal works in a real-life setting. Naturally, we will be running tests with all of our pedal’s parameters and ensuring that changing the parameters during use poses no issues.

Frantz’s Status Report for April 12

This Week’s Accomplishments:

This week, I spent a lot of time working on my C++ code, to be loaded onto our microcontroller. I have completed most, but not all of the real-time pitch-shifting algorithm, with quite a few roadblocks. The first was that I found great difficulty in importing a library for computing the Direct Fourier Transform. In order to minimize the difficulty of interacting with a new interface, I wrote my own DFT code myself, following the Cooley-Tukey radix-2 algorithm. I also wrote code for the Inverse Direct Fourier Transform, which was a simple edit of the DFT code.

Here is my current DFT code, with some print debugging commented out:

I have not yet optimized my code for quickness or implemented garbage collection, which will be necessary for programming in C++. However, I have tested my code and found that for a few test inputs, my output matches that of the Python function “numpy.fft.fft”.

I have found some difficulty in converting my previous Python algorithm not just into C++ but into a real-time operation. This is still in-progress. I will need to test my code’s performance to ascertain what amount of latency is safe.

I have used the micro-USB cable I ordered to connect our microcontroller to my laptop. Next week, I aim to start by learning how to use the Daisy Library to receive input samples and send output samples. I will then implement the “delay” functionality, which is comparatively simple.

We are somewhat behind our original schedule and a little pressed for time. Nevertheless, we are confident in our ability to complete our project in the next week. I will spend a lot of time completing and testing my code within the next few days.

Frantz’s Status Report for March 29

This Week’s Accomplishments:

This week, I began programming in C++. I first created functions to extract samples from a .wav file and create a new .wav file using a list of samples. This allows us to easily test our algorithms using imported sound files. Then, I began reworking the pitch-shifting algorithm in C++. I am modifying it so it completes the task in chunks, which is vital for outputting data in real time with minimal latency. I tried importing the FFT library “shy_fft,” but it doesn’t seem to work properly. After a lot of troubleshooting, I switched to “FFTW.”

Additionally, I ordered a micro-USB cable with data transmission for connecting our microcontroller to a computer.

Status:

Our schedule is on track, but time is getting tight. We will stay diligent to complete our project satisfactorily.

Next Week:

Next week, I will continue rewriting the phase vocoder algorithm for real-time use in C++. I will test the FFTW import to ensure that it works properly. When I am done, I will start writing the delay algorithm.

Frantz’s Status Report for March 22

This Week’s Accomplishments:

This week, I have written the phase vocoder algorithm in Python. It successfully shifts our test tone by a given number of semitones up or down. There are currently some harmonics introduced in the process that I will need to debug, but the output is coherent. I also tested the input levels coming out of a guitar using an oscilloscope. I noticed that there is a significant amount of noise above the threshold of human hearing. So, we decided that we can use a simple RC filter to remove the noise before the signal gets input into the Daisy Seed. This should avoid any issues with aliasing. We also completed part of the Ethics Assignment this week.

Status:

Now that the phase vocoder pitch shifter works, progress is back on track.

Next Week:

Next week, I will start rewriting the phase vocoder algorithm in C++. Notably, for real-time input, I will need to use a circular buffer to store the signal while each batch is being operated upon. I will determine if I need to write a fast Fourier transform algorithm or if we can import a (or use an already-imported) library.

Frantz’s Status Report for March 15

This Week’s Accomplishments:

This week, I completed the time-stretching portion of the pitch-shifting algorithm. I have started the phase vocoder portion as well, which is vital to keeping the sound coherent. I also completed Steps 1-3 of the Ethics Assignment. I discussed next steps with my team.

Status:

My progress is still slightly behind schedule, but since this week was scheduled as slack time, I have caught up a bit. The pitch shifter is unsurprisingly difficult, and I will need to focus significantly on the circular buffer used in making this a real-time operation.

Next Week:

Next week, I will complete and test the phase vocoder algorithm in Python, and I plan to begin the process of rewriting it in C++. My team and I will also test some of our materials with an oscilloscope in the lab. I will bring my guitar and some cables in provide input signals for this testing.

Team Status Report for March 8

Our biggest risks remain that any of our components do not function. Thankfully, the Daisy Seeds have arrived, and they have no apparent issues, so we have a microcontroller and a backup. However, we still have more components that have yet to arrive. We have configured a list of materials that we will order, and we plan to test them rigorously so we know that they function as intended.

This week, our design has stayed more or less the same. We have configured some finer details, including the size of the PCB that will be housed in the pedal.

Our schedule has not seen significant changes. Some issues have pushed work into slack time, so we are somewhat behind schedule, but our order of operations remains the same.

 

Part A (Chaitanya Irkar):

​​When designing and conceptualizing our pedal, one of my primary initiatives was to deliver a compact, easy-to-use product that could be enjoyed on a global level. We understood that not all consumers of our product will have access to the same high-quality resources available to us as CMU students. Emphasis on portability removes an physical restrictions for transporting or even delivering the product to individuals around the globe. It can also easily be shared by bandmates, gifted to friends, and easily stored in any environment, making it catered to individuals of all musical backgrounds. We also spent a significant amount of time designing our pedal interface (knobs, switches, buttons) to make it easy to adjust and view pedal settings. The only “complex” component of our design are the pcb board and Daisy microcontroller. These components will be hidden inside the pedal casing, limiting access to any harder-to-use parts. While our product does promote usage amongst people all over the world, it does require a power supply which could serve as an obstacle for users in areas of unsteady electricity. Such a factor is difficult to mitigate in the context of a guitar pedal design due to the necessity of a power supply to operate. However, we hope that our basic user-interface and other design choices will compensate for any other shortcomings outside of our control.

 

Part B (J. Frantz): 

Our pedal will allowsfor users to subdivide the repeat period into either four or three portions, matching how most contemporary music uses binary or ternary meters. These encompass the most simple divisions of time in music, and there will be a wide range of customization granted by allowing the user to select a meter.

Notably, our pitch-shifting is planned to use 12-tone equal temperment tuning in order to calculate the intervals. This is a standard that is used throughout most contemporary music today, but this is not the only tuning system that exists. Microtonality is prevalent in genres like Indian classical music, but our pedal’s pitch-shifting will not account for this.

These simplifications are design choices made with a semester’s scope in mind. Our primary goal is to make a device that is useful for a wide range of musicians, and we wanted to keep our design simple enough. Allowing for a wider range of meters and tunings is a possible goal for further improvements beyond our capstone.

One important cultural factor to consider is that the general public would not like to be subjected to excessive noise. Therefore, in our delay mechanism, we will restrict the amplitude scalar for each successive delay to be not more than unity. This will ensure that the input sound will not grow exponentially loud and harsh for people in the vicinity.

 

Part C (Nick W):

The main environmental considerations for our project come in production and the energy efficiency of operation. For production the main concerns are the materials used, and how they are produced. Considering this, we are using mass produced interface parts, which don’t have much environmental impact, 3D printing our casing to minimize waste, and using a standard PCB manufacturer, but would likely search for an environmentally friendly manufacturer if these were mass produced. For energy efficiency, we can’t save power in many places since we need most components to be on while the effect is active, but we will turn off some parts such as the screen when the effect is off.

Frantz’s Status Report for March 8

This Week’s Accomplishments:

This week, I continued to make progress on the pitch-shifting algorithm. I retrieved the Daisy Seed microcontroller, and verified that it connected with my computer so I could load a program onto it. I also began teaching myself how to program in C++, as the Daisy Seed uses that language to be programmed.

Status:

My progress is slightly behind schedule since I haven’t finished programming the phase vocoder algorithm, but it is moving along steadily.

Next Week:

Next week, I will reconvene with the team after spring break. I plan to continue programming the phase vocoder pitch-shifting algorithm, and I will research how to rewrite it in C++, a language I am a beginner in. For example, I will determine if I need to write my own direct Fourier transform algorithm or if I could import one.