[PD] pitch to voltage
dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon sinetosawtooth.pd Description: Binary data ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] UDOO Quad and Generic Guitar to USB link issues
do you use the hardware or the plugin tab in the pd preferences? i found that i had to use the plugin and not the hardware to get results without distortion. also you should use debian hard float image and not linaro, it works better with puredata. and, i would not use jack but alsa directly with puredata. On 11 Apr 2014, at 01:54, Carlos Sanchez csanchez...@gmail.com wrote: Neat project sir! I have tried what you mentioned Brian and I cant get the system to even play sounds with the right device. Using aplay file.wav works with the default output but when i try to specify the output like so aplay -D hwplug;2,0 file.wav nothing comes up. I got these commands somewhere on the net, can you vouch for them? Also, when listing the devices with alsamixer, my soundcard lists a mic input which is odd since it has a mono in and stereo out... If this is of any use, here is the output of aplay -l: List of PLAYBACK Hardware Devices card 0: vt1613audio [vt1613-audio], device 0: HiFi vt1613-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 My soundcard is the card 2 and I can not get any sound out of it via aplay! On Tue, Apr 8, 2014 at 5:26 PM, Brian Fay ovaltinevor...@gmail.com wrote: The reason I suggested trying arecord | aplay is because it would be running input and output simultaneously. In Audacity, you're doing one after the other. Unfortunately, I'm not sure exactly what is going wrong here. Does your soundcard work as expected on other computers? Was it fine on the BeagleBone Black? On the Raspberry Pi, I'm running a multi-effects pedal, all built in Pd. There's two parallel chains of processes, (each can run up to eight effects). The effects I'm using are a looper, delay, waveshaper distortion, flanger, granular synthesis (sort of limited implementation), reverb, and EQ. I'm controlling things with a QuNeo MIDI controller and a push button attached to the GPIO pins on the Pi. By default, each of the eight effects in each chain are set to bypass, which simply passes the signal onto the next effect. However, you can adjust this on the fly for the effects to be whatever you want, so I can set up something like: Chain A: looper - distortion - flanger - delay - granular - reverb - EQ - bypass - output Chain B: delay - bypass - bypass - bypass - bypass - bypass - bypass - bypass - output I can independently control volume of each chain, so I could use Chain A to build up some sort of droning ambience, and then solo over it using Chain B. In practice, there is definitely a limit to the ability of the Raspberry Pi. I think the example I just mentioned would probably run, but if I try throwing too many effects on at once, (flanger, reverb, distortion, and granular are all pretty intensive), I will start getting glitches - huge crackles and jitters in audio. Turning off a few effects will stop the glitches, but I all I can do to prevent them is to be conservative about how many effects I turn on. Just uploaded a little demo to Soundcloud of a recording I made with a somewhat similar FX setup to what I mentioned. It was recorded with my cell-phone, so it's a bit awful sound quality-wise (also really really quiet, whoops...). https://soundcloud.com/ovaltine-vortex/raspberry-improv If you're curious about the patches and stuff, it's all here, but it's hard-coded to MIDI values on the QuNeo and might be a bit confusing: https://github.com/YottaSecond/thesisRepo On Sun, Apr 6, 2014 at 2:37 PM, Carlos Sanchez csanchez...@gmail.com wrote: Hey list, Thanks for your prompt replies and helpfulness! I could not get qjackctl to work, the audio will not go through and the PD CPU load gets abnormally high at around 67%... I had already played with the sample rate and I had noticed that augmenting the frequency yields better results but the noise was still very present. The sound card itself works correctly with Audacity so I am sure it would work with the arecord and aplay commands Brian suggested. Weirdly, it is only with PD that it is struggling... On a more encouraging note, as Brian suggested, it seems that the problem (or one possibility) is the duplex audio. I haven't thought about using the card as an output only device before and it did work! But afterwards, I was not able to change the settings back and use the noisy duplex audio any more, I was only able to switch the output devices... @Brian: What type of software are you using for the signal processing with the Raspberry Pi? I am very curious because I had first attempted to build this project on a BeagleBone Black but the heavy PD patches made it unstable or
Re: [PD] pitch to voltage
That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
Sorry for the double answer, but this also occurs to me: To improve accuracy, measure both halves of the cycle and add them. To improve further, upsample the whole mess, say by a factor of 16. Doint both of those would improve the theoretical resolution by a factor of 32. (Of course, you still have the guitar's own variation from cycle to cycle to worry about :) M On Sun, Apr 27, 2014 at 03:56:18AM -0700, Miller Puckette wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
crosspost! sorry about the noise. thanks for the inputs i will try to to this. not sure if i can. otherwise i will ask back if that’s ok! On 27 Apr 2014, at 13:03, Simon Iten itensi...@gmail.com wrote: so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] How to read I2C sensors?
I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
ok tried to upsample the whole thing (after the osc~) and now change~ does nothing anymore… it just spits out the same square wave i feed in…clues? On 27 Apr 2014, at 13:05, Simon Iten itensi...@gmail.com wrote: crosspost! sorry about the noise. thanks for the inputs i will try to to this. not sure if i can. otherwise i will ask back if that’s ok! On 27 Apr 2014, at 13:03, Simon Iten itensi...@gmail.com wrote: so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
Actually I don't know where the change~ object is from - I've nver seen t before. I would just use biquad~ 0 0 1 -1 0 (assuming that change~ simply ubtracts the previous sample from teh current one as I guessed from the patch :) M On Sun, Apr 27, 2014 at 03:40:01PM +0200, Simon Iten wrote: ok tried to upsample the whole thing (after the osc~) and now change~ does nothing anymore… it just spits out the same square wave i feed in…clues? On 27 Apr 2014, at 13:05, Simon Iten itensi...@gmail.com wrote: crosspost! sorry about the noise. thanks for the inputs i will try to to this. not sure if i can. otherwise i will ask back if that’s ok! On 27 Apr 2014, at 13:03, Simon Iten itensi...@gmail.com wrote: so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency. i would really appreciate if somebody could have a look at this, thanks, simon ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] How to read I2C sensors?
What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] How to read I2C sensors?
Thanks! Could be a possibility but I was hoping for an object that would be able to read I2C directly without adding an arduino since most smaller arm boards do have some I2C pins onboard. Ingo Von: Alexandros Drymonitis [mailto:adr...@gmail.com] Gesendet: Sonntag, 27. April 2014 19:00 An: Ingo Cc: pd-list Betreff: Re: [PD] How to read I2C sensors? What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] How to read I2C sensors?
I forget what i2c uses driverwise, but if it is spidev, in pd-l2ork you have disis_spi external that allows for reading data from mcp3008 8-channel ad converter. The external is specifically designed for Raspberry Pi build of pd-l2ork, but I don't see a reason why it could not be compiled for vanilla Pd as well. Perhaps it can be also used with your setup? On Apr 27, 2014 1:53 PM, Ingo i...@miamiwave.com wrote: Thanks! Could be a possibility but I was hoping for an object that would be able to read I2C directly without adding an arduino since most smaller arm boards do have some I2C pins onboard. Ingo Von: Alexandros Drymonitis [mailto:adr...@gmail.com] Gesendet: Sonntag, 27. April 2014 19:00 An: Ingo Cc: pd-list Betreff: Re: [PD] How to read I2C sensors? What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] pitch to voltage
sorry this one went off-list :-) On 27 Apr 2014, at 19:05, simon itensi...@gmail.com wrote: sure, here is the version with biquad in a subpatch with a block opject to upsample. probably i'm doing something wrong, i just copied from the block help-patch. sinetosawtoothupsample.pd On Apr 27, 2014, at 5:48 PM, Miller Puckette wrote: Drat, I don't have any explanation for this... can you send me the patch again? cheers M On Sun, Apr 27, 2014 at 05:44:22PM +0200, simon wrote: hmm, changing change to biquad does also not work. i mean it does as long as i don't upsample in the subpatch. as soon as i change the block object i get square instead of pulses... On Apr 27, 2014, at 3:48 PM, Miller Puckette wrote: Actually I don't know where the change~ object is from - I've nver seen t before. I would just use biquad~ 0 0 1 -1 0 (assuming that change~ simply ubtracts the previous sample from teh current one as I guessed from the patch :) M On Sun, Apr 27, 2014 at 03:40:01PM +0200, Simon Iten wrote: ok tried to upsample the whole thing (after the osc~) and now change~ does nothing anymore… it just spits out the same square wave i feed in…clues? On 27 Apr 2014, at 13:05, Simon Iten itensi...@gmail.com wrote: crosspost! sorry about the noise. thanks for the inputs i will try to to this. not sure if i can. otherwise i will ask back if that’s ok! On 27 Apr 2014, at 13:03, Simon Iten itensi...@gmail.com wrote: so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate. or the problem is that i sample in the middle of the rising and not at the top ( as described earlier) attached the sinetosawtooth
Re: [PD] How to read I2C sensors?
Thanks Ivica, I'll check out pd-l2ork. I might use a Raspberry Pi for that purpose anyway. I need some capacitive sensors that work without actually touching them. All I found was using I2C. Ingo Von: Ivica Bukvic [mailto:i...@vt.edu] Gesendet: Sonntag, 27. April 2014 20:38 An: Ingo Cc: Alexandros Drymonitis; pd-list Betreff: Re: [PD] How to read I2C sensors? I forget what i2c uses driverwise, but if it is spidev, in pd-l2ork you have disis_spi external that allows for reading data from mcp3008 8-channel ad converter. The external is specifically designed for Raspberry Pi build of pd-l2ork, but I don't see a reason why it could not be compiled for vanilla Pd as well. Perhaps it can be also used with your setup? On Apr 27, 2014 1:53 PM, Ingo i...@miamiwave.com wrote: Thanks! Could be a possibility but I was hoping for an object that would be able to read I2C directly without adding an arduino since most smaller arm boards do have some I2C pins onboard. Ingo Von: Alexandros Drymonitis [mailto:adr...@gmail.com] Gesendet: Sonntag, 27. April 2014 19:00 An: Ingo Cc: pd-list Betreff: Re: [PD] How to read I2C sensors? What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] How to read I2C sensors?
On 2014-04-27 13:52, Ingo wrote: Thanks! Could be a possibility but I was hoping for an object that would be able to read I2C directly without adding an arduino since most smaller arm boards do have some I2C pins onboard. If the machine Pd is running on has an I2C port and is running linux then you can use spidev to access it. Otherwise you need to use a serial connection to an off-board microcontroller like the arduino or teensy or FRDM-KL25Z to relay messages between the I2C and USB serial connections. A lot of motherboards have I2C but it's mainly used for the temperature sensors and you don't get access via any header. Ingo Von: Alexandros Drymonitis [mailto:adr...@gmail.com] Gesendet: Sonntag, 27. April 2014 19:00 An: Ingo Cc: pd-list Betreff: Re: [PD] How to read I2C sensors? What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] How to read I2C sensors?
Check out also pd-l2ork k12 documentation where you can learn more about lots of pots RPi shield that gives you essentially 8 capacitive channels via the aforesaid mcp3008 d/a chip. This is what pd-l2ork essentially supports out of box. To access k12 mode start it with appropriate shortcut or simply type pd-l2ork -k12 HTH On Apr 27, 2014 3:52 PM, Ingo i...@miamiwave.com wrote: Thanks Ivica, I'll check out pd-l2ork. I might use a Raspberry Pi for that purpose anyway. I need some capacitive sensors that work without actually touching them. All I found was using I2C. Ingo Von: Ivica Bukvic [mailto:i...@vt.edu] Gesendet: Sonntag, 27. April 2014 20:38 An: Ingo Cc: Alexandros Drymonitis; pd-list Betreff: Re: [PD] How to read I2C sensors? I forget what i2c uses driverwise, but if it is spidev, in pd-l2ork you have disis_spi external that allows for reading data from mcp3008 8-channel ad converter. The external is specifically designed for Raspberry Pi build of pd-l2ork, but I don't see a reason why it could not be compiled for vanilla Pd as well. Perhaps it can be also used with your setup? On Apr 27, 2014 1:53 PM, Ingo i...@miamiwave.com wrote: Thanks! Could be a possibility but I was hoping for an object that would be able to read I2C directly without adding an arduino since most smaller arm boards do have some I2C pins onboard. Ingo Von: Alexandros Drymonitis [mailto:adr...@gmail.com] Gesendet: Sonntag, 27. April 2014 19:00 An: Ingo Cc: pd-list Betreff: Re: [PD] How to read I2C sensors? What if you use the Wire library in Arduino and then collect the info in Pd with [comport]? On Sun, Apr 27, 2014 at 2:06 PM, Ingo i...@miamiwave.com wrote: I have been using an arduino with [comport] (pduino) to read out sensors so far and want to use a I2C sensor board for some other sensors soon. Can [comport] connect to the I2C interface or is there another object in Pd-extended that can do that? Thanks! Ingo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] SOLVED!!! Re: pitch to voltage SOLVED!!!
hey miller and list, find attached a version that works beautifully. it's a dirty hack without upsampling but it works extremly well. don't ask me why, i have no idea. thanks for all the help miller, really appreciate it! and thanks for pd in general :-) cheers, simon sinetosawtooth.pd Description: Binary data On Apr 27, 2014, at 8:59 PM, Simon Iten wrote: sorry this one went off-list :-) On 27 Apr 2014, at 19:05, simon itensi...@gmail.com wrote: sure, here is the version with biquad in a subpatch with a block opject to upsample. probably i'm doing something wrong, i just copied from the block help-patch. sinetosawtoothupsample.pd On Apr 27, 2014, at 5:48 PM, Miller Puckette wrote: Drat, I don't have any explanation for this... can you send me the patch again? cheers M On Sun, Apr 27, 2014 at 05:44:22PM +0200, simon wrote: hmm, changing change to biquad does also not work. i mean it does as long as i don't upsample in the subpatch. as soon as i change the block object i get square instead of pulses... On Apr 27, 2014, at 3:48 PM, Miller Puckette wrote: Actually I don't know where the change~ object is from - I've nver seen t before. I would just use biquad~ 0 0 1 -1 0 (assuming that change~ simply ubtracts the previous sample from teh current one as I guessed from the patch :) M On Sun, Apr 27, 2014 at 03:40:01PM +0200, Simon Iten wrote: ok tried to upsample the whole thing (after the osc~) and now change~ does nothing anymore… it just spits out the same square wave i feed in…clues? On 27 Apr 2014, at 13:05, Simon Iten itensi...@gmail.com wrote: crosspost! sorry about the noise. thanks for the inputs i will try to to this. not sure if i can. otherwise i will ask back if that’s ok! On 27 Apr 2014, at 13:03, Simon Iten itensi...@gmail.com wrote: so if i would measure at the peak of the sawtooth and would upsample inside the pd patch, i would get higher resolution, right? any ideas how i can measure at the peak? (using the rpole output on both samphold inputs does not work and delaying one of them is also not working) which i would highly recommend you try this method with your gk-3 equipped guitar (one for each string) since you only have to cover a two octave range per string the error is tolerable. (you can add an offset to make it fit) On 27 Apr 2014, at 12:56, Miller Puckette m...@ucsd.edu wrote: That is an excellent, witty way to measure pulse withs using only tilde obects - my hat's off to you. The methond only has limited accuracy since its measurement is in samples. For instance, a 1/2 cycle of a 440-hz. tone at 44.1 kHz is only 50 samples, so there's only 2% accuracy. That's about 1/3 of a half tone (30-ish cents) which would sound horribly out of tune. There's an alternative sine-to-sawtooth recipe described here: http://msp.ucsd.edu/Publications/icmc10.pdf This is the basis of my guitar processing patch, smeck, but should be more broadly useful. But it has its own limitations: the sawtooth you get out is wiggly if the input sn't a pure sinusoid. There's also the possibility of simply pitch tracking with sigmund~. Use a maximum frequency around 6000 and a maximum of 6 partals (default 50!) for best results. cheers M On Sun, Apr 27, 2014 at 11:27:33AM +0200, Simon Iten wrote: dear list, i have a strange problem with my “sinetosawtooth” patch. it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland. i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string) here is how it works (or should): -an input signal gets amplified by a large factor and clipped. this squares the input. -the square wave is converted to pulses. -the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~) this results in a sawtooth wave that varies in amplitude depending on the frequency of the input. -a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah! in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have 22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome. now to the problem: the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control. i first thought this is because
[PD] anything pd related happening in NYC from May 19-27?
or unrelated? electronic music shows, analog or digital. let's hang out and stuff. Will there be a patching circle in May? -- www.epicjefferson.com ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [Patching Circle] Generative Musical Apps this Friday!
Hi Epic, the next patching circle will be on May 22 at ITP/NYU, 721 Broadway, 4th floor. Cheers! Sofy Yuditskaya s~ http://yuditskaya.com On Sat, Apr 26, 2014 at 2:50 PM, Epic Jefferson jeffreyconcepc...@gmail.com wrote: Hey Sofy, I'll be in NY from May 19-27. When is the patching circle? On Tue, Apr 8, 2014 at 2:36 PM, sonia yuditskaya marysgh...@gmail.comwrote: *Patching Circle* *Fri, April 116:30pm* *Conference Room* Embedded Generative Music Systems on Android and iOS with Chris McCormick and Dan Wilcox. Learn how to embed Pure Data on your Android or iPhone. The New York City Patching Circle is an free alternating monthly meeting and salon open to anyone who is working or interested in media programming and audiovisual performance. We mostly use Pd and Max/MSP, but all are welcome. Beginners and Experienced welcome. Open to everyone, students, the public, unicorns. Work on personal projects, professional projects, school projects, ask for help, help others, or just patch quietly to yourself in a room full of other people patching patches and helping other people patch. Each month there will be informal salon, featuring demonstrations of projects, performances and systems in the process of being built. The format will include short performances, artist talks about process and performance techniques and QA depending on time availability. The salon is openly curated with the intent of being as inclusive as possible and participation is open all practitioners working in realtime media. Sofy Yuditskaya s~ http://yuditskaya.com ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list -- www.epicjefferson.com ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list