Convert signal to data

Aug 15, 2007 at 9:24pm

Convert signal to data

How can I convert a signal stream to data? There’s an object that may work called sig2MIDI but it is only for OSX and I’m running windows. I need to convert an output from the adc~ to raw data (numbers) so I can then manipulate that data to trigger samples etc.

Any ideas?

#33276
Aug 15, 2007 at 9:29pm

#110640
Aug 15, 2007 at 9:38pm

Right, so if I want a constant update of the converted signal, I should do this, right?

#P window setfont “Sans Serif” 9.;
#P flonum 33 55 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 34 103 33 9109513 ftom~;
#P message 88 79 28 9109513 bang;
#P flonum 34 175 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 34 128 51 9109513 snapshot~;
#P newex 33 79 36 9109513 cycle~;
#P connect 5 0 0 0;
#P connect 5 0 3 0;
#P connect 0 0 4 0;
#P connect 3 0 1 0;
#P connect 4 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 6;

I want to convert the frequency of the signal to MIDI notes, but something is not right. I’m getting strange numbers when the signal is converted. For example, shouldnt 278 Hz (middle C) convert to 60 (middle C)?

#110641
Aug 15, 2007 at 9:44pm

#110642
Aug 15, 2007 at 9:47pm

#110643
Aug 15, 2007 at 10:14pm

Thanks! I had heard about fiddle~ before but I never knew exactly what it did. It’s kind of strange to understand how to get it to work, but I’m getting there. Thanks again!

#110644
Aug 16, 2007 at 7:05pm

before you are using snapshot~ 5 you might want to use a rampsmooth~ or slide~ before.

#110645
Aug 16, 2007 at 8:34pm

All right, I got fiddle~ working with a cycle~. However, when I change the pitch (in midi notes) to 44, the output of fiddle for pitch gives me 0, instead of 44. If I set cycle~ at 45, I get the correct output of 45. but for some reason 44 brings it down to 0. Here’s the test patch.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 153 65 18 9109513 57;
#P newex 153 37 45 9109513 loadbang;
#P newex 272 115 33 9109513 sig~ 1;
#P toggle 136 244 15 0;
#P flonum 385 237 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 352 274 80 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 269 274 80 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 269 234 93 9109513 unpack 0. 0.;
#P flonum 153 129 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 153 107 28 9109513 mtof;
#P newex 153 244 28 9109513 dac~;
#P newex 271 201 163 9109513 fiddle~ 1024 1 20 3;
#P number 153 89 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 153 149 36 9109513 cycle~;
#P comment 288 291 108 9109513 Raw pitch and amplitude;
#P comment 382 255 67 9109513 amplitude (dB);
#P connect 14 0 15 0;
#P connect 15 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 2 0;
#P connect 2 0 5 0;
#P connect 12 0 5 0;
#P connect 2 0 5 1;
#P connect 4 2 8 0;
#P connect 8 0 9 0;
#P connect 2 0 4 0;
#P connect 13 0 4 0;
#P connect 8 1 10 0;
#P connect 4 3 11 0;
#P window clipboard copycount 16;

Any ideas as to why it does that? I tried amplifying the signal of cycle~ before it goes into fiddle~ but that just brings the amplitude up.

#110646
Aug 16, 2007 at 8:45pm

frequencies lower than 44 Hz are probably beyond what
fiddle~ is able to analyze.

its quite difficult to fin the loudest fundamental
below that point. (as well as above nyquist)

-110

#110647
Aug 16, 2007 at 8:51pm

Ah, I see. But it’s not 44Hz, its midi note 44, which is 110Hz.

Oh well, I’ll try to work with that then. Thanks very much for the help!

#110648
Aug 17, 2007 at 9:03am

it’s cos the window size is too small. it cant identify pitches which have a longer waveform period than the window for analysis.

try this:

#P user kslider 312 64 35 1 36 48 19 7 0 128 128 128 128 128 128 255 255 255 0 0 0 0 0 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 213 125 18 196617 57;
#P newex 213 97 45 196617 loadbang;
#P toggle 196 304 15 0;
#P flonum 445 297 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 412 334 80 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 329 334 80 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 329 294 93 196617 unpack 0. 0.;
#P flonum 213 189 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 213 167 28 196617 mtof;
#P newex 213 304 28 196617 dac~;
#P newex 331 261 101 196617 fiddle~ 2048 1 20 3;
#P number 213 149 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 213 209 36 196617 cycle~;
#P comment 348 351 122 196617 Raw pitch and amplitude;
#P comment 442 315 81 196617 amplitude (dB);
#P window linecount 5;
#P comment 387 188 116 196617 change window size to 2048 (was 1024) // see documentation in fiddle help for full explanation;
#P connect 3 0 6 0;
#P connect 3 0 6 1;
#P connect 3 0 5 0;
#P connect 5 2 9 0;
#P connect 5 3 12 0;
#P connect 16 0 4 0;
#P connect 9 1 11 0;
#P connect 9 0 10 0;
#P connect 13 0 6 0;
#P connect 8 0 3 0;
#P connect 7 0 8 0;
#P connect 4 0 7 0;
#P connect 15 0 4 0;
#P connect 14 0 15 0;
#P window clipboard copycount 17;

#110649
Aug 17, 2007 at 9:44am

Gus schrieb:
> Ah, I see. But it’s not 44Hz, its midi note 44, which is 110Hz.

That’s why Roman always precedes his patches with 110, he never got
below it…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#110650
Aug 17, 2007 at 6:29pm

Thanks Justin. I imagine I can make the window size larger to get even lower frequencies analyzed. at 2048, it wont go lower than 34/33.

#110651
Aug 17, 2007 at 9:38pm

#110652
Aug 19, 2007 at 11:50am

Gus schrieb:
> Thanks Justin. I imagine I can make the window size larger to get
> even lower frequencies analyzed. at 2048, it wont go lower than
> 34/33.

But it comes for a price: latency…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#110653
Feb 17, 2008 at 5:43am

How could I get the objects fiddle~, pitch~, yin~
I’m trying to get data out of some signals to
produce color.
Please anyone tell me where to go (URL)
and get them
Regards
elcromagnoncriollo

#110654
Feb 17, 2008 at 7:06am

On Feb 16, 2008, at 9:43 PM, Marcos Salazar Delfino wrote:
> Please anyone tell me where to go (URL)
> and get them

You can find most objects here:

http://www.maxobjects.com

-C

#110655
Feb 17, 2008 at 3:12pm

Thanks for your fast answer Chris.
The thing is, that when I go to Maxobjects, it takes me to ircam forum and I can’t find the object, only some info
but not the object

Sorry for bother, I’m kind of a newby to the forum

Thanks again
Marcos

#110656

You must be logged in to reply to this topic.