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

Thread: A DX7 (Fm synthesis) replacement with Dexed on a Teensy

  1. #1

    A DX7 (Fm synthesis) replacement with Dexed on a Teensy

    Hi all,

    I started to port the a DX7 simulation named Dexed towards the Teensy. I already ported the code from JUCE to LV2 (https://github.com/dcoredump/dexed/tree/native-lv2) on i386 and ARM, for using it onto the Mod-Duo and Zynthian.

    Currently I have some trouble with the basics of Teensy and the Audio library (see here) - but I hope this can be solved - or there maybe a better way. If someone has fun to help coding, please let me know!

    Regards, Holger

  2. #2
    Senior Member
    Join Date
    Nov 2015
    Posts
    153
    It seems an interesting project!

  3. #3
    Currently I am getting a kind of "sound" out of the Teensy... but there seems to be much problems to solve before it works

    I created a simple MIDI shield for the Teensy for better testing and debugging:
    Click image for larger version. 

Name:	MIDI-Teensy.jpg 
Views:	23 
Size:	226.6 KB 
ID:	13779

    Regards, Holger

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,324
    Make sure you're using the latest beta. It has the newest audio library with the modulated waveform object.

    https://forum.pjrc.com/threads/52090...no-1-42-Beta-4

    People who tried to do FM synthesis with the old FM sine object found it too limiting, because it only gives a 1 octave modulation range. That's just not enough for many of the classic FM effects. It's also not quite the linear CV to octave relationship you'd need.

    The new modulated waveform object is meant to solve these old limitations. It can do FM up to 12 octaves range, allowing even sub-sonic waveforms to modulate all the way up to 20 kHz (though the default is 8 octaves, allowing a 0-1.0 signal to do roughly the "1 volt per octave" that's common with modular synth). It has octave proper scaling like you'd expect from any analog synth. It can also do 8 other non-sine waveforms, and you can use phase modulation instead of frequency, if you prefer.

  5. #5

    Smile

    Quote Originally Posted by PaulStoffregen View Post
    Make sure you're using the latest beta. It has the newest audio library with the modulated waveform object.

    https://forum.pjrc.com/threads/52090...no-1-42-Beta-4

    People who tried to do FM synthesis with the old FM sine object found it too limiting, because it only gives a 1 octave modulation range. That's just not enough for many of the classic FM effects. It's also not quite the linear CV to octave relationship you'd need.

    The new modulated waveform object is meant to solve these old limitations. It can do FM up to 12 octaves range, allowing even sub-sonic waveforms to modulate all the way up to 20 kHz (though the default is 8 octaves, allowing a 0-1.0 signal to do roughly the "1 volt per octave" that's common with modular synth). It has octave proper scaling like you'd expect from any analog synth. It can also do 8 other non-sine waveforms, and you can use phase modulation instead of frequency, if you prefer.
    Ok, will do so! But for the MicroDexed-project I only need the AudioQueue (and later some effects) because the complete engine is based onto Dexed which does the whole sine-modulator-carrier-thingy.

    For now I have a running version which supports only one hard coded FM-Piano sound: BUT IT WORKS!!! Currently it is not really ready for using it widely. There is no MIDI input queue (so events get dropped) and no sysex sound loading - also some controllers are not mapped and so on... I will do this the next days/weeks, so I hope to have a full DX-7 compatible sound engine with a Teensy.

    Regards, Holger

  6. #6
    Here we go: A first working version of Dexed (a Yamaha DX7 like synth) is located at GitHub: https://github.com/dcoredump/MicroDexed.

    What currently is working:
    - Up to 10 tones at the same time (on a Teensy-3.5, perhaps the 3.6 can handle up to 16 tones a time)
    - Only one hardcoded voice (FM-Piano)
    - All controllers

    What next?
    - SysEx data reading from SD card
    - Perhaps adding some effects (reverb, chorus, eq)
    - Testing with a Teensy-3.6

    Regards, Holger

  7. #7
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,103
    Nice!

    Unless you really do need double, it would be faster to declare your floating point variables as float (and use the single precision math calls like sinf, logf rather than sin, log). Then the hardware FPU in Teensy 3.5 and 3.6 will be used.

    In Dexed::ProcessMidiMessage your NoteOn code does not take account of MIDI running status. Given that your input is DIN MIDI, you are likely to encounter that in practice. Check for a NoteOn velocity of zero and if found, treat as a NoteOff (and if using release velocity, assign a release velocity of 64).

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,324
    Quote Originally Posted by C0d3man View Post
    Here we go: A first working version of Dexed (a Yamaha DX7 like synth) is located at GitHub: https://github.com/dcoredump/MicroDexed.
    Any chance for a youtube video, or even just a photo?

    We can probably show this on the website blog, but at least 1 picture is required.

  9. #9
    Quote Originally Posted by Nantonos View Post
    Nice!

    Unless you really do need double, it would be faster to declare your floating point variables as float (and use the single precision math calls like sinf, logf rather than sin, log). Then the hardware FPU in Teensy 3.5 and 3.6 will be used.

    In Dexed::ProcessMidiMessage your NoteOn code does not take account of MIDI running status. Given that your input is DIN MIDI, you are likely to encounter that in practice. Check for a NoteOn velocity of zero and if found, treat as a NoteOff (and if using release velocity, assign a release velocity of 64).
    Many thanks for your comments!!!

    I replaced the doubles with a macro in synth.h (
    Code:
    #define FRAC_NUM float
    ), so only floats are used now. I also replaced all sin() and log() to their float variants. But mostly this does not affect anything while playing, because it seems that this all is mainly used in the initialization functions for the lookup tables (AFAIK the real DX7 also works with LUTs).

    The NoteOn with a velocity of 0 is recognized in the underlying keydown() function:
    Code:
    void Dexed::keydown(uint8_t pitch, uint8_t velo) {
      TRACE("Hi");
      TRACE("pitch=%d, velo=%d\n", pitch, velo);
      if ( velo == 0 ) {
        keyup(pitch);
        return;
      }
    And release velocity is ignored in keyup().

    Again: many thanks! It is really a big help if someone else is looking at my code...

    Regards, Holger

  10. #10
    Quote Originally Posted by PaulStoffregen View Post
    Any chance for a youtube video, or even just a photo?

    We can probably show this on the website blog, but at least 1 picture is required.
    I can try to make a video the next days/weeks. Currently I have to solder the line out on my audio shield for recording the sound directly into the cam

    I have posted a picture some messages above - but this is not really spectacular... so a viceo with sound would be the better choice. I will post a link here when I am ready.

    Regards, Holger

Tags for this Thread

Posting Permissions

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