Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 16 of 16

Thread: Sharing some work and asking a couple questions

  1. #1
    Junior Member
    Join Date
    Jun 2019
    Posts
    11

    Sharing some work and asking a couple questions

    Hello all,

    I just wanted to share a project that I completed a while back with the help of a lot of people on this forum. (Thank you!) It's a Teensy synth that has an experimental interface-- instead of a chromatic keyboard like most synths, the pitch of the notes is controlled by sliders. This allows you to play chords and then kind of slowly bend them into other chords. It's a little bit like a pedal steel guitar, where a lot of the "sound" of the instrument comes from the note bends. Kinda creepy and ethereal.

    Here are a couple pictures, a video, a github link, and a couple tracks that I played the instrument on.

    Click image for larger version. 

Name:	Mutant II.jpg 
Views:	17 
Size:	105.5 KB 
ID:	19947 Click image for larger version. 

Name:	Mutant I.jpg 
Views:	10 
Size:	167.6 KB 
ID:	19946

    I've been thinking about creating a couple more iterations of this project, and I had a few questions in case anyone would be willing to give me their feedback/opinions.

    1. What is the ideal, lowest noise, way to power a teensy synth? This project has a 9V power input with a 5V regulator circuit. Could I get away with powering something like this just through the USB 5V bus? Are there implications for how much audio noise might come with any given solution?

    2. I do have a lot of high-pitched noise on the output of the instrument. What might be the common culprits of an issue like that? Are there ways I could reduce that? Would it make sense to throw some kind of analog low-pass filter on the output of the instrument?

    3. I'd like to try to do an iteration of this project with more potentiometer inputs. Is there a go to analog MUX for this type of thing that pairs well and easily with the teensy?

    Thanks so much for reading this and for any advice anyone might have.

  2. #2
    Looks like a fun project. I have recently completed my TeensyMIDIPolySynth (https://forum.pjrc.com/threads/60690...yMIDIPolySynth).

    On the question of analog MUXs: I made use of the SparkFun 16-channel analog MUX to manage my 48 pots & 42 pushbuttons (if you look at the link, you'll see in my description that I initially used the MUXs to also drive the LEDs, but that turned out not to be such a good choice). These MUXs are very easy to use, requiring 4 pins to select among the 16 "outputs", one analog pin for the common "input", & in my project, I do use the "enable" pin as well. I used one "master" MUX & cascaded 10 "slave" MUXs off of that, so I can confirm that they will work this way in case you need that capability.

    On the question of power: I made use of the Adafruit PowerBoost 1000 + 4000mAH LIPO battery. I can run the project on battery power, or I can run it from external USB power. The PowerBoost 1000 takes care of charging/managing the battery & does a good job of providing stable power in either case.

    Good luck & have fun !!

    Mark J Culross
    KD5RXT

  3. #3
    Member
    Join Date
    Jan 2020
    Location
    Italy
    Posts
    88
    74HC4067 is the mux that just works. Just avoid HCT, as this is a 5V version, while HC runs well on 3.3V

    If your circuit does not require more than 5V, you can power it all via the USB connector of the Teensy, also with a good (!) power bank, no problem. You just may use some filtering to clean power supply. This can be made if you separate VUSB from Vin by cutting the jumper on the board and connecting them via a filter instead.

  4. #4
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    Nice. Thanks, y'all. I'll check out that 74HC4067 and the Sparkfun analog MUX.

    Mark, I was just looking at your project. Really amazing work! I'm most impressed by the neatness of your wiring. Mine became a clusterf*** pretty quickly!

  5. #5
    toutant: In looking at other projects before I got started, "rats nest" can be applied to many/most of them. But hey, no need to look inside the box after it's all done . . . for me, function always wins out over form !! The most important thing is that the device works. In my case, since this was my first foray into the Teensy world, I fully expected that I'd be doing lots of troubleshooting (which unfortunately proved to be *very* right !!). I really didn't want to be chasing rats thru their nest . . . that's just my CDO nature !!

    I forgot to include earlier that the SparkFun analog MUX uses the same 74HC4067 in a form factor that makes it easy to wire up (all outputs on one side, all controls on the other side). In my TeensyMIDIPolySynth, I added pin headers & matching sockets on all of the MUXs, just in case I blew one & needed to switch it out. Luckily, I did not have to make use of that. Those analog MUXs are absolutely magical for saving pins, with only a slight increase in overhead !! My controls would most definitely have been severely limited without them.

    Mark J Culross
    KD5RXT

  6. #6
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    Ahh... Good to know about the MUX. I'll either buy the Sparkfun version or just buy the component and work it into a PCB.

  7. #7
    toutant:

    For reference, here's the actual SparkFun 16-channel Analog/Digital MUX Breakout part:

    https://www.sparkfun.com/products/9056

    When the MUXs were back-ordered, I've also bought the components (https://www.sparkfun.com/products/299) & 28-pin SSOP-to-DIP adapters (https://www.sparkfun.com/products/500) from SparkFun as well. The chip has 24-pins, so the extra pads on the 28-pin SSOP-to-DIP adapter made it convenient to mount a pull-down resistor for the active-low enable pin.

    Mark J Culross
    KD5RXT

  8. #8
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    86
    Your synth looks great, nice work.

    On your noise question have a look at this.

    Simply disabling the high pass filter on the audio board seems to help a lot (adcHighPassFilterDisable())

    cheers Paul

  9. #9
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    Awesome. I'll definitely try disabling that software filter. It sounds like I'm having the same issue as the person who wrote that.

    Thanks!

  10. #10
    toutant: any luck w/ disabling the high pass filter ??

  11. #11
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    Hey Mark. I'm actually not convinced that it makes much difference in my case.

    Here are some audio samples I just recorded.

    It looks like:

    -running the sketch with adcHighPassFilterDisable(), the noise and the synth are much louder.

    -running the sketch without adcHighPassFilterDisable(), the noise and the synth are much quieter.

    As far as I can tell, the signal to noise ratio remains the same. (After normalizing the audio, it's basically the exact same thing.)

    I may end up disabling the filter, just so I can get a hotter signal out of the instrument, but it's still has a pretty high level of baseline noise.

    If anyone has any other ideas, I'd love to hear them!

  12. #12
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    86
    @touting, couple of thoughts
    - do you have any flashy lens (neopixel or ws2812s or anything like that?)
    - are you setting the audio board with any other functions?
    - are you using line out or the headphone amplifier - to get a hotter signal you can use .lineOutLevel if using line out.
    - your codes sets volume to 1.0 which is too high and will add distortion if using headphone as output
    - can you check your gains at different stages of the code to make sure you are using a decent range

    cheers, Paul

  13. #13
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    Thanks for replying, Paul. Here's the source code and answers to your questions inline:

    do you have any flashy lens (neopixel or ws2812s or anything like that?)

    No, nothing like that connected to the board.

    are you setting the audio board with any other functions?

    Nope.

    are you using line out or the headphone amplifier - to get a hotter signal you can use .lineOutLevel if using line out.

    I'm using the line out, but haven't used .lineOutLevel. I'll give that a shot.

    your codes sets volume to 1.0 which is too high and will add distortion if using headphone as output

    What is a more appropriate volume level for the sgtl5000? I'm using the line out.

    can you check your gains at different stages of the code to make sure you are using a decent range

    Here's the mixer code. I'm trying to keep any given mixer under a total value of 1.
    Code:
      voice1mix.gain(0, .33);
      voice1mix.gain(1, .33);
      voice1mix.gain(2, .33);
    
      voice2mix.gain(0, .33);
      voice2mix.gain(1, .33);
      voice2mix.gain(2, .33);
    
      voice3mix.gain(0, .33);
      voice3mix.gain(1, .33);
      voice3mix.gain(2, .33);
    
      voice4mix.gain(0, .33);
      voice4mix.gain(1, .33);
      voice4mix.gain(2, .33);
    
      oscillatorMixer.gain(0, .25);
      oscillatorMixer.gain(1, .25);
      oscillatorMixer.gain(2, .25);
      oscillatorMixer.gain(3, .25);
    Thanks for any feedback.

  14. #14
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    OK. So setting lineOutLevel to the maximum value seemed to help a lot. There's still the same resting noise, but the signal to noise ratio is much higher now.

  15. #15
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    86
    Hi,

    That's good lineOutLevel helps a bit. Couple of additional thoughts:

    Here is the text from the design tool on volume, might not affect you as i think you are using line out only (if so do muteHeadphone() just to remove that from the equation)
    - volume(level);Set the headphone volume level. Range is 0 to 1.0, but 0.8 corresponds to the maximum undistorted output for a full scale signal. Usually 0.5 is a comfortable listening level. The line level outputs are not changed by this function.

    I'd be tempted to look at the gains at different stages of your design, what I normally do when developing / tuning and effect is :
    - put a peak object at each stage of the effect, at input, each mixer any combining objects (I see you use multiply). For your design pick a single voice and put peaks at each stage then one at the final mixer
    - put some code in the loop to print to serial the peak levels every second or so
    - monitor the levels in different conditions (everything at min, everything at max, one channel at max etc)
    - use that to then choose mixer gains etc to achieve a good use of full signal without ever distorting (>1.0)

    Could any of your design be 'leaking' when you have everything off / at zero (it looks as though the LFO is aways running through to the filter - could this be causing noise)? Try replacing your sketch with a really simple waveform and output object. If that creates same level of noise then that is likely just the noise level of your circuit, if not then something to look at in your design.


    cheers, Paul
    Last edited by houtson; 05-13-2020 at 08:53 PM.

  16. #16
    Junior Member
    Join Date
    Jun 2019
    Posts
    11
    OK. That's really helpful, Paul. That seems like a obvious way to start troubleshooting that I didn't think of--just breaking the whole thing into parts and tuning or recording each individual section.

    I'll dig in more this weekend.

    Thanks so much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •