samplematrix tests?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

samplematrix tests?

Nathan Wolek-2
Tim:

I was examining the new TTSampleMatrix code today.  My attempts at using Ruby to test things out are still failing.  I am sure this is mostly due to my inexperience with Ruby.

Are the peek and poke messages exposed in Ruby?  If so, I can not seem to figure out the right syntax.  

Maybe I am assuming that more methods/messages/variables are exposed in Ruby than what is in fact reality?

I have a samplematrix.test.rb file in a local branch here.  Doesn't do anything right now, but I will try to push it to master.  

[after attempt]

OK, the fact that I made a local branch is tripping me up.  Hoping you can still comment on what should be exposed in Ruby.

--Nathan
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Timothy Place-2
Hi,

Here is a transcript from the terminal, where I run irb and then play with it a little.  It will show that something is goofy, but it will also show how I came to that determination:

tim$ irb
>> require "Jamoma"
JamomaFoundation -- Version 0.6
JamomaDSP -- Version 0.6
JamomaGraphics -- Version 0.2 -- Debugging Enabled
=> true
>> o = TTObject.new "samplematrix"
=> #<TTObject:0x103739688>
>> o.messages?
=> ["getProcessingBenchmark", "fill", "test", "resetBenchmarking", "poke", "peek", "clear", "normalize", "getValueAtIndex", "setValueAtIndex", "set", "get"]
>> o.attributes?
=> ["bypass", "length", "lengthInSamples", "dimensions", "sampleRate", "type", "elementCount", "numChannels"]
>> o.get "numChannels"
=> 1
>> o.get "lengthInSamples"
=> 0
>> o.set "lengthInSamples", 44100
TTRubySetAttribute: Error 2
=> false
>> o.get "lengthInSamples"
=> 0
>> o.get "length"
=> 0.0
>> o.set "length", 1000
TTRubySetAttribute: Error 2
=> false
>> o.set "bypass", 1
=> false
>> o.set "bypass", 0
=> false
>> exit

So at the end you can see that I'm able to set the "bypass" attribute without errors, but with the length attributes I'm only able to get (and not set) the attributes.  If I can allocate memory for the samplematrix then I won't be able to even try those poke/peek/etc. messages...

Error 2 maps to an alloc failed message, which I know from finding this in TTBase.h (TODO: have Ruby report human-friendly errors instead of just a number)

/** TTBlue Error Codes
  Enumeration of error codes that might be returned by any of the TTBlue functions and methods. */
enum TTErr {
kTTErrNone = 0, ///< No Error.
kTTErrGeneric, ///< Something went wrong, but what exactly is not known.  Typically used for context-specific problems.
kTTErrAllocFailed, ///< Couldn't get memory.
kTTErrFreeFailed, ///< Couldn't free memory.
kTTErrInvalidType, ///< Bad DataType for the context.
kTTErrInvalidAttribute, ///< Bad Attribute specified.
kTTErrInvalidValue, ///< An inappropriate value was specified for an attribute or variable.
kTTErrWrongNumValues, ///< The wrong number of values were passed to a method or attribute.
kTTErrMethodNotFound, ///< Method not found.  Typically returned by the TTObject::sendMessage() function.
kTTErrValueNotFound, ///< A value was not found when doing a look up for it (in a TTHash, TTList, or other class).
kTTErrBadChannelConfig, ///< An invalid number of audio channels for a given context was encountered.
kTTErrReadOnly ///< Attempted a write to a read-only entity.
};

And this error code is being returned by TTMatrix::resize() in the Foundation.  Why?  I don't know, but at least I know where to start looking...

best,
  Tim


On Sun, Aug 19, 2012 at 3:48 PM, Nathan Wolek <[hidden email]> wrote:
Tim:

I was examining the new TTSampleMatrix code today.  My attempts at using Ruby to test things out are still failing.  I am sure this is mostly due to my inexperience with Ruby.

Are the peek and poke messages exposed in Ruby?  If so, I can not seem to figure out the right syntax.

Maybe I am assuming that more methods/messages/variables are exposed in Ruby than what is in fact reality?

I have a samplematrix.test.rb file in a local branch here.  Doesn't do anything right now, but I will try to push it to master.

[after attempt]

OK, the fact that I made a local branch is tripping me up.  Hoping you can still comment on what should be exposed in Ruby.

--Nathan
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Nathan Wolek-2
VERY helpful.  Now I better see how I can use Ruby for checking things.  Thanks, Tim!
--Nathan

On Aug 20, 2012, at 3:02 PM, Timothy Place <[hidden email]> wrote:

Hi,

Here is a transcript from the terminal, where I run irb and then play with it a little.  It will show that something is goofy, but it will also show how I came to that determination:

tim$ irb
>> require "Jamoma"
JamomaFoundation -- Version 0.6
JamomaDSP -- Version 0.6
JamomaGraphics -- Version 0.2 -- Debugging Enabled
=> true
>> o = TTObject.new "samplematrix"
=> #<TTObject:0x103739688>
>> o.messages?
=> ["getProcessingBenchmark", "fill", "test", "resetBenchmarking", "poke", "peek", "clear", "normalize", "getValueAtIndex", "setValueAtIndex", "set", "get"]
>> o.attributes?
=> ["bypass", "length", "lengthInSamples", "dimensions", "sampleRate", "type", "elementCount", "numChannels"]
>> o.get "numChannels"
=> 1
>> o.get "lengthInSamples"
=> 0
>> o.set "lengthInSamples", 44100
TTRubySetAttribute: Error 2
=> false
>> o.get "lengthInSamples"
=> 0
>> o.get "length"
=> 0.0
>> o.set "length", 1000
TTRubySetAttribute: Error 2
=> false
>> o.set "bypass", 1
=> false
>> o.set "bypass", 0
=> false
>> exit

So at the end you can see that I'm able to set the "bypass" attribute without errors, but with the length attributes I'm only able to get (and not set) the attributes.  If I can allocate memory for the samplematrix then I won't be able to even try those poke/peek/etc. messages...

Error 2 maps to an alloc failed message, which I know from finding this in TTBase.h (TODO: have Ruby report human-friendly errors instead of just a number)

/** TTBlue Error Codes
  Enumeration of error codes that might be returned by any of the TTBlue functions and methods. */
enum TTErr {
kTTErrNone = 0, ///< No Error.
kTTErrGeneric, ///< Something went wrong, but what exactly is not known.  Typically used for context-specific problems.
kTTErrAllocFailed, ///< Couldn't get memory.
kTTErrFreeFailed, ///< Couldn't free memory.
kTTErrInvalidType, ///< Bad DataType for the context.
kTTErrInvalidAttribute, ///< Bad Attribute specified.
kTTErrInvalidValue, ///< An inappropriate value was specified for an attribute or variable.
kTTErrWrongNumValues, ///< The wrong number of values were passed to a method or attribute.
kTTErrMethodNotFound, ///< Method not found.  Typically returned by the TTObject::sendMessage() function.
kTTErrValueNotFound, ///< A value was not found when doing a look up for it (in a TTHash, TTList, or other class).
kTTErrBadChannelConfig, ///< An invalid number of audio channels for a given context was encountered.
kTTErrReadOnly ///< Attempted a write to a read-only entity.
};

And this error code is being returned by TTMatrix::resize() in the Foundation.  Why?  I don't know, but at least I know where to start looking...

best,
  Tim


On Sun, Aug 19, 2012 at 3:48 PM, Nathan Wolek <[hidden email]> wrote:
Tim:

I was examining the new TTSampleMatrix code today.  My attempts at using Ruby to test things out are still failing.  I am sure this is mostly due to my inexperience with Ruby.

Are the peek and poke messages exposed in Ruby?  If so, I can not seem to figure out the right syntax.

Maybe I am assuming that more methods/messages/variables are exposed in Ruby than what is in fact reality?

I have a samplematrix.test.rb file in a local branch here.  Doesn't do anything right now, but I will try to push it to master.

[after attempt]

OK, the fact that I made a local branch is tripping me up.  Hoping you can still comment on what should be exposed in Ruby.

--Nathan
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Trond Lossius
Administrator
I guess it should be possible to run this kind of scripts from the Xcode debugger, and add breakpoints to trace what's happening in the set method.

Cheers,
Trond


On Aug 20, 2012, at 7:00 PM, Nathan Wolek <[hidden email]> wrote:

> VERY helpful.  Now I better see how I can use Ruby for checking things.  Thanks, Tim!
> --Nathan
>
> On Aug 20, 2012, at 3:02 PM, Timothy Place <[hidden email]> wrote:
>
>> Hi,
>>
>> Here is a transcript from the terminal, where I run irb and then play with it a little.  It will show that something is goofy, but it will also show how I came to that determination:
>>
>> tim$ irb
>> >> require "Jamoma"
>> JamomaFoundation -- Version 0.6
>> JamomaDSP -- Version 0.6
>> JamomaGraphics -- Version 0.2 -- Debugging Enabled
>> => true
>> >> o = TTObject.new "samplematrix"
>> => #<TTObject:0x103739688>
>> >> o.messages?
>> => ["getProcessingBenchmark", "fill", "test", "resetBenchmarking", "poke", "peek", "clear", "normalize", "getValueAtIndex", "setValueAtIndex", "set", "get"]
>> >> o.attributes?
>> => ["bypass", "length", "lengthInSamples", "dimensions", "sampleRate", "type", "elementCount", "numChannels"]
>> >> o.get "numChannels"
>> => 1
>> >> o.get "lengthInSamples"
>> => 0
>> >> o.set "lengthInSamples", 44100
>> TTRubySetAttribute: Error 2
>> => false
>> >> o.get "lengthInSamples"
>> => 0
>> >> o.get "length"
>> => 0.0
>> >> o.set "length", 1000
>> TTRubySetAttribute: Error 2
>> => false
>> >> o.set "bypass", 1
>> => false
>> >> o.set "bypass", 0
>> => false
>> >> exit
>>
>> So at the end you can see that I'm able to set the "bypass" attribute without errors, but with the length attributes I'm only able to get (and not set) the attributes.  If I can allocate memory for the samplematrix then I won't be able to even try those poke/peek/etc. messages...
>>
>> Error 2 maps to an alloc failed message, which I know from finding this in TTBase.h (TODO: have Ruby report human-friendly errors instead of just a number)
>>
>> /** TTBlue Error Codes
>>   Enumeration of error codes that might be returned by any of the TTBlue functions and methods. */
>> enum TTErr {
>> kTTErrNone = 0, ///< No Error.
>> kTTErrGeneric, ///< Something went wrong, but what exactly is not known.  Typically used for context-specific problems.
>> kTTErrAllocFailed, ///< Couldn't get memory.
>> kTTErrFreeFailed, ///< Couldn't free memory.
>> kTTErrInvalidType, ///< Bad DataType for the context.
>> kTTErrInvalidAttribute, ///< Bad Attribute specified.
>> kTTErrInvalidValue, ///< An inappropriate value was specified for an attribute or variable.
>> kTTErrWrongNumValues, ///< The wrong number of values were passed to a method or attribute.
>> kTTErrMethodNotFound, ///< Method not found.  Typically returned by the TTObject::sendMessage() function.
>> kTTErrValueNotFound, ///< A value was not found when doing a look up for it (in a TTHash, TTList, or other class).
>> kTTErrBadChannelConfig, ///< An invalid number of audio channels for a given context was encountered.
>> kTTErrReadOnly ///< Attempted a write to a read-only entity.
>> };
>>
>> And this error code is being returned by TTMatrix::resize() in the Foundation.  Why?  I don't know, but at least I know where to start looking...
>>
>> best,
>>   Tim
>>
>>
>> On Sun, Aug 19, 2012 at 3:48 PM, Nathan Wolek <[hidden email]> wrote:
>> Tim:
>>
>> I was examining the new TTSampleMatrix code today.  My attempts at using Ruby to test things out are still failing.  I am sure this is mostly due to my inexperience with Ruby.
>>
>> Are the peek and poke messages exposed in Ruby?  If so, I can not seem to figure out the right syntax.
>>
>> Maybe I am assuming that more methods/messages/variables are exposed in Ruby than what is in fact reality?
>>
>> I have a samplematrix.test.rb file in a local branch here.  Doesn't do anything right now, but I will try to push it to master.
>>
>> [after attempt]
>>
>> OK, the fact that I made a local branch is tripping me up.  Hoping you can still comment on what should be exposed in Ruby.
>>
>> --Nathan
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Jamoma-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jamoma-devel
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
>> Jamoma-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jamoma-devel
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Jamoma-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jamoma-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Nathan Wolek-2
That'll be a few steps from now.  But for tonight, I have continued to play with Ruby to help me learn the differences between TTSamplematrix and its superclass TTMatrix.  I am having difficulty pushing the test script I wrote though.  Getting this error:

> Nathans-MacBook-Pro:DSP nathanwolek$ git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 6 commits.
> #
> nothing to commit (working directory clean)
> Nathans-MacBook-Pro:DSP nathanwolek$ git push
> fatal: remote error:
>   You can't push to git://github.com/jamoma/JamomaDSP.git
>   Use [hidden email]:jamoma/JamomaDSP.git

I remember needing to set this in a config file, but can't remember where.  Can anyone point me to the right one?

--Nathan


On Aug 20, 2012, at 9:57 PM, Trond Lossius <[hidden email]> wrote:

> I guess it should be possible to run this kind of scripts from the Xcode debugger, and add breakpoints to trace what's happening in the set method.
>
> Cheers,
> Trond
>
>
> On Aug 20, 2012, at 7:00 PM, Nathan Wolek <[hidden email]> wrote:
>
>> VERY helpful.  Now I better see how I can use Ruby for checking things.  Thanks, Tim!
>> --Nathan


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Nils Peters
Hi Nathan,

in the Tools folder, there is a scipt called makeAllSubmodulesWritable.rb
That should make it. otherwise you can do the change to the config file
in the hidden .git folder of the DSP folder manually:

line 9 must look like this:
url = [hidden email]:jamoma/JamomaDSP.git


cheers,

Nils


On 12-08-20 1:24 PM, Nathan Wolek wrote:

> That'll be a few steps from now.  But for tonight, I have continued to play with Ruby to help me learn the differences between TTSamplematrix and its superclass TTMatrix.  I am having difficulty pushing the test script I wrote though.  Getting this error:
>
>> Nathans-MacBook-Pro:DSP nathanwolek$ git status
>> # On branch master
>> # Your branch is ahead of 'origin/master' by 6 commits.
>> #
>> nothing to commit (working directory clean)
>> Nathans-MacBook-Pro:DSP nathanwolek$ git push
>> fatal: remote error:
>>    You can't push to git://github.com/jamoma/JamomaDSP.git
>>    Use [hidden email]:jamoma/JamomaDSP.git
>
> I remember needing to set this in a config file, but can't remember where.  Can anyone point me to the right one?
>
> --Nathan
>
>
> On Aug 20, 2012, at 9:57 PM, Trond Lossius <[hidden email]> wrote:
>
>> I guess it should be possible to run this kind of scripts from the Xcode debugger, and add breakpoints to trace what's happening in the set method.
>>
>> Cheers,
>> Trond
>>
>>
>> On Aug 20, 2012, at 7:00 PM, Nathan Wolek <[hidden email]> wrote:
>>
>>> VERY helpful.  Now I better see how I can use Ruby for checking things.  Thanks, Tim!
>>> --Nathan
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jamoma-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jamoma-devel
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel
Reply | Threaded
Open this post in threaded view
|

Re: samplematrix tests?

Nathan Wolek-2
Nils:
Tired these and they did not fix the issue.  After more digging, it appears that the SSH key was the issue.  Perhaps I did not set it properly (or at all) on my new Mac.  It's working now!

So I have pushed this Ruby file:
https://github.com/jamoma/JamomaDSP/blob/a102c0e938f7391d7f20c2584a1202516360c36e/Tests/unit/samplematrix.test.rb

Perhaps the "Tests/unit" folder is not the best place for this sort of thing.  Please let me know if you guys want it elsewhere.

Doing this has certainly helped me get a better understanding of where TTMatrix and TTSamplematrix intersect.  I will do some more testing via Ruby and report back.

--Nathan

On Aug 20, 2012, at 10:42 PM, Nils Peters <[hidden email]> wrote:

> Hi Nathan,
>
> in the Tools folder, there is a scipt called makeAllSubmodulesWritable.rb
> That should make it. otherwise you can do the change to the config file
> in the hidden .git folder of the DSP folder manually:
>
> line 9 must look like this:
> url = [hidden email]:jamoma/JamomaDSP.git
>
>
> cheers,
>
> Nils

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jamoma-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-devel