[chuck-users] Matlab data help

Hayden Dahmm hwdahmm at live.com
Tue Jun 26 21:27:32 EDT 2012


Hi guys,
 
Thank you so much for your advice!  I hadn’t realized the meaning of OSC, so I really appreciate you bringing this to my attention.  I’m still a novice at programming, so I might need some time to digest the codes and examples. 
 
I’m still a bit confused about how to plug OSC outputs from Matlab into Chuck.  I understand that I could eventually save the OSC values in a variable, but would I need to use UDP and take down my firewall?
 
As was suggested, I’ve attached one of the data sets I’m working with.  It’s a csv with some 3,000 data points representing the stress-strain diagram for aluminum.  I’m hoping to put the values in the left column (strain) in a time array and the values in the right column (stress) in a frequency array.  These values were converted from matlab.
 
Thanks again for your help!
 
Cheers,
Hayden
hwdahmm at live.com

 

From: chuck-users-request at lists.cs.princeton.edu
Subject: chuck-users Digest, Vol 83, Issue 7
To: chuck-users at lists.cs.princeton.edu
Date: Sun, 24 Jun 2012 12:00:02 -0400

Send chuck-users mailing list submissions to
	chuck-users at lists.cs.princeton.edu
 
To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
or, via email, send a message with subject or body 'help' to
	chuck-users-request at lists.cs.princeton.edu
 
You can reach the person managing the list at
	chuck-users-owner at lists.cs.princeton.edu
 
When replying, please edit your Subject line so it is more specific
than "Re: Contents of chuck-users digest..."


--Forwarded Message Attachment--
From: witt0191 at gmail.com
To: chuck-users at lists.cs.princeton.edu
Date: Sun, 24 Jun 2012 01:13:29 +0100
Subject: Re: [chuck-users] Importing Data/Using Quadraphonic Headphones with ChucK

If the data is static another option is use to regex across the files
and import it in as variables not pretty put does work.
 
 
----------
visit me
 
http://www.scotthewitt.co.uk
@scotthewitt
 
http://www.theaudiopodcast.co.uk
http://www.ablelemon.co.uk
http://www.inclusiveimprov.co.uk/
 
 
On 23 June 2012 23:54, Jordan Orelli <jordanorelli at gmail.com> wrote:
> oh, wait, .m files.  Is the data being generated by Matlab?  I haven't tried
> it, but there's an OSC implementation for Matlab
> here: http://opensoundcontrol.org/implementation/matlab-osc
>
> Depending on how the data is generated, the simplest thing to do may be to
> just send OSC directly from Matlab to ChucK.
>
> -jordan
>
> On Saturday, June 23, 2012 at 6:45 PM, Jordan Orelli wrote:
>
> the documentation isn't the greatest when it comes to parsing data from
> files, but it is possible in ChucK.
>
> There are some examples on performing file i/o that you can read
> here: http://chuck.cs.princeton.edu/doc/examples/io/
>
> There are some examples on performing string manipulations that you can read
> here:  http://chuck.cs.princeton.edu/doc/examples/string/
>
> The string examples aren't listed on the main examples page, but they can be
> found in the examples directory that comes with the language.  It's
> definitely worth your time to look through those examples and listen to
> them.
>
> Do you have some sample files that you could post somewhere to share with
> us?  It would be helpful to have a dozen or so data points just so we know
> what the format is.
>
> How big are your data sets?  I'm curious to know if they are small enough to
> fit in memory or if a streaming approach is required.
>
> If I was in your position, I would probably use some other programming
> language to handle the data itself, format it into OSC messages, and send it
> to ChucK through OSC, especially if the data sets are large and you can't
> fit them in memory.  Of course, most other programming languages don't give
> you the time guarantees that ChucK gives you, so I would probably have ChucK
> send an OSC message to request a data point, with some other process sending
> an OSC message back in response.  In that way, you could iterate over a
> large dataset without ever holding it in memory.
>
> As an aside, do you have any recommendations on quadraphonic headphones?
>
> Oh and, if you're just starting out with ChucK, make sure you have test
> headphones to test new code, and don't wear them when learning new features.
>  I blew out the cones in a pair of headphones by accidentally setting the
> pole position of a OnePole ugen to 0, so… be careful ;)
>
> -jordan
>
> On Saturday, June 23, 2012 at 3:26 PM, Hayden Dahmm wrote:
>
> Hi everyone,
>
>
>
> My name is Hayden, and I’m a blind student at Swarthmore College, where I
> intend to major in Environmental Engineering.  Over the summer, I’m working
> on learning ChucK so I can create auditory data displays.  I’ve made decent
> progress so far, but I do have a couple questions.
>
>
>
> I’m struggling to import data from cmv or .m files, forcing me to enter
> values in by hand.  Does anyone have suggestions as to how I could
> circumvent this problem?
>
>
>
> Also, I plan to use a pair of quadraphonic headphones to interrogate spatial
> data with a joystick or track pad.  Has anybody tried using ChucK for this
> purpose before?  If so, I would be very interested to hear your thoughts.
>
>
>
> Thanks so much,
>
> Hayden
>
> hwdahmm at live.com
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
>
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
 


--Forwarded Message Attachment--
From: michaelclemow at gmail.com
To: chuck-users at lists.cs.princeton.edu
Date: Sat, 23 Jun 2012 21:54:30 -0400
Subject: Re: [chuck-users] Importing Data/Using Quadraphonic Headphones with ChucK

Format the data using something else so that it can read into chuck
scripts using the tokenizer and the put that into variables.
 
Jordan's got the right idea, I think.  Also, OSC is great for this
kind of thing.  Check out pyliblo OSC library for python. python's
great at data manipulation.
 
Peace,
Mike
 
Sent from my Computing Familiar.
 
On Jun 23, 2012, at 8:14 PM, Scott Hewitt <witt0191 at gmail.com> wrote:
 
> If the data is static another option is use to regex across the files
> and import it in as variables not pretty put does work.
>
>
> ----------
> visit me
>
> http://www.scotthewitt.co.uk
> @scotthewitt
>
> http://www.theaudiopodcast.co.uk
> http://www.ablelemon.co.uk
> http://www.inclusiveimprov.co.uk/
>
>
> On 23 June 2012 23:54, Jordan Orelli <jordanorelli at gmail.com> wrote:
>> oh, wait, .m files.  Is the data being generated by Matlab?  I haven't tried
>> it, but there's an OSC implementation for Matlab
>> here: http://opensoundcontrol.org/implementation/matlab-osc
>>
>> Depending on how the data is generated, the simplest thing to do may be to
>> just send OSC directly from Matlab to ChucK.
>>
>> -jordan
>>
>> On Saturday, June 23, 2012 at 6:45 PM, Jordan Orelli wrote:
>>
>> the documentation isn't the greatest when it comes to parsing data from
>> files, but it is possible in ChucK.
>>
>> There are some examples on performing file i/o that you can read
>> here: http://chuck.cs.princeton.edu/doc/examples/io/
>>
>> There are some examples on performing string manipulations that you can read
>> here:  http://chuck.cs.princeton.edu/doc/examples/string/
>>
>> The string examples aren't listed on the main examples page, but they can be
>> found in the examples directory that comes with the language.  It's
>> definitely worth your time to look through those examples and listen to
>> them.
>>
>> Do you have some sample files that you could post somewhere to share with
>> us?  It would be helpful to have a dozen or so data points just so we know
>> what the format is.
>>
>> How big are your data sets?  I'm curious to know if they are small enough to
>> fit in memory or if a streaming approach is required.
>>
>> If I was in your position, I would probably use some other programming
>> language to handle the data itself, format it into OSC messages, and send it
>> to ChucK through OSC, especially if the data sets are large and you can't
>> fit them in memory.  Of course, most other programming languages don't give
>> you the time guarantees that ChucK gives you, so I would probably have ChucK
>> send an OSC message to request a data point, with some other process sending
>> an OSC message back in response.  In that way, you could iterate over a
>> large dataset without ever holding it in memory.
>>
>> As an aside, do you have any recommendations on quadraphonic headphones?
>>
>> Oh and, if you're just starting out with ChucK, make sure you have test
>> headphones to test new code, and don't wear them when learning new features.
>>  I blew out the cones in a pair of headphones by accidentally setting the
>> pole position of a OnePole ugen to 0, so… be careful ;)
>>
>> -jordan
>>
>> On Saturday, June 23, 2012 at 3:26 PM, Hayden Dahmm wrote:
>>
>> Hi everyone,
>>
>>
>>
>> My name is Hayden, and I’m a blind student at Swarthmore College, where I
>> intend to major in Environmental Engineering.  Over the summer, I’m working
>> on learning ChucK so I can create auditory data displays.  I’ve made decent
>> progress so far, but I do have a couple questions.
>>
>>
>>
>> I’m struggling to import data from cmv or .m files, forcing me to enter
>> values in by hand.  Does anyone have suggestions as to how I could
>> circumvent this problem?
>>
>>
>>
>> Also, I plan to use a pair of quadraphonic headphones to interrogate spatial
>> data with a joystick or track pad.  Has anybody tried using ChucK for this
>> purpose before?  If so, I would be very interested to hear your thoughts.
>>
>>
>>
>> Thanks so much,
>>
>> Hayden
>>
>> hwdahmm at live.com
>>
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>>
>>
>>
>>
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120626/2ba8891d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alumstressstrain.csv
Type: application/vnd.ms-excel
Size: 47218 bytes
Desc: not available
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120626/2ba8891d/attachment-0001.xlb>


More information about the chuck-users mailing list