Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/users/2/lolipop.jp-dp38009832/web/blog/archives/002694.php on line 31

Warning: include(http://satcy.net/blog/rss_read_del4ama.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/users/2/lolipop.jp-dp38009832/web/blog/archives/002694.php on line 31

Warning: include() [function.include]: Failed opening 'http://satcy.net/blog/rss_read_del4ama.php' for inclusion (include_path='.:/usr/local/php/5.3/lib/php') in /home/users/2/lolipop.jp-dp38009832/web/blog/archives/002694.php on line 31
memorandum: .maXcode

« .links for 2006-01-19 | main | .links for 2006-01-20 »

January 19, 2006

.maXcode

intel base Macが出てしまって、ついにCodeWarrior製のエクスターナルは動かなくなる時代が来てしまうので、XcodeでMaxのエクスターナルオブジェクト作りに手慣れようかと思い。
Cycling '74 || Writing Externals with Xcode 2.1
これそのまんまなぞってみたのだが、ビルドはできるけど、Max上で機能せず。昨日から苦戦中。

●error:#N:missing arguments for message "round"
クリティカルではないらしい、基本的なとこで間違ってるっぽいが全然とれない。

round_bug.gif


追記:
動いた。
class_new(),class_addmethod()らへんを、CW従来通りに書き直して、
object_alloc()も、newobject()にしたら動いた。

#include "ext.h" // Max Header
#include "ext_strings.h" // String Functions
#include "commonsyms.h" // Common symbols used by the Max 4.5 API
#include "ext_obex.h" // Max Object Extensions

// Data Structure for this object
typedef struct _round
{
t_object ob; // Must always be the 1st field; used by Max
void *obex; // Pointer to Obex object
void *outlet; // Pointer to outlet
} t_round;

// Prototypes for methods: need a method for each incoming message
void *round_new(long value);
void round_float(t_round *x, double value);
void round_int(t_round *x, long value);
void round_assist(t_round *x, void *b, long m, long a, char *s);

// Globals
// Required: Global pointing to this class
void *round_class;
/**************************************************************************/
// Main() Function - Object Class Definition

void main(void)
{
long attrflags = 0;
t_class *c;
t_object *attr;

// Define our class
setup((t_messlist **)&round_class, (method)round_new, 0L, (short)sizeof(t_round), 0L, A_DEFLONG, 0);

addmess((method)round_int,"int", A_LONG, 0);
addmess((method)round_float,"float", A_FLOAT, 0);
addmess((method)round_assist,"assist", A_CANT, 0);
addmess((method)object_obex_dumpout,"dumpout", A_CANT,0);
addmess((method)object_obex_quickref, "quickref", A_CANT, 0);

post("testtttto",0);
}


/**************************************************************************/
// Object Life

// Create an instance of our object
void *round_new(long value)
{
t_round *x;

x = (t_round *)newobject(round_class);
if(x){
object_obex_store((void *)x, _sym_dumpout,
(t_object *)outlet_new(x,NULL));
x->outlet = intout(x); // Create the outlet
}
return(x); // return pointer to the new instance
}


/**************************************************************************/
// Methods bound to input/inlets

// Method for Assistance Messages
void round_assist(t_round *x, void *b, long m, long a, char *s)
{
if(m==1) // Inlets
strcpy(s, "(int/float) number to round");
else if(m==2) // Outlets
strcpy(s, "(int) rounded number");
}


// INT input
void round_int(t_round *x, long value)
{
outlet_int(x->outlet, value);
}


// FLOAT input
void round_float(t_round *x, double value)
{
long out;

if(value > 0)
out = ((long)(value + 0.5));
else
out = ((long)(value - 0.5));

outlet_int(x->outlet, out);
}



comment

Problem with Tim's Xcode example
http://www.cycling74.com/forums/index.php?t=msg&th=17695&start=0&rid=0&S=458bb14968ec4e779251c8427011ce58

コードのもともとの所在は、
http://www.cycling74.com/story/2005/9/15/192712/922
sorceforgeにも登録してあるオープンソースのプロジェクト。Jamoma。
いまのとこsorceforgeからでのみ途中版ダウンロード可能。
Max/MSP+jitterをある程度モジュール化と、またサードパーティが開発するためのフレームワーク構築、これはReakter,Isadoraな感じで、初心者が入りやすくするのが目的の様子。どこかで見たような気が、、、て、dbvもそんな感じでやってるんですけどね。
このなかに、jmod.round.mxoという同じソースコードのオブジェクトが存在していたが、これもやはり動作しなかった。

mxoオブジェクトてなんか、ファイル容量が大きくなりがちな気がする。
この、round、四捨五入オブジェクト、44Kもあるんです。
フレームワークインクルードのせい?

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)

>
Feed[Help?]
Site by Satoshi HORII. This website is under a Creative Commons License.
Powered by Movable Type 3.2-ja-2, jQuery, ThickBox and Interface elements. Made on Mac.