Forums > Gen

A problem with gen abstractions and "require"

September 16, 2013 | 9:39 am

Hi!

This is a first post for me, so before everything else I must thank this great community for all the explanations and patches. It’s a joy just to browse through old topics, and then the new Gen ones!

I’m trying to collect some of the gen~ filters in a nice and reusable way. So I read up on importing functions from .genexpr files and wrote this file called filters.genexpr (attached). These filter functions are imported in filters_wrapper.gendsp, both files are in my search path. Now when I create a [gen~ @gen filters_wrapper], all is good. But I really want to use the filters in a gen abstraction, and typing [filters_wrapper] in a gen~ patcher throws a gen2.Module "attempt to index field ‘importrefss’ (a nil value)" error. What am I doing wrong?

See example:
<code>

– Pasted Max Patch, click to expand. –

</code>

And a secondary question: If i wanted to reset the biquad (history objects "x1" and "x2") in my wrapper, is there a way? I tried biquad("x1"=0); and variants, but no success.

Attachments:
  1. filters.zip

September 25, 2013 | 11:41 am

The filters_wrapper works fine as a Gen abstraction for me.

Make sure the .gendsp file is in your Max search path.


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