dzlonline / the_synth

A simple to use 4 polyphonic wavetable synthesizer library for Arduino.
328 stars 68 forks source link

Synth with barebone ATMEGA328p PU chip #19

Open montythepython opened 3 years ago

montythepython commented 3 years ago

Hi @dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

dzlonline commented 3 years ago

Hi. Question: by "connect the audio out pin" do you mean physically? Dzl

On Mon, Oct 5, 2020 at 9:36 AM montythepython notifications@github.com wrote:

Hi @dzlonline https://github.com/dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype https://github.com/troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7XCSC7CFKTI5PZNZ5MZHLSJFZRHANCNFSM4SEKOGBA .

montythepython commented 3 years ago

Hi dzl,

Yes when I connect the speaker to pin 3 and ground.

Or I can have pin 3 and ground wires to the audio jack and when I plug in the speaker/headphones, I have the issues I described

Thank you!

Le lun. 5 oct. 2020 à 11:38, Dzl notifications@github.com a écrit :

Hi. Question: by "connect the audio out pin" do you mean physically? Dzl

On Mon, Oct 5, 2020 at 9:36 AM montythepython notifications@github.com wrote:

Hi @dzlonline https://github.com/dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype https://github.com/troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AA7XCSC7CFKTI5PZNZ5MZHLSJFZRHANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19#issuecomment-703520466, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEL5YDBAC53TIGXH2UHF3Y3SJGH2DANCNFSM4SEKOGBA .

dzlonline commented 3 years ago

Hi,

Sounds like your problems are electrical. If you connect a speaker to a single pin (e.g. between CHA and GND) you need to put a DC blocking capacitor in series with the speaker: e.g. 220 microfarads with the positive end connected to CHA and negative end to the speaker. If you do not want to use a capacitor you can use the DIFF mode and connect the speaker between CHA and CHB.

Let me know if it solves your problem. Cheers Dzl

On Tue, Oct 6, 2020 at 11:58 PM montythepython notifications@github.com wrote:

Hi dzl,

Yes when I connect the speaker to pin 3 and ground.

Or I can have pin 3 and ground wires to the audio jack and when I plug in the speaker/headphones, I have the issues I described

Thank you!

Le lun. 5 oct. 2020 à 11:38, Dzl notifications@github.com a écrit :

Hi. Question: by "connect the audio out pin" do you mean physically? Dzl

On Mon, Oct 5, 2020 at 9:36 AM montythepython notifications@github.com wrote:

Hi @dzlonline https://github.com/dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype https://github.com/troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AA7XCSC7CFKTI5PZNZ5MZHLSJFZRHANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/dzlonline/the_synth/issues/19#issuecomment-703520466 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEL5YDBAC53TIGXH2UHF3Y3SJGH2DANCNFSM4SEKOGBA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19#issuecomment-704575509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7XCSHROWYHVS733OQNRADSJOHKDANCNFSM4SEKOGBA .

montythepython commented 3 years ago

Hi, thank you.

Ok I will try it tonight. I have two set ups at the moment. Same circuit on both, one with a nano and one just with the chip (plus crystal oscillator, etc)

At the beginning I had nothing between the speaker and CHA but like this, it does work on the nano and not on the chip.

I continued working on the circuit with the nano and added what I thought was a low pass circuit you show in the beginning of your code examples but I haven't tried it on the circuit with the chip.

Thank you, I will let you know.

Cheers

Le mer. 7 oct. 2020 à 12:42, Dzl notifications@github.com a écrit :

Hi,

Sounds like your problems are electrical. If you connect a speaker to a single pin (e.g. between CHA and GND) you need to put a DC blocking capacitor in series with the speaker: e.g. 220 microfarads with the positive end connected to CHA and negative end to the speaker. If you do not want to use a capacitor you can use the DIFF mode and connect the speaker between CHA and CHB.

Let me know if it solves your problem. Cheers Dzl

On Tue, Oct 6, 2020 at 11:58 PM montythepython notifications@github.com wrote:

Hi dzl,

Yes when I connect the speaker to pin 3 and ground.

Or I can have pin 3 and ground wires to the audio jack and when I plug in the speaker/headphones, I have the issues I described

Thank you!

Le lun. 5 oct. 2020 à 11:38, Dzl notifications@github.com a écrit :

Hi. Question: by "connect the audio out pin" do you mean physically? Dzl

On Mon, Oct 5, 2020 at 9:36 AM montythepython < notifications@github.com> wrote:

Hi @dzlonline https://github.com/dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype https://github.com/troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AA7XCSC7CFKTI5PZNZ5MZHLSJFZRHANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/dzlonline/the_synth/issues/19#issuecomment-703520466 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEL5YDBAC53TIGXH2UHF3Y3SJGH2DANCNFSM4SEKOGBA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/dzlonline/the_synth/issues/19#issuecomment-704575509 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AA7XCSHROWYHVS733OQNRADSJOHKDANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19#issuecomment-704851575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEL5YDEFPKWI6HSGJXWDLGLSJRAZJANCNFSM4SEKOGBA .

montythepython commented 3 years ago

Hi dzl!

That was it! Thank you. No idea why it works with the nano but not with the chip...

Next step is adding a midi out and integrating the code to what I already have for a sequencer done with a 4051 chip.

Nice blog dzl, very impressive!. Looking forward to playing with your synth library for the ESP32!

Cheers

Le mer. 7 oct. 2020 à 15:28, Dario Gomez dariogomezperez@gmail.com a écrit :

Hi, thank you.

Ok I will try it tonight. I have two set ups at the moment. Same circuit on both, one with a nano and one just with the chip (plus crystal oscillator, etc)

At the beginning I had nothing between the speaker and CHA but like this, it does work on the nano and not on the chip.

I continued working on the circuit with the nano and added what I thought was a low pass circuit you show in the beginning of your code examples but I haven't tried it on the circuit with the chip.

Thank you, I will let you know.

Cheers

Le mer. 7 oct. 2020 à 12:42, Dzl notifications@github.com a écrit :

Hi,

Sounds like your problems are electrical. If you connect a speaker to a single pin (e.g. between CHA and GND) you need to put a DC blocking capacitor in series with the speaker: e.g. 220 microfarads with the positive end connected to CHA and negative end to the speaker. If you do not want to use a capacitor you can use the DIFF mode and connect the speaker between CHA and CHB.

Let me know if it solves your problem. Cheers Dzl

On Tue, Oct 6, 2020 at 11:58 PM montythepython notifications@github.com wrote:

Hi dzl,

Yes when I connect the speaker to pin 3 and ground.

Or I can have pin 3 and ground wires to the audio jack and when I plug in the speaker/headphones, I have the issues I described

Thank you!

Le lun. 5 oct. 2020 à 11:38, Dzl notifications@github.com a écrit :

Hi. Question: by "connect the audio out pin" do you mean physically? Dzl

On Mon, Oct 5, 2020 at 9:36 AM montythepython < notifications@github.com> wrote:

Hi @dzlonline https://github.com/dzlonline,

Thank you for sharing this awesome project! I have been using your library without any issues on different nano boards. I recently got my hands on a couple of atmega328p PU (28DIP) chips.

After boot loading and uploading the sketch it all works well until I connect the audio out pin (in my case, pin 3, using CHB).

I know the sketch is running well without the audio input connected because the code runs an LED sequence (sequencer steps) and it works. I modify the tempo with a delay function in the sketch and turning the tempo potentiometer affects the LED sequence tempo accordingly.

Moreover, sometimes I connect the audio pin out and I do get some notes. Sometimes just one and it freezes, sometimes a full sequence and then it freezes...

I have tried different chips and get the same result. I was wondering if this can be related to the way the Synth.h is setting up the board.

@troisiemetype https://github.com/troisiemetype, reading the reported issues before creating one, I found a thread with you that made me think you can also have a good idea about what is happening here.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AA7XCSC7CFKTI5PZNZ5MZHLSJFZRHANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/dzlonline/the_synth/issues/19#issuecomment-703520466 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEL5YDBAC53TIGXH2UHF3Y3SJGH2DANCNFSM4SEKOGBA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/dzlonline/the_synth/issues/19#issuecomment-704575509>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AA7XCSHROWYHVS733OQNRADSJOHKDANCNFSM4SEKOGBA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dzlonline/the_synth/issues/19#issuecomment-704851575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEL5YDEFPKWI6HSGJXWDLGLSJRAZJANCNFSM4SEKOGBA .