Jump to content

nemui-kuma

Members
  • Content Count

    14
  • Joined

  • Last visited


Reputation Activity

  1. Like
    nemui-kuma got a reaction from dangpzanco in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  2. Like
    nemui-kuma got a reaction from losinggeneration in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  3. Like
    nemui-kuma reacted to oPossum in 2^N for real numbers using integer math   
    When working with electronic music (MIDI synth and such) it is sometimes necessary to adjust pitch by units of octaves, semitones, or cents.
     
    An octave is a 2:1 ratio. So the ratio between any number of octaves is 2^N. This is a simple bit shift. Easy.
     
    A semitone is 1/12 of an octave (typically), so the ratio for that is 2^(N/12). A cent is 1/1200 of an octave, so the ratio for that is 2^(N/1200). Can't use bit shifting for that!
     
    The C stdlib provides the pow() function that can be used for these calculations, but it uses rather slow floating point math.
     
    This code will do it with relatively fast fixed point integer math. This code could easily be adapted to almost any base and exponent by changing the look-up tables. It uses the property of exponents that 2 ^ (1 + 2 + 4 + 8) == (2 ^ 1) * (2 ^ 2) * (2 ^ 4) * (2 ^ 8)
     
     
    // // 2 ^ (n / (1200 * 8192)) // // n = 1 / 8,192 cent //   = 1 / 819,200 semitone //   = 1 / 9,830,400 octave // // range of n: -134,217,727 to +78,643,199 //            = -13.65 to +7.99 octaves // // returned value is 8.24 fixed point // // + exponents in 8.24 format static const uint32_t etp[27] = {     0x01000001,                     // 00000001  1.0000000705     0x01000002,                     // 00000002  1.0000001410     0x01000005,                     // 00000004  1.0000002820     0x01000009,                     // 00000008  1.0000005641     0x01000013,                     // 00000010  1.0000011282     0x01000026,                     // 00000020  1.0000022563     0x0100004C,                     // 00000040  1.0000045127     0x01000097,                     // 00000080  1.0000090254     0x0100012F,                     // 00000100  1.0000180509     0x0100025E,                     // 00000200  1.0000361021     0x010004BB,                     // 00000400  1.0000722054     0x01000977,                     // 00000800  1.0001444161     0x010012EE,                     // 00001000  1.0002888530     0x010025DE,                     // 00002000  1.0005777895     0x01004BC1,                     // 00004000  1.0011559129     0x01009798,                     // 00008000  1.0023131618     0x01012F8B,                     // 00010000  1.0046316744     0x0102607D,                     // 00020000  1.0092848012     0x0104C6A1,                     // 00040000  1.0186558100     0x0109A410,                     // 00080000  1.0376596592     0x0113A513,                     // 00100000  1.0767375682     0x0128CC11,                     // 00200000  1.1593637909     0x01581889,                     // 00400000  1.3441243996     0x01CE81F4,                     // 00800000  1.8066704016     0x0343994D,                     // 01000000  3.2640579400     0x0AA77169,                     // 02000000  10.6540742354     0x71826157                      // 04000000  113.5092978129 }; // - exponents in 8.24 format static const uint32_t etn[27] = {     0x00FFFFFF,                     // 00000001  0.9999999295     0x00FFFFFE,                     // 00000002  0.9999998590     0x00FFFFFB,                     // 00000004  0.9999997180     0x00FFFFF7,                     // 00000008  0.9999994359     0x00FFFFED,                     // 00000010  0.9999988718     0x00FFFFDA,                     // 00000020  0.9999977437     0x00FFFFB4,                     // 00000040  0.9999954873     0x00FFFF69,                     // 00000080  0.9999909747     0x00FFFED1,                     // 00000100  0.9999819495     0x00FFFDA2,                     // 00000200  0.9999638992     0x00FFFB45,                     // 00000400  0.9999277998     0x00FFF689,                     // 00000800  0.9998556048     0x00FFED13,                     // 00001000  0.9997112304     0x00FFDA28,                     // 00002000  0.9994225441     0x00FFB455,                     // 00004000  0.9988454217     0x00FF68C1,                     // 00008000  0.9976921765     0x00FED1DC,                     // 00010000  0.9953896791     0x00FDA51C,                     // 00020000  0.9908006133     0x00FB4FC4,                     // 00040000  0.9816858552     0x00F6B582,                     // 00080000  0.9637071184     0x00EDC157,                     // 00100000  0.9287314100     0x00DCCF8E,                     // 00200000  0.8625420320     0x00BE7564,                     // 00400000  0.7439787570     0x008DB277,                     // 00800000  0.5535043908     0x004E6E13,                     // 01000000  0.3063671106     0x00180743,                     // 02000000  0.0938608065     0x0002415D                      // 04000000  0.0088098510 }; uint32_t tpow(int32_t n) {     const uint32_t *et = etp;           // Assume + exponent     if(n < 0) n = -n, et = etn;         // Adjust for - exponent                                         //     uint32_t r = 1L << 24;              // Init result to 1.0 in 8.24 format                                         //     do {                                //         if(n & 1) r = mul824(r, *et);   // Multiply by exponent if lsb of n is 1         ++et;                           // Next exponent     } while(n >>= 1);                   // Next bit, loop until no more 1 bits                                         //     return r;                           // Return result }
  4. Like
    nemui-kuma got a reaction from larryfraz in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  5. Like
    nemui-kuma got a reaction from Rickta59 in TI's memory of choice   
    For serial Sram your only choice is Microchip, Onsemi has 4 serial sram chips, but they are smaller and more expensive.
    For serial flash, there are a lot of choice, but i guess companies who only make memory chips aren't Ti s competitors really (like Micron).
  6. Like
    nemui-kuma got a reaction from RobG in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  7. Like
    nemui-kuma got a reaction from bluehash in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  8. Like
    nemui-kuma got a reaction from EngIP in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  9. Like
    nemui-kuma got a reaction from oPossum in 16 voice wavetable synth/sampler with MSP430G2553   
    Hey forum!
    I always wanted to make a synthesizer , so i chose the msp430 launchpad, because it's one of the most inappropriate chip i can use for it  :grin:
    When i started to make it i didn't have real goal, i just wanted to make a sound, so this project is kind if all over the place but i have learned a lot doing it so it was totally worth it.
     
     
    The DAC used is a  TI TLC5615, it's not the best choice, but i only had this in my parts bin.
    Probably any other SPI DAC could be used with minimal modification, or even PWM.
    (I don't sound good with PWM IMO.)
    The TLC5615 needs 5 volts, but it seem to run good with 3.6 volt from the launchpad,or you could use TP3 (the USB 5V) but that can be noisy, I used a separate 5V supply.
     
    The crystal is required, because it tunes the DCO on every start up to a pre-defined value
    ( i ran it at 19Mhz without any problems)
    If you change the frequency , you only need to change the bit rate divider for the USCI UART.
     
     
    There are a lot to optimize/rewrite but i kind of grew tired of playing with variables to get a few more bytes of free ram.
    Maybe i'll rewrite it on an F5510 as it would be a much better choice because it has 8 x Ram as much ram and a hardware multiplier.
     
     
     
    This is a synth with 16 voice of polyphony. It accepts midi massages from 1-8 and 10 (for the drum sounds). Each midi channel has it's own different settings for: -MIDI program  -LFO width and speed  (CC01 for combined mod wheel control, CC02 for width,CC03 for speed -Oscillator type (simple with any waveform or with ADSR square or sine wave) -Pitch bend -Portamento on/of (CC65) -Portamento speed (CC05) -Channel volume (CC07)  It plays 8 sine/square with ADSR, 4 with any waveform (now only Saw and triangle), and 4 drum sounds simultaneously.   Here are two songs i recorded with it: Soundcloud.   I have attached the CCS Project with the source codes in a ZIP, the schematics, and a picture of how it look on my breadboard.  
     


    mSpYNTH.zip
    mysy
  10. Like
    nemui-kuma reacted to jazz in MSP430 DMA   
    I was thinking that real DMA is supported, but it's not. Better something than nothing, but far away from a real thing.
     
    It is not a true independent DMA, it steals cycles from the CPU.
     
    From slau208j.pdf "MSP430x5xx MSP430x6xx Family User's Guide":
     
    "During a block transfer, the CPU is halted until the complete block has been transferred. The block transfer takes 2
  11. Like
    nemui-kuma reacted to RobG in Shift registers with USI?   
    Here's one., another one (I think this was my very first post on 43oh ) and one more.
    I am sure you will find many more, just search for USICTL0
  12. Like
    nemui-kuma reacted to RobG in Bitbanging MIDI?   
    Yes, it is.
    I would suggest using msp430g2203 though, it is almost as cheap as 2201 and has USCI module.
     
    When working with asynchronous communications protocol (clock-less,) the most important thing is timing.
    You will need to use timer to make sure your timing is correct.
    Here's how you can implement MIDI out.
    1. Create ring buffer with functions to read from and write to.
    2. Configure Timer to interrupt every 32us.
    3. In Timer's ISR, use tx buffer and tx counter variables to keep track of what bit to send and set output pin as required. When you are done sending start bit, data byte, and then stop bit, check ring buffer for new data and if there is one, start sending another byte.
    4. Your main loop (or port's ISR) will check the state of encoder and switches and add appropriate MIDI message bytes to the ring buffer.
  13. Like
    nemui-kuma reacted to RobG in Bitbanging MIDI?   
    Single bit every 32us (little typo in the original post,) so the whole start bit, byte, and stop bit will take 320us.
    Start and stop for every byte, so you check buffer if there is new data, if there is, pull pin low (start bit.) Next cycle, start sending data byte bit by bit. After all 8 bits are sent, pull pin high (stop bit.) The next interrupt, you check buffer again, and repeat cycle with start bit. If there is no new data in the buffer, keep pin high.
     
    When you want to send 3 byte MIDI message, you just write all 3 bytes to tx buffer.
    Timer's ISR will read tx buffer byte after byte and send them in order. Stop bit and start bit separate bytes and you don't have to send each byte back to back, you can have slight delay between status byte and data bytes. MIDI receiver will know how to handle that.
     
    No special requirement for MIDI.
     
    One more thing, 2201 comes with only one calibrated DCO frequency, 1MHz. At 1MHz, making sure your timing is correct is going to be very tricky or even impossible (interrupt every 32us with 1us clock cycle.) Your software should run at higher frequency, 16MHz for example (62ns clock cycle.) That means you should calibrate each chip to get your clock as accurate as possible.
    2203 comes with 16MHz calibrated DCO frequency, plus if you use USCI, you pass your data to the module and you have 320us to do whatever and you don't have to worry about timing.
×
×
  • Create New...