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

Thread: teensy synth 101 on audio board?

  1. #1

    teensy synth 101 on audio board?

    i found this awesome synth developed by brian peters but he's not touched synths a few years now. i got it compiled and uploaded using arduino classic 1.06, but before i can hear anything i gotta build all the breadboard stuff. i'd rather use my new audio board tho - how do i go about converting this to the audio board?

    https://github.com/brianmarkpeters

    can i just change the pin numbers or do i have to do more complicated shit?
    oh and hi everyone btw!

  2. #2
    any idea of which pin translates to which pin?
    i've found the instrutables for the original on wayback machine...
    http://web.archive.org/web/201411050...ynth/?ALLSTEPS

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,927
    From a quick look at the code, it seems to output an analog signal on the DAC/A14 pin, and digital waveforms on these 4 digital pins:

    Code:
    const unsigned int audioFour = 20;
    const unsigned int audioThree = 10;
    const unsigned int audioTwo = 9;
    const unsigned int audioOne = 6;
    Looks like there's a lot of good work in that old project. But without a clearly stated open source license, I'm reluctant to spend much time with this code or merge any of it into the audio library.

  4. #4
    i've spoken to brian, i could ask him if he was willing to let it go, he has been very helpful...

  5. #5
    but for now can i just change pins on these to pins that work with audio board?
    Last edited by leolodreamland; 03-02-2016 at 10:57 PM.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,927
    Looks like his code uses PWM at different frequencies for audioOne and audioTwo, so those 2 would need to be PWM pins controlled by different timers. Documentation about which pins are controlled by which timers can be found here: (scroll to "PWM Frequency")

    http://www.pjrc.com/teensy/td_pulse.html

    Looks like any digital pins can be used for audioThree and audioFour.

    Again, I'm reluctant to put much more work into this code if it can't be shared.

    To adapt and accept it as a contribution to the audio library (which I'd love to do), Brian would need to release it with the MIT license. I can understand he might be reluctant to do so, since MIT allows commercial use.

  7. #7
    not going to happen...
    This is actually one project of mine that's out there that I really wish wasn't- it's really really poor code that I made very quickly as a proof of concept that some friends asked to see in an unfinished state and somebody put it on the internet for me and it kind of got carried away. I've made a couple versions of this since then that are much much better and have plans to make one that is even better than those. I got derailed when a company inquired about buying the newer algorithms from me, which led to talks about mass producing synthesizers based on those algorithms, but then we hit some roadblocks with the FCC and that got put on hold. So, I don't really even know what's happening with the newer versions, but the old one is definitely one that I don't want to spread around.

    Also, regarding the audio library, that kind of defeats the original purpose of what I wanted to do, which was to hear the natural switching characteristics of the digital outputs of the teensy being used for gritty chiptune audio. I feel like the audio library would just make it a sort of generic thing, but I can explore that in the future too. I'll keep you posted if I get permission to release the newer teensy synth algorithms, which are much much more in tune and the program uses the analog output (so it doesn't require a transformer on the digital out.) Right now I'm completely inundated with starting up a composing company, a video game company, going through a divorce, moving, and a bunch of other little stuff, so I don't know what the immediate future holds yet. I'm curious if I get one of those audio boards if it'll spark some new ideas for other synths too. So we'll see! I'll send you an email if I make some progress with either.

    -Brian

  8. #8
    Quote Originally Posted by leolodreamland View Post
    i found this awesome synth developed by brian peters but he's not touched synths a few years now. i got it compiled and uploaded using arduino classic 1.06, but before i can hear anything i gotta build all the breadboard stuff. i'd rather use my new audio board tho - how do i go about converting this to the audio board?

    https://github.com/brianmarkpeters

    can i just change the pin numbers or do i have to do more complicated shit?
    oh and hi everyone btw!
    FWIW: I played with Brian's synth implementation a bit, and got it working on a teensy. It's very cool! But it did not require the audio board, or the audio library. Like he said, it's the very opposite of that: it's all about the 8-bit gritty nature of waveforms created by various forms of simple PWM. Paul's goal with the audio board was to remove such grit, so ...

    If I recall correctly, all I had to do to make Brian's code work on my teensy was to change some pin definitions. But if you want to do this while your teensy is connected to the sound board, you'd better make sure that you're doing it on pins that aren't used by the board, or even connected to it. I believe there's a lot of super-high-frequency noise present on those pins, and you wouldn't want that in the rest of your circuits. Check your documentation; there are a lot of pins to play with.

    Brian's suggested audio output circuit uses a line-transformer, like you'd use for converting from balanced mic connections to unbalanced line-level connections. I think that's partly to get the impedence right, but also partly to use the transformer as a choke for filtering out those ultra-supersonic switching frequencies.

    Later on at a Dorkbot meeting I played around with taking the signal from other places on the board and running it directly into a small speaker with no other amp. That worked surprisingly well but only for a very low volume. Again, the magnetic coil in the speaker acts as a choke, aka a low-pass filter that passes audible frequencies but not much higher up. You need something to remove those.

    If you don't want to deal with a transformer, I can relate. I imagine some kind of RC circuit could filter that for you, but I don't know how to design those. I'd start with the advice that Paul gives here: https://www.pjrc.com/teensy/td_pulse.html

Posting Permissions

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