home.social

#sp0256aal2 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sp0256aal2, aggregated by home.social.

fetched live
  1. Apparently the voice at the end says "Please turn me over". I always wondered, and never really listened that closely before.

    Mine says (or it would have done if I'd had one of these when I recorded it), well hear for yourself :)

    makertube.net/w/bX5QNRRkAomFJQ

    #ElectricLoFiOrchestra #MrBlueSky #Arduino #SP0256AAL2

  2. Apparently the voice at the end says "Please turn me over". I always wondered, and never really listened that closely before.

    Mine says (or it would have done if I'd had one of these when I recorded it), well hear for yourself :)

    makertube.net/w/bX5QNRRkAomFJQ

    #ElectricLoFiOrchestra #MrBlueSky #Arduino #SP0256AAL2

  3. Apparently the voice at the end says "Please turn me over". I always wondered, and never really listened that closely before.

    Mine says (or it would have done if I'd had one of these when I recorded it), well hear for yourself :)

    makertube.net/w/bX5QNRRkAomFJQ

    #ElectricLoFiOrchestra #MrBlueSky #Arduino #SP0256AAL2

  4. Apparently the voice at the end says "Please turn me over". I always wondered, and never really listened that closely before.

    Mine says (or it would have done if I'd had one of these when I recorded it), well hear for yourself :)

    makertube.net/w/bX5QNRRkAomFJQ

    #ElectricLoFiOrchestra #MrBlueSky #Arduino #SP0256AAL2

  5. Minimalist Lo-Fi Minimalism – Part 2

    Last year I programmed up an Arduino with my Pi Day MIDI Sequencer to play a short extract from Philip Glass’ Einstein on the Beach. You can read all about that here: Minimalist Lo-Fi Minimalism.

    Having spent a fair bit of the time since then playing around with an Arduino and SP0256A-AL2 and finally getting it hooked up to MIDI, I parked an idle though that it might be interesting to get it “singing” part of Einstein on the Beach. This post comes back to that idea.

    https://makertube.net/w/4upxhBNemynPiFKfdzzea2

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Circuit

    I did wonder about combining both the Pi Day sequencer and SP0256A-AL2 shield into a single device, but then decided it would be simpler to treat them as two separate devices and use MIDI to pass control between them.

    Consequently I’ve ended up as follows:

    • Pi Sequencer -> MIDI TRS -> SL0256A-AL2 -> MIDI TRS -> synth

    Where the Pi sequencer is running the code for Minimalist Lo-Fi Minimalism with a small update to send additional MIDI messages to be interpreted by the SL0256A-AL2. All other MIDI is passed through the SL0256A onto a MIDI synth as before.

    The Code

    Having decided on the basic architecture, the next decision was how to encode the information destined for the speech synthesizer. I need to be able to tell it a pitch and a number to be “sung”. I toyed with the following ideas:

    • MIDI NoteOn with pitch, but using note velocity to encode the number to sing.
    • MIDI Program Control to select the number, then MIDI pitch and velocity as normal.
    • Use the MIDI channel for the number, and pitch and velocity as normal.

    I opted for the last option, treating each number as a different instrument on a different MIDI channel. This is a bit wasteful but was a lot easier for testing than attempting to get a specific velocity or having to send MIDI PC messages to keep reselecting the “voice” before each note.

    As described previously in Minimalist Lo-Fi Minimalism MIDI channels 1,2 and 3 are already used for the bass and two voice lines, so I’m using MIDI channels 4 through to 13 for the numbers one to ten.

    The code for the Glass already has pitch and which number encoded into the data structures. To trigger the “singing” via the speech synthesizer I’m using the Soprano voice pitches, but an octave lower, so it is a relatively simple matter of adding in an additional MIDI send as follows:

        MIDI.sendNoteOn(sop[i], 64, MIDI_CHANNEL_SOP);              // Original code
    MIDI.sendNoteOn(sop[i]-12, 64, MIDI_CHANNEL_NUM-1+num[i]); // New code
    lastsop = sop[i]; // Original code

    It is using the “NUM” MIDI channel – 1 as I’m encoding the numbers 1 to 10 which are stored in the num[] array. As the speech synthesis is essentially running at a fixed duration for each utterance, I’m not even bothering with a Note Off message.

    On the speech synth side, again essentially all of the code is the same as for the Arduino and SP0256A-AL2 – Part 6 MIDI code, but instead of singing “do, re, mi”, etc linked to pitch, I need to take the word from the MIDI channel. To do this, I’ve expanded the speak() function to include the number and call it as follows from the NoteOn callback:

      speak(channel-MIDI_CH2NUM, pitch);

    This will result in a number from 1 to 10 and a MIDI pitch which can then be used to select the playback frequency as before and then say the allophones corresponding to the received number.

    void speak (uint8_t num, uint8_t note) {
    midi2clock (note);
    switch(num){
    case 1: // One
    spAllo(WW1);
    spAllo(AX1);
    spAllo(NN1);
    break;

    case 2: // Two
    spAllo(TT2);
    spAllo(UW2);
    break;

    }
    spAllo(PA3);
    }

    The SP0256A-AL2 datasheet lists the allophones to use for the basic numbers.

    I’ve used, in a few cases, slightly shortened versions of the numbers from one to ten. In particular I’ve removed the duplicate allophones for six and seven to make them a little shorter to playback.

    The allophones for “One” includes the use of “SX” but I can find no other mention of that in the datasheet, so I’ve ignored it.

    One final change was to tweak the timings of the original playback. I’ve had to slow it down a lot to give the SP0256A-AL2 time to say each number, and I’ve also introduced a small delay between sending the MIDI messages and updating the numbers on the display to allow them to sync up a little better.

    If the MIDI went to the synth directly from the Pi Day sequencer then a delay would probably be required there too, but as it has to go through the SP0256A-AL2 and get sent back out using the “software THRU” of the Arduino MIDI library, it has a natural slight delay already and isn’t too noticeably out of sync.

    Closing Thoughts

    I always knew there would be a few limitations, not least of which due to the time it takes to play back the allophones, but in essence I believe this works. I’d rather it was a little more up tempo, but sometimes one just has to work with what is available.

    I think it is certainly keeping within the spirit of attempting an extract of the original opera on 8-bit microcontrollers, so it’s not doing too badly.

    Kevin

    #arduinoUno #midi #Minimalism #PhilipGlass #piday #sp0256aal2
  6. Minimalist Lo-Fi Minimalism – Part 2

    Last year I programmed up an Arduino with my Pi Day MIDI Sequencer to play a short extract from Philip Glass’ Einstein on the Beach. You can read all about that here: Minimalist Lo-Fi Minimalism.

    Having spent a fair bit of the time since then playing around with an Arduino and SP0256A-AL2 and finally getting it hooked up to MIDI, I parked an idle though that it might be interesting to get it “singing” part of Einstein on the Beach. This post comes back to that idea.

    https://makertube.net/w/4upxhBNemynPiFKfdzzea2

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Circuit

    I did wonder about combining both the Pi Day sequencer and SP0256A-AL2 shield into a single device, but then decided it would be simpler to treat them as two separate devices and use MIDI to pass control between them.

    Consequently I’ve ended up as follows:

    • Pi Sequencer -> MIDI TRS -> SL0256A-AL2 -> MIDI TRS -> synth

    Where the Pi sequencer is running the code for Minimalist Lo-Fi Minimalism with a small update to send additional MIDI messages to be interpreted by the SL0256A-AL2. All other MIDI is passed through the SL0256A onto a MIDI synth as before.

    The Code

    Having decided on the basic architecture, the next decision was how to encode the information destined for the speech synthesizer. I need to be able to tell it a pitch and a number to be “sung”. I toyed with the following ideas:

    • MIDI NoteOn with pitch, but using note velocity to encode the number to sing.
    • MIDI Program Control to select the number, then MIDI pitch and velocity as normal.
    • Use the MIDI channel for the number, and pitch and velocity as normal.

    I opted for the last option, treating each number as a different instrument on a different MIDI channel. This is a bit wasteful but was a lot easier for testing than attempting to get a specific velocity or having to send MIDI PC messages to keep reselecting the “voice” before each note.

    As described previously in Minimalist Lo-Fi Minimalism MIDI channels 1,2 and 3 are already used for the bass and two voice lines, so I’m using MIDI channels 4 through to 13 for the numbers one to ten.

    The code for the Glass already has pitch and which number encoded into the data structures. To trigger the “singing” via the speech synthesizer I’m using the Soprano voice pitches, but an octave lower, so it is a relatively simple matter of adding in an additional MIDI send as follows:

        MIDI.sendNoteOn(sop[i], 64, MIDI_CHANNEL_SOP);              // Original code
    MIDI.sendNoteOn(sop[i]-12, 64, MIDI_CHANNEL_NUM-1+num[i]); // New code
    lastsop = sop[i]; // Original code

    It is using the “NUM” MIDI channel – 1 as I’m encoding the numbers 1 to 10 which are stored in the num[] array. As the speech synthesis is essentially running at a fixed duration for each utterance, I’m not even bothering with a Note Off message.

    On the speech synth side, again essentially all of the code is the same as for the Arduino and SP0256A-AL2 – Part 6 MIDI code, but instead of singing “do, re, mi”, etc linked to pitch, I need to take the word from the MIDI channel. To do this, I’ve expanded the speak() function to include the number and call it as follows from the NoteOn callback:

      speak(channel-MIDI_CH2NUM, pitch);

    This will result in a number from 1 to 10 and a MIDI pitch which can then be used to select the playback frequency as before and then say the allophones corresponding to the received number.

    void speak (uint8_t num, uint8_t note) {
    midi2clock (note);
    switch(num){
    case 1: // One
    spAllo(WW1);
    spAllo(AX1);
    spAllo(NN1);
    break;

    case 2: // Two
    spAllo(TT2);
    spAllo(UW2);
    break;

    }
    spAllo(PA3);
    }

    The SP0256A-AL2 datasheet lists the allophones to use for the basic numbers.

    I’ve used, in a few cases, slightly shortened versions of the numbers from one to ten. In particular I’ve removed the duplicate allophones for six and seven to make them a little shorter to playback.

    The allophones for “One” includes the use of “SX” but I can find no other mention of that in the datasheet, so I’ve ignored it.

    One final change was to tweak the timings of the original playback. I’ve had to slow it down a lot to give the SP0256A-AL2 time to say each number, and I’ve also introduced a small delay between sending the MIDI messages and updating the numbers on the display to allow them to sync up a little better.

    If the MIDI went to the synth directly from the Pi Day sequencer then a delay would probably be required there too, but as it has to go through the SP0256A-AL2 and get sent back out using the “software THRU” of the Arduino MIDI library, it has a natural slight delay already and isn’t too noticeably out of sync.

    Closing Thoughts

    I always knew there would be a few limitations, not least of which due to the time it takes to play back the allophones, but in essence I believe this works. I’d rather it was a little more up tempo, but sometimes one just has to work with what is available.

    I think it is certainly keeping within the spirit of attempting an extract of the original opera on 8-bit microcontrollers, so it’s not doing too badly.

    Kevin

    #arduinoUno #midi #Minimalism #PhilipGlass #piday #sp0256aal2
  7. Minimalist Lo-Fi Minimalism – Part 2

    Last year I programmed up an Arduino with my Pi Day MIDI Sequencer to play a short extract from Philip Glass’ Einstein on the Beach. You can read all about that here: Minimalist Lo-Fi Minimalism.

    Having spent a fair bit of the time since then playing around with an Arduino and SP0256A-AL2 and finally getting it hooked up to MIDI, I parked an idle though that it might be interesting to get it “singing” part of Einstein on the Beach. This post comes back to that idea.

    https://makertube.net/w/4upxhBNemynPiFKfdzzea2

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Circuit

    I did wonder about combining both the Pi Day sequencer and SP0256A-AL2 shield into a single device, but then decided it would be simpler to treat them as two separate devices and use MIDI to pass control between them.

    Consequently I’ve ended up as follows:

    • Pi Sequencer -> MIDI TRS -> SL0256A-AL2 -> MIDI TRS -> synth

    Where the Pi sequencer is running the code for Minimalist Lo-Fi Minimalism with a small update to send additional MIDI messages to be interpreted by the SL0256A-AL2. All other MIDI is passed through the SL0256A onto a MIDI synth as before.

    The Code

    Having decided on the basic architecture, the next decision was how to encode the information destined for the speech synthesizer. I need to be able to tell it a pitch and a number to be “sung”. I toyed with the following ideas:

    • MIDI NoteOn with pitch, but using note velocity to encode the number to sing.
    • MIDI Program Control to select the number, then MIDI pitch and velocity as normal.
    • Use the MIDI channel for the number, and pitch and velocity as normal.

    I opted for the last option, treating each number as a different instrument on a different MIDI channel. This is a bit wasteful but was a lot easier for testing than attempting to get a specific velocity or having to send MIDI PC messages to keep reselecting the “voice” before each note.

    As described previously in Minimalist Lo-Fi Minimalism MIDI channels 1,2 and 3 are already used for the bass and two voice lines, so I’m using MIDI channels 4 through to 13 for the numbers one to ten.

    The code for the Glass already has pitch and which number encoded into the data structures. To trigger the “singing” via the speech synthesizer I’m using the Soprano voice pitches, but an octave lower, so it is a relatively simple matter of adding in an additional MIDI send as follows:

        MIDI.sendNoteOn(sop[i], 64, MIDI_CHANNEL_SOP);              // Original code
    MIDI.sendNoteOn(sop[i]-12, 64, MIDI_CHANNEL_NUM-1+num[i]); // New code
    lastsop = sop[i]; // Original code

    It is using the “NUM” MIDI channel – 1 as I’m encoding the numbers 1 to 10 which are stored in the num[] array. As the speech synthesis is essentially running at a fixed duration for each utterance, I’m not even bothering with a Note Off message.

    On the speech synth side, again essentially all of the code is the same as for the Arduino and SP0256A-AL2 – Part 6 MIDI code, but instead of singing “do, re, mi”, etc linked to pitch, I need to take the word from the MIDI channel. To do this, I’ve expanded the speak() function to include the number and call it as follows from the NoteOn callback:

      speak(channel-MIDI_CH2NUM, pitch);

    This will result in a number from 1 to 10 and a MIDI pitch which can then be used to select the playback frequency as before and then say the allophones corresponding to the received number.

    void speak (uint8_t num, uint8_t note) {
    midi2clock (note);
    switch(num){
    case 1: // One
    spAllo(WW1);
    spAllo(AX1);
    spAllo(NN1);
    break;

    case 2: // Two
    spAllo(TT2);
    spAllo(UW2);
    break;

    }
    spAllo(PA3);
    }

    The SP0256A-AL2 datasheet lists the allophones to use for the basic numbers.

    I’ve used, in a few cases, slightly shortened versions of the numbers from one to ten. In particular I’ve removed the duplicate allophones for six and seven to make them a little shorter to playback.

    The allophones for “One” includes the use of “SX” but I can find no other mention of that in the datasheet, so I’ve ignored it.

    One final change was to tweak the timings of the original playback. I’ve had to slow it down a lot to give the SP0256A-AL2 time to say each number, and I’ve also introduced a small delay between sending the MIDI messages and updating the numbers on the display to allow them to sync up a little better.

    If the MIDI went to the synth directly from the Pi Day sequencer then a delay would probably be required there too, but as it has to go through the SP0256A-AL2 and get sent back out using the “software THRU” of the Arduino MIDI library, it has a natural slight delay already and isn’t too noticeably out of sync.

    Closing Thoughts

    I always knew there would be a few limitations, not least of which due to the time it takes to play back the allophones, but in essence I believe this works. I’d rather it was a little more up tempo, but sometimes one just has to work with what is available.

    I think it is certainly keeping within the spirit of attempting an extract of the original opera on 8-bit microcontrollers, so it’s not doing too badly.

    Kevin

    #arduinoUno #midi #Minimalism #PhilipGlass #piday #sp0256aal2
  8. Minimalist Lo-Fi Minimalism – Part 2

    Last year I programmed up an Arduino with my Pi Day MIDI Sequencer to play a short extract from Philip Glass’ Einstein on the Beach. You can read all about that here: Minimalist Lo-Fi Minimalism.

    Having spent a fair bit of the time since then playing around with an Arduino and SP0256A-AL2 and finally getting it hooked up to MIDI, I parked an idle though that it might be interesting to get it “singing” part of Einstein on the Beach. This post comes back to that idea.

    https://makertube.net/w/4upxhBNemynPiFKfdzzea2

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Circuit

    I did wonder about combining both the Pi Day sequencer and SP0256A-AL2 shield into a single device, but then decided it would be simpler to treat them as two separate devices and use MIDI to pass control between them.

    Consequently I’ve ended up as follows:

    • Pi Sequencer -> MIDI TRS -> SL0256A-AL2 -> MIDI TRS -> synth

    Where the Pi sequencer is running the code for Minimalist Lo-Fi Minimalism with a small update to send additional MIDI messages to be interpreted by the SL0256A-AL2. All other MIDI is passed through the SL0256A onto a MIDI synth as before.

    The Code

    Having decided on the basic architecture, the next decision was how to encode the information destined for the speech synthesizer. I need to be able to tell it a pitch and a number to be “sung”. I toyed with the following ideas:

    • MIDI NoteOn with pitch, but using note velocity to encode the number to sing.
    • MIDI Program Control to select the number, then MIDI pitch and velocity as normal.
    • Use the MIDI channel for the number, and pitch and velocity as normal.

    I opted for the last option, treating each number as a different instrument on a different MIDI channel. This is a bit wasteful but was a lot easier for testing than attempting to get a specific velocity or having to send MIDI PC messages to keep reselecting the “voice” before each note.

    As described previously in Minimalist Lo-Fi Minimalism MIDI channels 1,2 and 3 are already used for the bass and two voice lines, so I’m using MIDI channels 4 through to 13 for the numbers one to ten.

    The code for the Glass already has pitch and which number encoded into the data structures. To trigger the “singing” via the speech synthesizer I’m using the Soprano voice pitches, but an octave lower, so it is a relatively simple matter of adding in an additional MIDI send as follows:

        MIDI.sendNoteOn(sop[i], 64, MIDI_CHANNEL_SOP);              // Original code
    MIDI.sendNoteOn(sop[i]-12, 64, MIDI_CHANNEL_NUM-1+num[i]); // New code
    lastsop = sop[i]; // Original code

    It is using the “NUM” MIDI channel – 1 as I’m encoding the numbers 1 to 10 which are stored in the num[] array. As the speech synthesis is essentially running at a fixed duration for each utterance, I’m not even bothering with a Note Off message.

    On the speech synth side, again essentially all of the code is the same as for the Arduino and SP0256A-AL2 – Part 6 MIDI code, but instead of singing “do, re, mi”, etc linked to pitch, I need to take the word from the MIDI channel. To do this, I’ve expanded the speak() function to include the number and call it as follows from the NoteOn callback:

      speak(channel-MIDI_CH2NUM, pitch);

    This will result in a number from 1 to 10 and a MIDI pitch which can then be used to select the playback frequency as before and then say the allophones corresponding to the received number.

    void speak (uint8_t num, uint8_t note) {
    midi2clock (note);
    switch(num){
    case 1: // One
    spAllo(WW1);
    spAllo(AX1);
    spAllo(NN1);
    break;

    case 2: // Two
    spAllo(TT2);
    spAllo(UW2);
    break;

    }
    spAllo(PA3);
    }

    The SP0256A-AL2 datasheet lists the allophones to use for the basic numbers.

    I’ve used, in a few cases, slightly shortened versions of the numbers from one to ten. In particular I’ve removed the duplicate allophones for six and seven to make them a little shorter to playback.

    The allophones for “One” includes the use of “SX” but I can find no other mention of that in the datasheet, so I’ve ignored it.

    One final change was to tweak the timings of the original playback. I’ve had to slow it down a lot to give the SP0256A-AL2 time to say each number, and I’ve also introduced a small delay between sending the MIDI messages and updating the numbers on the display to allow them to sync up a little better.

    If the MIDI went to the synth directly from the Pi Day sequencer then a delay would probably be required there too, but as it has to go through the SP0256A-AL2 and get sent back out using the “software THRU” of the Arduino MIDI library, it has a natural slight delay already and isn’t too noticeably out of sync.

    Closing Thoughts

    I always knew there would be a few limitations, not least of which due to the time it takes to play back the allophones, but in essence I believe this works. I’d rather it was a little more up tempo, but sometimes one just has to work with what is available.

    I think it is certainly keeping within the spirit of attempting an extract of the original opera on 8-bit microcontrollers, so it’s not doing too badly.

    Kevin

    #arduinoUno #midi #Minimalism #PhilipGlass #piday #sp0256aal2
  9. @futzle Ok. So, I've not done any fancy programming, but I have managed to get my vintage SP0256A-AL2 speech synthesizer chip to "sing" it for you...

    Hopefully that tends a bit towards the weird :)

    makertube.net/w/diBkzrhkh3tekA

    #Weird #Christmas #SP0256AAL2

  10. @futzle Ok. So, I've not done any fancy programming, but I have managed to get my vintage SP0256A-AL2 speech synthesizer chip to "sing" it for you...

    Hopefully that tends a bit towards the weird :)

    makertube.net/w/diBkzrhkh3tekA

    #Weird #Christmas #SP0256AAL2

  11. @futzle Ok. So, I've not done any fancy programming, but I have managed to get my vintage SP0256A-AL2 speech synthesizer chip to "sing" it for you...

    Hopefully that tends a bit towards the weird :)

    makertube.net/w/diBkzrhkh3tekA

    #Weird #Christmas #SP0256AAL2

  12. @futzle Ok. So, I've not done any fancy programming, but I have managed to get my vintage SP0256A-AL2 speech synthesizer chip to "sing" it for you...

    Hopefully that tends a bit towards the weird :)

    makertube.net/w/diBkzrhkh3tekA

    #Weird #Christmas #SP0256AAL2

  13. SP0256A-AL2 Sings the Twelve Days of Christmas

    Partly prompted by a programming challenge by Futzle on Mastodon, I thought it might be interesting to try to get my Arduino and SP0256A-AL2 to sing the Twelve Days of Christmas.

    https://makertube.net/w/diBkzrhkh3tekAPBhGzrVj

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Code

    I wasn’t aiming for a clever code solution, as can be seen submitted to the programming competition already, but I was hoping to get the computer to do at least some of the work for me.

    The first issue is getting a useful range for the song. My original MIDI SP0256 project managed around an octave and a half. Well it so happens that the 12 Days of Christmas is just over 1 octave, so if I can position that to the top end of the range, I should be ok.

    This is the most compact notation of the tune that I know of. This is from the “Christmas Praise” Brass Band carol book, which seems to be one of the most common references for any band out caroling at this time of year.

    Ignoring the introduction, I’m going to transpose this into concert Bb (i.e. up a minor third) which gives me a note range from F2 through to G3. This allows me to use a sensible range of the SP0256A without it getting too slow down at the bottom end of things.

    The main text/lyric structure will be set up in a series of functions as follows:

    intro() - "on the nth day of Christmas my true love gave to me"
    nth() - "first", "second", etc.
    one() - "a partridge in a pear tree"
    two() - "two turtle doves"
    ...
    twelve() - "twelve drummers drumming"

    Some variations are required as follows:

    • intro() – needs to be able to switch to “and a partridge” for all verses apart from verse 1.
    • two(), three(), four() – have a different melody from verse 5 onwards.
    • five() – ideally this should get slower and more drawn out with each repetition.
    • one() – ideally this would slow down on the last time through.

    In order to capture the variations and repeats for each verse, I’ve opted to use an increasing bitmask for each time through to trigger the various phrases. Bit 0 always indicates one() must be called. Bit 1 indicates two(), and so on. It starts with the value 1 but will keep adding another bit as the verses change, so will have the values 1, 3, 7, 15, 31, 63, etc. thus allowing me to build up the verses with one bit per verse.

    one() takes bool parameters to indicate first time and last time through. two(), three(), four() take a bool parameter to indicate if it is a “post five gold rings” verse. Using the bitmask this is pretty easy as it just means any of the bits 0x0FF0 will be set for verses 5+.

    Here is the main code loop.

    uint16_t phrase=1;
    for (int verse=1; verse<=12 ; verse++) {
    intro(verse);
    delay(200);
    if (phrase & 0x0800) twelve();
    if (phrase & 0x0400) eleven();
    if (phrase & 0x0200) ten();
    if (phrase & 0x0100) nine();
    if (phrase & 0x0080) eight();
    if (phrase & 0x0040) seven();
    if (phrase & 0x0020) six();
    if (phrase & 0x0010) five(verse);
    if (phrase & 0x0008) four(phrase & 0x0FF0);
    if (phrase & 0x0004) three(phrase & 0x0FF0);
    if (phrase & 0x0002) two(phrase & 0x0FF0);
    if (phrase & 0x0001) one(phrase == 1, verse == 12);
    phrase = (phrase<<1) + 1;
    delay(1000);
    }

    The timings were really quite tricky as I have several variables to work to:

    • Each allophone takes a different time to be said.
    • Each allophone also has a recommended delay time (this might be to account for the time to say them – I’m not sure).
    • When I change the frequency, the time to say any specific allophone also changes, with lower frequencies significantly slower than higher ones.
    • I naturally need to account for the musical rhythm changes too.

    In principle I could probably work out the slowest interval and work back from there to get some accurate timings, but I just did a bit of trial and error on each phrase until it was close enough. The unevenness remaining was because I didn’t want to slow the whole thing down to the slowest phrases being “sung”. It is slow enough already!

    Also, as it doesn’t look much, I’ve added an LED to light up at the start of an allophone and to go off whenever a pause is encountered.

    Find it on GitHub here.

    Closing Thoughts

    I’m actually really pleased with this. It is a good balance of close enough to show the principle without me undertaking complex timing and endless fiddling.

    I could probably get a bit cleverer with the code, but that wasn’t really the point for me. I’ve used an algorithm where it mattered to me, and was quite happy to spell out the allophones, frequencies, and timings by hand as I went.

    Lastly, let me wish you the compliments of the season, to you and yours.

    Kevin

    #arduinoUno #sp0256aAl2

  14. SP0256A-AL2 Sings the Twelve Days of Christmas

    Partly prompted by a programming challenge by Futzle on Mastodon, I thought it might be interesting to try to get my Arduino and SP0256A-AL2 to sing the Twelve Days of Christmas.

    https://makertube.net/w/diBkzrhkh3tekAPBhGzrVj

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Code

    I wasn’t aiming for a clever code solution, as can be seen submitted to the programming competition already, but I was hoping to get the computer to do at least some of the work for me.

    The first issue is getting a useful range for the song. My original MIDI SP0256 project managed around an octave and a half. Well it so happens that the 12 Days of Christmas is just over 1 octave, so if I can position that to the top end of the range, I should be ok.

    This is the most compact notation of the tune that I know of. This is from the “Christmas Praise” Brass Band carol book, which seems to be one of the most common references for any band out caroling at this time of year.

    Ignoring the introduction, I’m going to transpose this into concert Bb (i.e. up a minor third) which gives me a note range from F2 through to G3. This allows me to use a sensible range of the SP0256A without it getting too slow down at the bottom end of things.

    The main text/lyric structure will be set up in a series of functions as follows:

    intro() - "on the nth day of Christmas my true love gave to me"
    nth() - "first", "second", etc.
    one() - "a partridge in a pear tree"
    two() - "two turtle doves"
    ...
    twelve() - "twelve drummers drumming"

    Some variations are required as follows:

    • intro() – needs to be able to switch to “and a partridge” for all verses apart from verse 1.
    • two(), three(), four() – have a different melody from verse 5 onwards.
    • five() – ideally this should get slower and more drawn out with each repetition.
    • one() – ideally this would slow down on the last time through.

    In order to capture the variations and repeats for each verse, I’ve opted to use an increasing bitmask for each time through to trigger the various phrases. Bit 0 always indicates one() must be called. Bit 1 indicates two(), and so on. It starts with the value 1 but will keep adding another bit as the verses change, so will have the values 1, 3, 7, 15, 31, 63, etc. thus allowing me to build up the verses with one bit per verse.

    one() takes bool parameters to indicate first time and last time through. two(), three(), four() take a bool parameter to indicate if it is a “post five gold rings” verse. Using the bitmask this is pretty easy as it just means any of the bits 0x0FF0 will be set for verses 5+.

    Here is the main code loop.

    uint16_t phrase=1;
    for (int verse=1; verse<=12 ; verse++) {
    intro(verse);
    delay(200);
    if (phrase & 0x0800) twelve();
    if (phrase & 0x0400) eleven();
    if (phrase & 0x0200) ten();
    if (phrase & 0x0100) nine();
    if (phrase & 0x0080) eight();
    if (phrase & 0x0040) seven();
    if (phrase & 0x0020) six();
    if (phrase & 0x0010) five(verse);
    if (phrase & 0x0008) four(phrase & 0x0FF0);
    if (phrase & 0x0004) three(phrase & 0x0FF0);
    if (phrase & 0x0002) two(phrase & 0x0FF0);
    if (phrase & 0x0001) one(phrase == 1, verse == 12);
    phrase = (phrase<<1) + 1;
    delay(1000);
    }

    The timings were really quite tricky as I have several variables to work to:

    • Each allophone takes a different time to be said.
    • Each allophone also has a recommended delay time (this might be to account for the time to say them – I’m not sure).
    • When I change the frequency, the time to say any specific allophone also changes, with lower frequencies significantly slower than higher ones.
    • I naturally need to account for the musical rhythm changes too.

    In principle I could probably work out the slowest interval and work back from there to get some accurate timings, but I just did a bit of trial and error on each phrase until it was close enough. The unevenness remaining was because I didn’t want to slow the whole thing down to the slowest phrases being “sung”. It is slow enough already!

    Also, as it doesn’t look much, I’ve added an LED to light up at the start of an allophone and to go off whenever a pause is encountered.

    Find it on GitHub here.

    Closing Thoughts

    I’m actually really pleased with this. It is a good balance of close enough to show the principle without me undertaking complex timing and endless fiddling.

    I could probably get a bit cleverer with the code, but that wasn’t really the point for me. I’ve used an algorithm where it mattered to me, and was quite happy to spell out the allophones, frequencies, and timings by hand as I went.

    Lastly, let me wish you the compliments of the season, to you and yours.

    Kevin

    #arduinoUno #sp0256aAl2

  15. SP0256A-AL2 Sings the Twelve Days of Christmas

    Partly prompted by a programming challenge by Futzle on Mastodon, I thought it might be interesting to try to get my Arduino and SP0256A-AL2 to sing the Twelve Days of Christmas.

    https://makertube.net/w/diBkzrhkh3tekAPBhGzrVj

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Code

    I wasn’t aiming for a clever code solution, as can be seen submitted to the programming competition already, but I was hoping to get the computer to do at least some of the work for me.

    The first issue is getting a useful range for the song. My original MIDI SP0256 project managed around an octave and a half. Well it so happens that the 12 Days of Christmas is just over 1 octave, so if I can position that to the top end of the range, I should be ok.

    This is the most compact notation of the tune that I know of. This is from the “Christmas Praise” Brass Band carol book, which seems to be one of the most common references for any band out caroling at this time of year.

    Ignoring the introduction, I’m going to transpose this into concert Bb (i.e. up a minor third) which gives me a note range from F2 through to G3. This allows me to use a sensible range of the SP0256A without it getting too slow down at the bottom end of things.

    The main text/lyric structure will be set up in a series of functions as follows:

    intro() - "on the nth day of Christmas my true love gave to me"
    nth() - "first", "second", etc.
    one() - "a partridge in a pear tree"
    two() - "two turtle doves"
    ...
    twelve() - "twelve drummers drumming"

    Some variations are required as follows:

    • intro() – needs to be able to switch to “and a partridge” for all verses apart from verse 1.
    • two(), three(), four() – have a different melody from verse 5 onwards.
    • five() – ideally this should get slower and more drawn out with each repetition.
    • one() – ideally this would slow down on the last time through.

    In order to capture the variations and repeats for each verse, I’ve opted to use an increasing bitmask for each time through to trigger the various phrases. Bit 0 always indicates one() must be called. Bit 1 indicates two(), and so on. It starts with the value 1 but will keep adding another bit as the verses change, so will have the values 1, 3, 7, 15, 31, 63, etc. thus allowing me to build up the verses with one bit per verse.

    one() takes bool parameters to indicate first time and last time through. two(), three(), four() take a bool parameter to indicate if it is a “post five gold rings” verse. Using the bitmask this is pretty easy as it just means any of the bits 0x0FF0 will be set for verses 5+.

    Here is the main code loop.

    uint16_t phrase=1;
    for (int verse=1; verse<=12 ; verse++) {
    intro(verse);
    delay(200);
    if (phrase & 0x0800) twelve();
    if (phrase & 0x0400) eleven();
    if (phrase & 0x0200) ten();
    if (phrase & 0x0100) nine();
    if (phrase & 0x0080) eight();
    if (phrase & 0x0040) seven();
    if (phrase & 0x0020) six();
    if (phrase & 0x0010) five(verse);
    if (phrase & 0x0008) four(phrase & 0x0FF0);
    if (phrase & 0x0004) three(phrase & 0x0FF0);
    if (phrase & 0x0002) two(phrase & 0x0FF0);
    if (phrase & 0x0001) one(phrase == 1, verse == 12);
    phrase = (phrase<<1) + 1;
    delay(1000);
    }

    The timings were really quite tricky as I have several variables to work to:

    • Each allophone takes a different time to be said.
    • Each allophone also has a recommended delay time (this might be to account for the time to say them – I’m not sure).
    • When I change the frequency, the time to say any specific allophone also changes, with lower frequencies significantly slower than higher ones.
    • I naturally need to account for the musical rhythm changes too.

    In principle I could probably work out the slowest interval and work back from there to get some accurate timings, but I just did a bit of trial and error on each phrase until it was close enough. The unevenness remaining was because I didn’t want to slow the whole thing down to the slowest phrases being “sung”. It is slow enough already!

    Also, as it doesn’t look much, I’ve added an LED to light up at the start of an allophone and to go off whenever a pause is encountered.

    Find it on GitHub here.

    Closing Thoughts

    I’m actually really pleased with this. It is a good balance of close enough to show the principle without me undertaking complex timing and endless fiddling.

    I could probably get a bit cleverer with the code, but that wasn’t really the point for me. I’ve used an algorithm where it mattered to me, and was quite happy to spell out the allophones, frequencies, and timings by hand as I went.

    Lastly, let me wish you the compliments of the season, to you and yours.

    Kevin

    #arduinoUno #sp0256aAl2

  16. SP0256A-AL2 Sings the Twelve Days of Christmas

    Partly prompted by a programming challenge by Futzle on Mastodon, I thought it might be interesting to try to get my Arduino and SP0256A-AL2 to sing the Twelve Days of Christmas.

    https://makertube.net/w/diBkzrhkh3tekAPBhGzrVj

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to Arduino, see the Getting Started pages.

    Parts list

    The Code

    I wasn’t aiming for a clever code solution, as can be seen submitted to the programming competition already, but I was hoping to get the computer to do at least some of the work for me.

    The first issue is getting a useful range for the song. My original MIDI SP0256 project managed around an octave and a half. Well it so happens that the 12 Days of Christmas is just over 1 octave, so if I can position that to the top end of the range, I should be ok.

    This is the most compact notation of the tune that I know of. This is from the “Christmas Praise” Brass Band carol book, which seems to be one of the most common references for any band out caroling at this time of year.

    Ignoring the introduction, I’m going to transpose this into concert Bb (i.e. up a minor third) which gives me a note range from F2 through to G3. This allows me to use a sensible range of the SP0256A without it getting too slow down at the bottom end of things.

    The main text/lyric structure will be set up in a series of functions as follows:

    intro() - "on the nth day of Christmas my true love gave to me"
    nth() - "first", "second", etc.
    one() - "a partridge in a pear tree"
    two() - "two turtle doves"
    ...
    twelve() - "twelve drummers drumming"

    Some variations are required as follows:

    • intro() – needs to be able to switch to “and a partridge” for all verses apart from verse 1.
    • two(), three(), four() – have a different melody from verse 5 onwards.
    • five() – ideally this should get slower and more drawn out with each repetition.
    • one() – ideally this would slow down on the last time through.

    In order to capture the variations and repeats for each verse, I’ve opted to use an increasing bitmask for each time through to trigger the various phrases. Bit 0 always indicates one() must be called. Bit 1 indicates two(), and so on. It starts with the value 1 but will keep adding another bit as the verses change, so will have the values 1, 3, 7, 15, 31, 63, etc. thus allowing me to build up the verses with one bit per verse.

    one() takes bool parameters to indicate first time and last time through. two(), three(), four() take a bool parameter to indicate if it is a “post five gold rings” verse. Using the bitmask this is pretty easy as it just means any of the bits 0x0FF0 will be set for verses 5+.

    Here is the main code loop.

    uint16_t phrase=1;
    for (int verse=1; verse<=12 ; verse++) {
    intro(verse);
    delay(200);
    if (phrase & 0x0800) twelve();
    if (phrase & 0x0400) eleven();
    if (phrase & 0x0200) ten();
    if (phrase & 0x0100) nine();
    if (phrase & 0x0080) eight();
    if (phrase & 0x0040) seven();
    if (phrase & 0x0020) six();
    if (phrase & 0x0010) five(verse);
    if (phrase & 0x0008) four(phrase & 0x0FF0);
    if (phrase & 0x0004) three(phrase & 0x0FF0);
    if (phrase & 0x0002) two(phrase & 0x0FF0);
    if (phrase & 0x0001) one(phrase == 1, verse == 12);
    phrase = (phrase<<1) + 1;
    delay(1000);
    }

    The timings were really quite tricky as I have several variables to work to:

    • Each allophone takes a different time to be said.
    • Each allophone also has a recommended delay time (this might be to account for the time to say them – I’m not sure).
    • When I change the frequency, the time to say any specific allophone also changes, with lower frequencies significantly slower than higher ones.
    • I naturally need to account for the musical rhythm changes too.

    In principle I could probably work out the slowest interval and work back from there to get some accurate timings, but I just did a bit of trial and error on each phrase until it was close enough. The unevenness remaining was because I didn’t want to slow the whole thing down to the slowest phrases being “sung”. It is slow enough already!

    Also, as it doesn’t look much, I’ve added an LED to light up at the start of an allophone and to go off whenever a pause is encountered.

    Find it on GitHub here.

    Closing Thoughts

    I’m actually really pleased with this. It is a good balance of close enough to show the principle without me undertaking complex timing and endless fiddling.

    I could probably get a bit cleverer with the code, but that wasn’t really the point for me. I’ve used an algorithm where it mattered to me, and was quite happy to spell out the allophones, frequencies, and timings by hand as I went.

    Lastly, let me wish you the compliments of the season, to you and yours.

    Kevin

    #arduinoUno #sp0256aAl2

  17. And so, finally, I can drive a SP0256A-AL2 vintage speech chip using a MIDI keyboard.

    This uses all the principles from previous posts and my recent Uno Shield PCB.

    It really isn't very responsive at all and can only comfortably do an octave and a bit.

    But hey, I'm getting an 80s speech synth chip to "sing" :)

    diyelectromusic.com/2025/09/24

    #Arduino #MIDI #SP0256AAL2 #JustBecauseYouCanDoesntMeanYouShould

  18. And so, finally, I can drive a SP0256A-AL2 vintage speech chip using a MIDI keyboard.

    This uses all the principles from previous posts and my recent Uno Shield PCB.

    It really isn't very responsive at all and can only comfortably do an octave and a bit.

    But hey, I'm getting an 80s speech synth chip to "sing" :)

    diyelectromusic.com/2025/09/24

    #Arduino #MIDI #SP0256AAL2 #JustBecauseYouCanDoesntMeanYouShould

  19. And so, finally, I can drive a SP0256A-AL2 vintage speech chip using a MIDI keyboard.

    This uses all the principles from previous posts and my recent Uno Shield PCB.

    It really isn't very responsive at all and can only comfortably do an octave and a bit.

    But hey, I'm getting an 80s speech synth chip to "sing" :)

    diyelectromusic.com/2025/09/24

    #Arduino #MIDI #SP0256AAL2 #JustBecauseYouCanDoesntMeanYouShould

  20. And so, finally, I can drive a SP0256A-AL2 vintage speech chip using a MIDI keyboard.

    This uses all the principles from previous posts and my recent Uno Shield PCB.

    It really isn't very responsive at all and can only comfortably do an octave and a bit.

    But hey, I'm getting an 80s speech synth chip to "sing" :)

    diyelectromusic.com/2025/09/24

    #Arduino #MIDI #SP0256AAL2 #JustBecauseYouCanDoesntMeanYouShould

  21. Arduino and SP0256A-AL2 – Part 6

    Finally I’m doing something arguably slightly musical with my SP0256A-AL2! Playing it over MIDI.

    • Part 1 – Basic introduction and getting started
    • Part 2 – Arduino programmable clock
    • Part 3 – Using a Raspberry Pi Pico as a programmable clock
    • Part 4 – Using a HC4046 PLL as the clock
    • Part 5 – Using an I2C SI5351 programmable clock
    • Part 6 – Adding MIDI

    https://makertube.net/w/wLRxeVHtMatYo7NGWCw54U

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    The Circuit

    This is using my Arduino SP0256A-AL2 Shield with an SI5351 programmable clock module, so this is essentially the circuit from Arduino and SP0256A-AL2 – Part 5 with the addition of a MIDI module.

    I also used my Arduino MIDI Proto Shield but any MIDI RX circuit on the Arduino RX pin would work.

    The same circuit can be made on solderless breadboard, but I’ve opted to use my PCBs for convenience as that is why I designed them in the first place.

    The Code

    I’m using all the main code from Arduino and SP0256A-AL2 – Part 5 but I’ve split the speaking into “start” and “stop” parts so I can drive them from MIDI NoteOn and NoteOff messages.

    The main “speak” code now looks like the following:

    void speak (uint8_t note) {
    if (note == 0) {
    spAllo(PA3); // Speaking off
    return;
    }

    if ((note < MIDI_NOTE_START) || (note > MIDI_NOTE_END)) {
    return;
    }

    midi2clock (note);
    switch(note){
    case 36: // Do
    case 37:
    case 48:
    case 49:
    spAllo(DD1);
    spAllo(OW1);
    break;

    case 38: // Re
    case 39:
    case 50:
    case 51:
    spAllo(RR1);
    spAllo(EY1);
    break;

    ...

    So when called with note==0 it will stop the speaking by sending PA3, but for any note between 36 and 56 it will set the frequency and then say the appropriate “Do, Re, Mi” word. I’ve used the same word for the natural and sharp equivalent. I’ve also allowed for two octaves. This is why there are four note values that result in the word “Do” being said: MIDI notes 36, 37 (C2 and C#2), 48, and 49 (C3 and C#3).

    This can now be called from the code that handles MIDI Note On and Note Off messages.

    Find it on GitHub here.

    Closing Thoughts

    It works, but it isn’t very responsive due to the time it takes to say each allophone.

    I guess when I started thinking about doing this, I thought I’d get more of a frequency range from the device and wasn’t anticipating it being so “low” in the musical range either.

    But it is quite fun to see it finally being driven by a music keyboard, even if it isn’t particularly practical!

    I know there is emulation of an SP0256A-AL2 in the RC2040 (an emulation of the RC2014 on a Raspberry Pi Pico) so I might at some point look at seeing if I can just drop the hardware and doing it all in software at some point by adjusting sample and playback rates.

    I suspect that will work a lot better, but it isn’t quite the same as driving the real thing 🙂

    Kevin

    #arduinoUno #midi #si5351 #sp0256aAl2

  22. Arduino and SP0256A-AL2 – Part 6

    Finally I’m doing something arguably slightly musical with my SP0256A-AL2! Playing it over MIDI.

    • Part 1 – Basic introduction and getting started
    • Part 2 – Arduino programmable clock
    • Part 3 – Using a Raspberry Pi Pico as a programmable clock
    • Part 4 – Using a HC4046 PLL as the clock
    • Part 5 – Using an I2C SI5351 programmable clock
    • Part 6 – Adding MIDI

    https://makertube.net/w/wLRxeVHtMatYo7NGWCw54U

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    The Circuit

    This is using my Arduino SP0256A-AL2 Shield with an SI5351 programmable clock module, so this is essentially the circuit from Arduino and SP0256A-AL2 – Part 5 with the addition of a MIDI module.

    I also used my Arduino MIDI Proto Shield but any MIDI RX circuit on the Arduino RX pin would work.

    The same circuit can be made on solderless breadboard, but I’ve opted to use my PCBs for convenience as that is why I designed them in the first place.

    The Code

    I’m using all the main code from Arduino and SP0256A-AL2 – Part 5 but I’ve split the speaking into “start” and “stop” parts so I can drive them from MIDI NoteOn and NoteOff messages.

    The main “speak” code now looks like the following:

    void speak (uint8_t note) {
    if (note == 0) {
    spAllo(PA3); // Speaking off
    return;
    }

    if ((note < MIDI_NOTE_START) || (note > MIDI_NOTE_END)) {
    return;
    }

    midi2clock (note);
    switch(note){
    case 36: // Do
    case 37:
    case 48:
    case 49:
    spAllo(DD1);
    spAllo(OW1);
    break;

    case 38: // Re
    case 39:
    case 50:
    case 51:
    spAllo(RR1);
    spAllo(EY1);
    break;

    ...

    So when called with note==0 it will stop the speaking by sending PA3, but for any note between 36 and 56 it will set the frequency and then say the appropriate “Do, Re, Mi” word. I’ve used the same word for the natural and sharp equivalent. I’ve also allowed for two octaves. This is why there are four note values that result in the word “Do” being said: MIDI notes 36, 37 (C2 and C#2), 48, and 49 (C3 and C#3).

    This can now be called from the code that handles MIDI Note On and Note Off messages.

    Find it on GitHub here.

    Closing Thoughts

    It works, but it isn’t very responsive due to the time it takes to say each allophone.

    I guess when I started thinking about doing this, I thought I’d get more of a frequency range from the device and wasn’t anticipating it being so “low” in the musical range either.

    But it is quite fun to see it finally being driven by a music keyboard, even if it isn’t particularly practical!

    I know there is emulation of an SP0256A-AL2 in the RC2040 (an emulation of the RC2014 on a Raspberry Pi Pico) so I might at some point look at seeing if I can just drop the hardware and doing it all in software at some point by adjusting sample and playback rates.

    I suspect that will work a lot better, but it isn’t quite the same as driving the real thing 🙂

    Kevin

    #arduinoUno #midi #si5351 #sp0256aAl2

  23. Arduino and SP0256A-AL2 – Part 6

    Finally I’m doing something arguably slightly musical with my SP0256A-AL2! Playing it over MIDI.

    • Part 1 – Basic introduction and getting started
    • Part 2 – Arduino programmable clock
    • Part 3 – Using a Raspberry Pi Pico as a programmable clock
    • Part 4 – Using a HC4046 PLL as the clock
    • Part 5 – Using an I2C SI5351 programmable clock
    • Part 6 – Adding MIDI

    https://makertube.net/w/wLRxeVHtMatYo7NGWCw54U

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    The Circuit

    This is using my Arduino SP0256A-AL2 Shield with an SI5351 programmable clock module, so this is essentially the circuit from Arduino and SP0256A-AL2 – Part 5 with the addition of a MIDI module.

    I also used my Arduino MIDI Proto Shield but any MIDI RX circuit on the Arduino RX pin would work.

    The same circuit can be made on solderless breadboard, but I’ve opted to use my PCBs for convenience as that is why I designed them in the first place.

    The Code

    I’m using all the main code from Arduino and SP0256A-AL2 – Part 5 but I’ve split the speaking into “start” and “stop” parts so I can drive them from MIDI NoteOn and NoteOff messages.

    The main “speak” code now looks like the following:

    void speak (uint8_t note) {
    if (note == 0) {
    spAllo(PA3); // Speaking off
    return;
    }

    if ((note < MIDI_NOTE_START) || (note > MIDI_NOTE_END)) {
    return;
    }

    midi2clock (note);
    switch(note){
    case 36: // Do
    case 37:
    case 48:
    case 49:
    spAllo(DD1);
    spAllo(OW1);
    break;

    case 38: // Re
    case 39:
    case 50:
    case 51:
    spAllo(RR1);
    spAllo(EY1);
    break;

    ...

    So when called with note==0 it will stop the speaking by sending PA3, but for any note between 36 and 56 it will set the frequency and then say the appropriate “Do, Re, Mi” word. I’ve used the same word for the natural and sharp equivalent. I’ve also allowed for two octaves. This is why there are four note values that result in the word “Do” being said: MIDI notes 36, 37 (C2 and C#2), 48, and 49 (C3 and C#3).

    This can now be called from the code that handles MIDI Note On and Note Off messages.

    Find it on GitHub here.

    Closing Thoughts

    It works, but it isn’t very responsive due to the time it takes to say each allophone.

    I guess when I started thinking about doing this, I thought I’d get more of a frequency range from the device and wasn’t anticipating it being so “low” in the musical range either.

    But it is quite fun to see it finally being driven by a music keyboard, even if it isn’t particularly practical!

    I know there is emulation of an SP0256A-AL2 in the RC2040 (an emulation of the RC2014 on a Raspberry Pi Pico) so I might at some point look at seeing if I can just drop the hardware and doing it all in software at some point by adjusting sample and playback rates.

    I suspect that will work a lot better, but it isn’t quite the same as driving the real thing 🙂

    Kevin

    #arduinoUno #midi #si5351 #sp0256aAl2

  24. I've stuck my SP0256A-AL2 circuit onto an Uno shield format board.

    It has an option for a fixed oscillator or the SI5351 programmable clock and should make any further messing around a bit easier.

    diyelectromusic.com/2025/09/23

    #ARduino #SP0256AAL2

  25. I've stuck my SP0256A-AL2 circuit onto an Uno shield format board.

    It has an option for a fixed oscillator or the SI5351 programmable clock and should make any further messing around a bit easier.

    diyelectromusic.com/2025/09/23

    #ARduino #SP0256AAL2

  26. I've stuck my SP0256A-AL2 circuit onto an Uno shield format board.

    It has an option for a fixed oscillator or the SI5351 programmable clock and should make any further messing around a bit easier.

    diyelectromusic.com/2025/09/23

    #ARduino #SP0256AAL2

  27. I've stuck my SP0256A-AL2 circuit onto an Uno shield format board.

    It has an option for a fixed oscillator or the SI5351 programmable clock and should make any further messing around a bit easier.

    diyelectromusic.com/2025/09/23

    #ARduino #SP0256AAL2

  28. Arduino SP0256A-AL2 Shield PCB Build Guide

    Here are the build notes for my Arduino SP0256A-AL2 Shield Design.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    Bill of Materials

    • Arduino SP0256A-AL2 Shield PCB (GitHub link below)
    • 1x SP0256A-AL2 (see notes here on sourcing: SP0256A-AL2 Speech Synthesis)
    • Either 1x 3.579545 MHz oscillator (4-pin in 8-pin DIP footprint – see photos)
    • Or 1x SI5351 breakout board (see photos)
    • 2x 1KΩ resistors
    • 3x 100nF ceramic capacitors
    • 1x 1uF electrolytic capacitor
    • 1x 3.5mm stereo TRS socket (see photos and PCB for footprint)
    • 1x set of Arduino headers: 1x 10 pin; 2x 8 pin; 1x 6 pin
    • Optional: 1x 28 pin wide DIP socket

    Build Steps

    Taking a typical “low to high” soldering approach, this is the suggested order of assembly:

    • Resistors
    • DIP socket (if used) and TRS socket.
    • Disc capacitors.
    • Electrolytic capacitor.
    • 3-way jumper headers.
    • Oscillator (if used)
    • SI5351 pin headers (if used)
    • Arduino headers

    It should be decided up front if the board will use a fixed oscillator or a SI5351 programmable clock. Both could be installed, but there is a solder bridge that has to be used to determined which will be used. It isn’t possible to use both at the same time.

    This shows the solder bridge configured to use the SI5351. This might be easiest to do prior to soldering other components on the board.

    Here are some build photos.

    Here is a photo with the oscillator installed, and one with the SI5351 instead.

    Note: I didn’t solder the pin headers of the SI5351 to the PCB, but instead used the “fishing line trick” to push the board into the PCB without soldering. This means I have the option of reusing the board again for something else in the future.

    By default the SP0256A-AL2 /RESET line is connected to the Arduino RESET pin. It is possible to break this link by cutting the solder bridge shown below and wiring the RESET pad to another Arduino GPIO pin.

    Testing

    I recommend performing the general tests described here: PCBs.

    PCB Errata

    There are no known issues with this PCB at this time.

    Enhancements:

    •  With hindsight it might have been useful to have a jumper option to select the clock mode rather than a solder bridge. But it seemed quite a fundamental choice at the time of designing the PCB that I thought it perhaps shouldn’t be quite so easy to change. Now I’m not so sure!

    Find it on GitHub here.

    Sample Applications

    Here are some applications to get started with:

    Closing Thoughts

    Now it is a bit easier to experiment I can explore a few other musical possibilities.

    But this has shown up a slight issue with the chips I have. The highest frequency that the chip can support without locking up seems to be somewhat device dependent.

    I’ve seen nothing in the datasheet, application manual, or design guide that suggests it will function at all with anything other than a 3.12MHz oscillator, so I am running it quite a bit out of specification now.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  29. Arduino SP0256A-AL2 Shield PCB Build Guide

    Here are the build notes for my Arduino SP0256A-AL2 Shield Design.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    Bill of Materials

    • Arduino SP0256A-AL2 Shield PCB (GitHub link below)
    • 1x SP0256A-AL2 (see notes here on sourcing: SP0256A-AL2 Speech Synthesis)
    • Either 1x 3.579545 MHz oscillator (4-pin in 8-pin DIP footprint – see photos)
    • Or 1x SI5351 breakout board (see photos)
    • 2x 1KΩ resistors
    • 3x 100nF ceramic capacitors
    • 1x 1uF electrolytic capacitor
    • 1x 3.5mm stereo TRS socket (see photos and PCB for footprint)
    • 1x set of Arduino headers: 1x 10 pin; 2x 8 pin; 1x 6 pin
    • Optional: 1x 28 pin wide DIP socket

    Build Steps

    Taking a typical “low to high” soldering approach, this is the suggested order of assembly:

    • Resistors
    • DIP socket (if used) and TRS socket.
    • Disc capacitors.
    • Electrolytic capacitor.
    • 3-way jumper headers.
    • Oscillator (if used)
    • SI5351 pin headers (if used)
    • Arduino headers

    It should be decided up front if the board will use a fixed oscillator or a SI5351 programmable clock. Both could be installed, but there is a solder bridge that has to be used to determined which will be used. It isn’t possible to use both at the same time.

    This shows the solder bridge configured to use the SI5351. This might be easiest to do prior to soldering other components on the board.

    Here are some build photos.

    Here is a photo with the oscillator installed, and one with the SI5351 instead.

    Note: I didn’t solder the pin headers of the SI5351 to the PCB, but instead used the “fishing line trick” to push the board into the PCB without soldering. This means I have the option of reusing the board again for something else in the future.

    By default the SP0256A-AL2 /RESET line is connected to the Arduino RESET pin. It is possible to break this link by cutting the solder bridge shown below and wiring the RESET pad to another Arduino GPIO pin.

    Testing

    I recommend performing the general tests described here: PCBs.

    PCB Errata

    There are no known issues with this PCB at this time.

    Enhancements:

    •  With hindsight it might have been useful to have a jumper option to select the clock mode rather than a solder bridge. But it seemed quite a fundamental choice at the time of designing the PCB that I thought it perhaps shouldn’t be quite so easy to change. Now I’m not so sure!

    Find it on GitHub here.

    Sample Applications

    Here are some applications to get started with:

    Closing Thoughts

    Now it is a bit easier to experiment I can explore a few other musical possibilities.

    But this has shown up a slight issue with the chips I have. The highest frequency that the chip can support without locking up seems to be somewhat device dependent.

    I’ve seen nothing in the datasheet, application manual, or design guide that suggests it will function at all with anything other than a 3.12MHz oscillator, so I am running it quite a bit out of specification now.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  30. Arduino SP0256A-AL2 Shield PCB Build Guide

    Here are the build notes for my Arduino SP0256A-AL2 Shield Design.

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    Bill of Materials

    • Arduino SP0256A-AL2 Shield PCB (GitHub link below)
    • 1x SP0256A-AL2 (see notes here on sourcing: SP0256A-AL2 Speech Synthesis)
    • Either 1x 3.579545 MHz oscillator (4-pin in 8-pin DIP footprint – see photos)
    • Or 1x SI5351 breakout board (see photos)
    • 2x 1KΩ resistors
    • 3x 100nF ceramic capacitors
    • 1x 1uF electrolytic capacitor
    • 1x 3.5mm stereo TRS socket (see photos and PCB for footprint)
    • 1x set of Arduino headers: 1x 10 pin; 2x 8 pin; 1x 6 pin
    • Optional: 1x 28 pin wide DIP socket

    Build Steps

    Taking a typical “low to high” soldering approach, this is the suggested order of assembly:

    • Resistors
    • DIP socket (if used) and TRS socket.
    • Disc capacitors.
    • Electrolytic capacitor.
    • 3-way jumper headers.
    • Oscillator (if used)
    • SI5351 pin headers (if used)
    • Arduino headers

    It should be decided up front if the board will use a fixed oscillator or a SI5351 programmable clock. Both could be installed, but there is a solder bridge that has to be used to determined which will be used. It isn’t possible to use both at the same time.

    This shows the solder bridge configured to use the SI5351. This might be easiest to do prior to soldering other components on the board.

    Here are some build photos.

    Here is a photo with the oscillator installed, and one with the SI5351 instead.

    Note: I didn’t solder the pin headers of the SI5351 to the PCB, but instead used the “fishing line trick” to push the board into the PCB without soldering. This means I have the option of reusing the board again for something else in the future.

    By default the SP0256A-AL2 /RESET line is connected to the Arduino RESET pin. It is possible to break this link by cutting the solder bridge shown below and wiring the RESET pad to another Arduino GPIO pin.

    Testing

    I recommend performing the general tests described here: PCBs.

    PCB Errata

    There are no known issues with this PCB at this time.

    Enhancements:

    •  With hindsight it might have been useful to have a jumper option to select the clock mode rather than a solder bridge. But it seemed quite a fundamental choice at the time of designing the PCB that I thought it perhaps shouldn’t be quite so easy to change. Now I’m not so sure!

    Find it on GitHub here.

    Sample Applications

    Here are some applications to get started with:

    Closing Thoughts

    Now it is a bit easier to experiment I can explore a few other musical possibilities.

    But this has shown up a slight issue with the chips I have. The highest frequency that the chip can support without locking up seems to be somewhat device dependent.

    I’ve seen nothing in the datasheet, application manual, or design guide that suggests it will function at all with anything other than a 3.12MHz oscillator, so I am running it quite a bit out of specification now.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  31. Arduino SP0256A-AL2 Shield Design

    Having spent quite a bit of time with an Arduino hooked up to an SP0256A-AL2 on a solderless breadboard, and now that I’ve got some ideas for how I want to sort out the clock, I thought it time to create a PCB to save the unreliable wiring getting in the way!

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    The Circuit

    This is the basic circuit I’ve been using since Part 1 but I’ve added in an option to support the SI5351 from Part 5 instead of the oscillator, too. A solder jumper selects the clock source – there is no default setting.

    There is also a (default closed) solder jumper on the RESET line in case there is a need to separate out the reset of the SP0256A-AL2 from the Arduino.

    PCB Design

    The PCB design is relatively straight forward. Using an Arduino Uno Shield template, all the components have fitted in quite well.

    I had to create a custom symbol and footprint for both the SP0256A-AL2 itself and the SI5351 module I’m using.

    The following GPIO pins are in use.

    ArduinoSP0256A-AL2D2-D7A1-A6D8/ALDD9SBYGNDVSS, A7, A8, TEST, OSC2+5VVDD, VDI, SE, /SBY_RESET/RESET/RESETSI5351 (Optional)A4SDAA5SCLGNDGND+5VVIN

    As already mentioned, the link between the two /RESET pins is via a solder jumper and pin header connection which can be broken if required.

    I’ve added in additional breakout headers for all GPIO that isn’t connected to the SP0256A-AL2: D0-D1, D10-D13, A0-A3.

    I’ve not included A4-A5 as these are connected to the SI5351 (if used).

    Closing Thoughts

    Hopefully this is a fairly straight forward design with no major surprises.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  32. Arduino SP0256A-AL2 Shield Design

    Having spent quite a bit of time with an Arduino hooked up to an SP0256A-AL2 on a solderless breadboard, and now that I’ve got some ideas for how I want to sort out the clock, I thought it time to create a PCB to save the unreliable wiring getting in the way!

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    The Circuit

    This is the basic circuit I’ve been using since Part 1 but I’ve added in an option to support the SI5351 from Part 5 instead of the oscillator, too. A solder jumper selects the clock source – there is no default setting.

    There is also a (default closed) solder jumper on the RESET line in case there is a need to separate out the reset of the SP0256A-AL2 from the Arduino.

    PCB Design

    The PCB design is relatively straight forward. Using an Arduino Uno Shield template, all the components have fitted in quite well.

    I had to create a custom symbol and footprint for both the SP0256A-AL2 itself and the SI5351 module I’m using.

    The following GPIO pins are in use.

    ArduinoSP0256A-AL2D2-D7A1-A6D8/ALDD9SBYGNDVSS, A7, A8, TEST, OSC2+5VVDD, VDI, SE, /SBY_RESET/RESET/RESETSI5351 (Optional)A4SDAA5SCLGNDGND+5VVIN

    As already mentioned, the link between the two /RESET pins is via a solder jumper and pin header connection which can be broken if required.

    I’ve added in additional breakout headers for all GPIO that isn’t connected to the SP0256A-AL2: D0-D1, D10-D13, A0-A3.

    I’ve not included A4-A5 as these are connected to the SI5351 (if used).

    Closing Thoughts

    Hopefully this is a fairly straight forward design with no major surprises.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  33. Arduino SP0256A-AL2 Shield Design

    Having spent quite a bit of time with an Arduino hooked up to an SP0256A-AL2 on a solderless breadboard, and now that I’ve got some ideas for how I want to sort out the clock, I thought it time to create a PCB to save the unreliable wiring getting in the way!

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    The Circuit

    This is the basic circuit I’ve been using since Part 1 but I’ve added in an option to support the SI5351 from Part 5 instead of the oscillator, too. A solder jumper selects the clock source – there is no default setting.

    There is also a (default closed) solder jumper on the RESET line in case there is a need to separate out the reset of the SP0256A-AL2 from the Arduino.

    PCB Design

    The PCB design is relatively straight forward. Using an Arduino Uno Shield template, all the components have fitted in quite well.

    I had to create a custom symbol and footprint for both the SP0256A-AL2 itself and the SI5351 module I’m using.

    The following GPIO pins are in use.

    ArduinoSP0256A-AL2D2-D7A1-A6D8/ALDD9SBYGNDVSS, A7, A8, TEST, OSC2+5VVDD, VDI, SE, /SBY_RESET/RESET/RESETSI5351 (Optional)A4SDAA5SCLGNDGND+5VVIN

    As already mentioned, the link between the two /RESET pins is via a solder jumper and pin header connection which can be broken if required.

    I’ve added in additional breakout headers for all GPIO that isn’t connected to the SP0256A-AL2: D0-D1, D10-D13, A0-A3.

    I’ve not included A4-A5 as these are connected to the SI5351 (if used).

    Closing Thoughts

    Hopefully this is a fairly straight forward design with no major surprises.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  34. Arduino SP0256A-AL2 Shield Design

    Having spent quite a bit of time with an Arduino hooked up to an SP0256A-AL2 on a solderless breadboard, and now that I’ve got some ideas for how I want to sort out the clock, I thought it time to create a PCB to save the unreliable wiring getting in the way!

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to electronics and microcontrollers, see the Getting Started pages.

    The Circuit

    This is the basic circuit I’ve been using since Part 1 but I’ve added in an option to support the SI5351 from Part 5 instead of the oscillator, too. A solder jumper selects the clock source – there is no default setting.

    There is also a (default closed) solder jumper on the RESET line in case there is a need to separate out the reset of the SP0256A-AL2 from the Arduino.

    PCB Design

    The PCB design is relatively straight forward. Using an Arduino Uno Shield template, all the components have fitted in quite well.

    I had to create a custom symbol and footprint for both the SP0256A-AL2 itself and the SI5351 module I’m using.

    The following GPIO pins are in use.

    ArduinoSP0256A-AL2D2-D7A1-A6D8/ALDD9SBYGNDVSS, A7, A8, TEST, OSC2+5VVDD, VDI, SE, /SBY_RESET/RESET/RESETSI5351 (Optional)A4SDAA5SCLGNDGND+5VVIN

    As already mentioned, the link between the two /RESET pins is via a solder jumper and pin header connection which can be broken if required.

    I’ve added in additional breakout headers for all GPIO that isn’t connected to the SP0256A-AL2: D0-D1, D10-D13, A0-A3.

    I’ve not included A4-A5 as these are connected to the SI5351 (if used).

    Closing Thoughts

    Hopefully this is a fairly straight forward design with no major surprises.

    Kevin

    #arduinoUno #pcb #si5351 #sp0256aal2

  35. Driving the SP0256A-AL2 from an Arduino with a SI5351 I2C programmable clock.

    This is starting to get useful now (finally) :)

    diyelectromusic.com/2025/09/08

    #Arduino #SP0256AAL2 #SI5351

  36. Driving the SP0256A-AL2 from an Arduino with a SI5351 I2C programmable clock.

    This is starting to get useful now (finally) :)

    diyelectromusic.com/2025/09/08

    #Arduino #SP0256AAL2 #SI5351

  37. Driving the SP0256A-AL2 from an Arduino with a SI5351 I2C programmable clock.

    This is starting to get useful now (finally) :)

    diyelectromusic.com/2025/09/08

    #Arduino #SP0256AAL2 #SI5351

  38. Driving the SP0256A-AL2 from an Arduino with a SI5351 I2C programmable clock.

    This is starting to get useful now (finally) :)

    diyelectromusic.com/2025/09/08

    #Arduino #SP0256AAL2 #SI5351

  39. Arduino and SP0256A-AL2 – Part 5

    This looks at another of the options from Part 4 – the I2C programmable Si5351 clock source.

    • Part 1 – Basic introduction and getting started
    • Part 2 – Arduino programmable clock
    • Part 3 – Using a Raspberry Pi Pico as a programmable clock
    • Part 4 – Using a HC4046 PLL as the clock
    • Part 5 – Using an I2C SI5351 programmable clock
    • Part 6 – Adding MIDI

    https://makertube.net/w/bX5QNRRkAomFJQo7qY17he

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    If you are new to microcontrollers, see the Getting Started pages.

    I2C Si5351 Programmable Clock

    From the datasheet of the Si5351:

    “The Si5351 is an I2C configurable clock generator that is ideally suited for replacing crystals, crystal oscillators, VCXOs, phase-locked loops (PLLs), and fanout buffers in cost-sensitive applications. Based on a PLL/VCXO + high resolution MultiSynth fractional divider architecture, the Si5351 can generate any frequency up to 160 MHz on each of its outputs with 0 ppm error.”

    The device itself requires a 3V to 3.6V supply, but typical breakouts seem to include a LDO regulator meaning it can be powered from 3V to 5V. Logic outputs are always 3V but the I2C lines will be the same as the power supply.

    The Circuit

    I’m using a breakout board like the one shown above. This has header pins for the three clock outputs, power and ground, and I2C. Although the si5351 device itself is a 3V3 device, most breakouts like this seem to include components to allow them to be powered by either 3V3 or 5V. I’m using 5V in my circuit.

    I’m only using one of the clocks, so output 0 is fed into the OSC1 input of the SP0256A-AL2. Otherwise the rest of the SP0256A-AL2/Arduino circuit is the same as for part 1.

    The Code

    There are two libraries I’ve found for this:

    The Adafruit library is a fairly low-level interface to the device. The device basically has a multiplier which is used to set a PLL clock to somewhere between 600 and 900MHZ; and then a divisor to drop that back down to something useful.

    But the reality of setting the parameters is actually quite complicated. There is a full discussion of how to do it, with some example Arduino code, here: https://rfzero.net/tutorials/si5351a/

    It is not for the faint hearted!

    Thankfully the second library mentioned above, by “EtherKit”, has a ‘set_freq()’ function that does it all for us. The code to use it is therefore fairly straight forward:

    #include <si5351.h>
    #include <Wire.h>

    Si5351 si5351;

    void clockSetup () {
    si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
    si5351.set_freq(300000000ULL, SI5351_CLK0);
    si5351.update_status();
    }

    void setClock (uint64_t freq) {
    si5351.set_freq(freq, SI5351_CLK0);
    si5351.update_status();
    delay(300);
    }

    The initialisation function requires three things:

    • Which of 6, 8 or 10pF capacitors are used with the external oscillator.
    • Frequency of the external oscillator. Passing in 0 uses the default, 25MHz.
    • A parameter for frequency correction. I’m just using 0.

    The set_freq() function takes a 64-bit value which gives a frequency in 0.01Hz units, so 3MHz is 3 followed by 8 zeros. This is an “unsigned long long” type, hence the “ULL” initialiser after the value in the code above. The other parameter states which clock to use – I’m just using clock 0.

    It is possible to wire up a pot to an analog input and set the frequency using something like the following:

    int alglast = 0;
    void checkClock (void) {
    int algval = analogRead(ALG_IN);
    if (algval != alglast) {
    uin64_t freq = 1000 + 5 * analogRead(ALG_IN); // in kHz
    setClock(freq*100000); // Convert to 0.01Hz units
    }
    alglast = algval;
    }

    This maps a pot reading onto frequency values between 1MHz and just over 6MHz in units of 5kHz.

    Alternatively, it is possible to set pitches for individual allophones. I’ve found that loosely speaking, 3MHz seems to correspond to talking at the pitch of G#2 (MIDI note 44) which is an audio pitch frequency of round 98Hz. 6MHz is, as you might expect, G#3 (MIDI note 56 at 196Hz).

    This means that the I can calculate the required clock frequency for a MIDI note M using the formula:

    • Freq = 3MHz * 2 ^ (M – 44)/12

    This function will set the clock based on the MIDI note number:

    void midi2clock (int m) {
    if (m < 36 || m > 56) {
    return;
    }

    freq = 300000000 * pow (2.0, (((double)m-44.0)/12.0));
    setClock (freq);
    }

    Note how I’ve limited the range to between C2 (36) and G#3 (56), which means frequencies of 1.889MHz to 6MHz.

    It would probably go a bit lower – down to 1MHz is probably practical from the point of view of the chip functioning, but not so useful from the point of view of how long it would take to say a single allophone. Anything higher will cause the SP0256A-AL2 to lock up in a funny state.

    But that gives me a good octave and a fifth, which is quite a useful and practical range.

    Warning: The top frequency seems to be device dependent for me. I have one that can support the full 1.5 octaves and one that locks up after just an octave, so some experimentation is required!

    Find it on GitHub here.

    Closing Thoughts

    This is the most accurate and simplest to set up manner of providing a programmable clock I’ve found so far. The device itself is actually quite complex to use, but all that complexity has been hidden away in the Si5351 library published by EtherKit.

    The device sometimes seemed to get stuck in a weird state where is wasn’t recognised on the I2C bus. A power cycle or reset, or some combination of both, was usually required to get it going again. I don’t know if that was dodgy cables somewhere, but when it got stuck, curiously my nearby FM radio receiver lost its signal… Hmm.

    The downside of using the Arduino for both clock and speech control is that it isn’t possible to adjust the clock whilst the speech is happening. That would need some kind of parallel execution to manage that – either adding in another microcontroller, or maybe moving to a dual-core microcontroller.

    But as you can hear from the end of the video, this could still be pretty useful and I wish I’d had it for my Electric Lo-Fi Orchestra Concerto for a Rainy Day.

    Kevin

    #arduinoUno #electricLofiOrchestra #include #si5351 #sp0256aAl2