Forums > MaxMSP

converting ADC~ signal output to unsigned integers in max?

April 9, 2006 | 5:56 pm

Hello there,

1st post from a Max n00b, please be gentle! :)

I’m trying to do this live patch in Max, where I use a microphone to absorb sounds, but only use the unsigned byte representation from those sounds to manipulate parameters in the main patch. The actual output from the patch are manipulated samples. My idea is to create some kind of feedback loop, as the mangled outputted samples are recorded back into the microphone.

Is this realtime conversion possible at all? What object should I use to convert the signal to unsigned integers?

For a school assignment I’ve used the ‘filein’ object to read through a samplefile to get the byte representation (patch: http://sisforawesome.com/upload/files/25/myroom.rar ), but the ‘filein’ object doesn’t accept realtime streams, does it?

Any help on this would be greatly appreciated!

grtz

Richard


April 10, 2006 | 10:44 am

Is this a case of RTFM or am I trying to achieve an utopian dream? Anyone?

Another question:

Is it possible to record audio from the ‘adc’ into a buffer, and have that buffer saved immediately so it can be accessed with filein?


April 10, 2006 | 11:23 am

MSP Tutorial 13


April 10, 2006 | 11:31 am

On 9-Apr-2006, at 19:56, Richard Jonas wrote:
> Is this realtime conversion possible at all? What object should I
> use to convert the signal to unsigned integers?

The question is what do you mean by "convert the signal"?

In Max, signals are streams of 32-bit floats. Always. Period. For
ever and ever, amen.

If you want, you can

adc~ -> [+~ 1] -> [*~ 2147483648]

which would give you values in the range you seek. But:

- the values are still float
- there are accuracy issues because 32-bit floats only have a 24-bit
(effective) mantissa

Also note that integers in Max are signed ints. Always. Period.

> only use the unsigned byte representation from those sounds to
> manipulate parameters in the main patch.

Why not simply use signals as they are and base your calculations on
that? You’re going to have to be a lot more specific (ie include a
patch) to explain why you need to do things any other way.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter

iCE: Sequencing, Recording & |home | chez nous|
Interface Building for |bei uns | i nostri|
Max/MSP Extremely cool http://www.castine.de

http://www.dspaudio.com/


April 10, 2006 | 4:55 pm


April 10, 2006 | 6:20 pm

On 10-Apr-2006, at 18:55, Richard Jonas wrote:
> argh my english.

Your native language is probably spoken by numerous people on the
list. DE, NL, FR, IT, ES are all here in numbers, plus a few PT, VN,
ZH, and JP. If it helps you to describe a problem more precisely, go
for it. (Alas, I do not speak all of the above.)

> ….basically I want to see & use the insides of the incoming
> sound, the data.
> Just as ‘filein’ handles read in files, I want the incoming stream
> disected realtime into numbers. Is this clear?

adc~, sfplay~, buffer~ are all giving you numbers.

> "Why not simply use signals as they are and base your calculations
> on that?
>
> Because I don’t think that’s interesting! :) I’ve acquired a
> fascination with using hex-editors to manipulate my samples/
> compositions and like the idea of somehow doing similar stuff in max.

You may find bitand~ & Co. helpful. But if you want the minimum
signal value, why not just use minimum~.

Look, numbers are numbers, and whether you’re representing audio as
fp or ints is, first and foremost, a matter of custom and
convenience. Yes, of course there are some differences in the
capabilities of different representation formats. But you can express
about 99.9% of processing algorithms equivalently, regardless of the
format. That’s why I’m trying to pin down what you want to do.

– P.

BTW:
> values for random-value objects setting metronome/tempo speed/whatever

You may want to take a look at the link immediately below.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter

iCE: Sequencing, Recording & |home | chez nous|
Interface Building for |bei uns | i nostri|
Max/MSP Extremely cool http://www.castine.de

http://www.dspaudio.com/


April 11, 2006 | 2:01 am

Hey Peter, thnx for your reply & insight.. will check out your link for sure.

unfortunetely today has been a big drama for my computer/data/projects/life. My girlfriend has been very kind to install spyware (kazaa) onto my computer & now after cleaning up her shit -> I can’t restart windows without getting an activation screen! (strangely enough, I can access the internet through the online activation method)
Aparently together with the spyware I deleted my licence info(?). I have lost 2 faulty harddisks in 2005, and prolly can’t emotionally cope with another loss again. This project is set on hold.


April 11, 2006 | 8:36 am

On 11-Apr-2006, at 4:01, Richard Jonas wrote:
> I have lost 2 faulty harddisks in 2005, and prolly can’t
> emotionally cope with another loss again. This project is set on hold.

Ah, Windows…

One thing worth trying: I have had Max authorizaations evaporate on
my Windows box, resulting in a new Challenge. Strangely, the *old*
response worked. That may work for you if it’s just minor HD voodoo.
If you have to reformat (hard), you’ll probably need a new response.

BTW, the people at Cycling are very helpful in this sort of
situation, you just need to explain it and be aware that C/R is
handled by real human beings who go home at night and take the
weekend off.

Good luck,
Peter

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter

iCE: Sequencing, Recording & |home | chez nous|
Interface Building for |bei uns | i nostri|
Max/MSP Extremely cool http://www.castine.de

http://www.dspaudio.com/


April 13, 2006 | 9:38 pm

Richard Jonas wrote:
> Another question:
>
> Is it possible to record audio from the ‘adc’ into a buffer, and have
> that buffer saved immediately so it can be accessed with filein?

Yes, didn’t you try it?

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


April 14, 2006 | 12:01 am

well, gut feeling tells me everything is possible in max :) ..but at the moment my comp. is fucked.. so, will try it asap.


April 14, 2006 | 12:10 am

As a mac AND pc user I can safely confide and tell you that my pc spends 20% of time in a void. So i feel for you! ;)
Not that my mac is anybetter, I had to reboot earlier, only to find my password & master password did not work, fortunately a reboot fixed it. hmm, something tells me my logic-board battery is running weak…


April 14, 2006 | 3:29 am

What I’m getting out of this.

Input is converted to numbers and used to somehow manipulate that output.

The output is then recorded fed back in and converted, and new output is output based on that.

So basically, it seems that he wants to write a somewhat recursive patch. That reacts to it’s own output.

Seems quite easy, when you get your PC fixed, first hide the keyboard from your girlfriend, or set permissions so she can’t install ( that would be hilarious ), then download soundflower, an audio patcher/router/inputer/outputer it’s a really handy application and can be used for looping the audio without using an external microphone. Or you’re gonna have to put the mic up to the speaker. Which causes that lovely high pitched sound we all love so much.

My head is swelling with ideas for this, but if you take some time while installing Windows again or whatever you gotta do and read through the MSP and Max tutorials, it will really help. Also there is a nice book that helped me stick it out ( because the learning curve was pretty harsh for me) called like "interactive music and ideas using max" it’s old, but it’s kind of fun to read while you’re on the toilet.

Also, be sure to make your loops terminate so that you don’t overflow the stack. That wouldn’t be nice to be presenting it and have it freeze up on you.


April 16, 2006 | 11:59 pm

Back from the dead :) I re-installed windows, set a seperate account for my girlfriend as this is not happening ever again! I love her to death, but there are limits.

David G : thnx for the recommendations, will look into that book.
Had a quick google on soundflower, but that’s mac only, isn’t it?

I’ve started on a little something, basically a sfrecord~ patch that saves the adc~ input to .wav every 10 seconds. Problem now is that I don’t know how to change the default save path for sfrecord~ ! Normally you use the ‘open’ message to select a save path yourself, but since I automated this.. Max saves the .wav’s in the Max-help folder! Now ‘filein’ can’t read in the .wav’s, without me moving the patches into the max-help folder.

Is it possible to include the save path in the open message, I can’t find anything about this in the reference manual about sfrecord~. Now I have the message ‘open 1.wav’ linked to the sfrecord~ object, how should I change this to make it save in another place then the default folder?

any help is appreciated!

Richard


April 17, 2006 | 1:51 am

Yo, I didn’t realize soundflower was OSX only.

I suppose you can eliminate feedback if the input isn’t being directly routed to speakers.


April 18, 2006 | 2:45 pm

Richard Jonas wrote:
> Normally you use the ‘open’ message to select a save path yourself,
> but since I automated this.. Max saves the .wav’s in the Max-help
> folder! Now ‘filein’ can’t read in the .wav’s, without me moving the
> patches into the max-help folder.

If you give open an argument with a complete path (put it in quotes if
there are spaces in it) it will open thye filoe where you defined it
with the complete path.

There might be a section about paths in "tutorials and topics"…

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


April 18, 2006 | 4:16 pm

Hey Stefan, people on other messageboards also hinted in that direction..tho I found out later that max removes the / in the path…and needs a backslash as substitute for it to work. C:/temp/1.wav saved the recorded wave, but as temp1.wav in the C: folder :)

btw by keeping the filein object in the same patch as the sfrecord~ object, filein automatically finds the wav..this solves all my problems without having to specify specifics


April 19, 2006 | 8:44 am

Richard Jonas wrote:
> Hey Stefan, people on other messageboards also hinted in that
> direction..tho I found out later that max removes the / in the
> path…and needs a backslash as substitute for it to work.
> C:/temp/1.wav saved the recorded wave, but as temp1.wav in the C:
> folder :)

I don’t know too much about the windows way of pathing, but did you come
across the conformpath object? It could deal with these issues
automatically.

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


Viewing 17 posts - 1 through 17 (of 17 total)