From: equilet <2237372+equilet@users.noreply.github.com> Date: Tue, 30 May 2023 17:44:11 +0000 (-0400) Subject: removing build files from repo X-Git-Tag: v0.1~41 X-Git-Url: https://git.dabkitsch.com/?a=commitdiff_plain;h=dc892d2a4fc6e0e022c2d740a79a2ccc5b27159f;p=morphograph.git removing build files from repo --- diff --git a/docs/morphograph.maxref.xml b/docs/morphograph.maxref.xml index 00db4e0..66f2b1f 100644 --- a/docs/morphograph.maxref.xml +++ b/docs/morphograph.maxref.xml @@ -1,7 +1,7 @@ - + analyze an audio buffer, and export a graphic score @@ -18,7 +18,7 @@ - Jeff Lubow, Carmine Cella + Linda Bouchard, Jeff Lubow, Carmine Cella Analysis Composition Generative diff --git a/help/morphograph.maxhelp b/help/morphograph.maxhelp index 95a0095..6476364 100644 --- a/help/morphograph.maxhelp +++ b/help/morphograph.maxhelp @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ 86.0, 104.0, 1009.0, 647.0 ], + "rect" : [ 196.0, 129.0, 985.0, 642.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -21,12 +21,12 @@ "gridsnaponopen" : 1, "objectsnaponopen" : 1, "statusbarvisible" : 2, - "toolbarvisible" : 1, - "lefttoolbarpinned" : 0, - "toptoolbarpinned" : 0, - "righttoolbarpinned" : 0, - "bottomtoolbarpinned" : 0, - "toolbars_unpinned_last_save" : 0, + "toolbarvisible" : 0, + "lefttoolbarpinned" : 2, + "toptoolbarpinned" : 2, + "righttoolbarpinned" : 2, + "bottomtoolbarpinned" : 2, + "toolbars_unpinned_last_save" : 15, "tallnewobj" : 0, "boxanimatetime" : 200, "enablehscroll" : 1, @@ -39,13 +39,256 @@ "subpatcher_template" : "Untitled5_template", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-54", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 3, + "revision" : 3, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 59.0, 104.0, 640.0, 480.0 ], + "bglocked" : 0, + "openinpresentation" : 0, + "default_fontsize" : 14.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 1, + "gridsize" : [ 15.0, 15.0 ], + "gridsnaponopen" : 1, + "objectsnaponopen" : 1, + "statusbarvisible" : 2, + "toolbarvisible" : 1, + "lefttoolbarpinned" : 0, + "toptoolbarpinned" : 0, + "righttoolbarpinned" : 0, + "bottomtoolbarpinned" : 0, + "toolbars_unpinned_last_save" : 0, + "tallnewobj" : 0, + "boxanimatetime" : 200, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "description" : "", + "digest" : "", + "tags" : "", + "style" : "", + "subpatcher_template" : "Untitled5_template", + "assistshowspatchername" : 0, + "boxes" : [ { + "box" : { + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 100.0, 95.0, 24.0 ], + "text" : "prepend open" + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 118.0, 134.0, 53.0, 24.0 ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-43", + "index" : 2, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 94.0, 36.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-51", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 28.0, 36.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-53", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 118.0, 216.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-51", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 441.5, 482.0, 66.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "fontsize" : 14.0, + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p playback" + } + + } +, { + "box" : { + "channels" : 1, + "id" : "obj-38", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 441.5, 512.0, 37.0, 107.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "out", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "out", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 488.0, 587.5, 32.0, 32.0 ] + } + + } +, { + "box" : { + "id" : "obj-34", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 413.0, 482.0, 22.0, 22.0 ] + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 13.0, + "id" : "obj-27", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 94.0, 426.0, 53.0 ], + "text" : "The Ocular Scores Morphograph object performs user-specified analyses on audio material. It allows the user to choose how these analyses will affect graphic objects in an output SVG score", + "textcolor" : [ 0.537254901960784, 0.537254901960784, 0.537254901960784, 1.0 ] + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 13.0, + "id" : "obj-23", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 68.0, 372.0, 22.0 ], + "text" : "analyze an audio buffer, and export graphic score elements" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 36.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 27.0, 611.0, 50.0 ], + "text" : "Ocular Scores, featuring Morphograph" + } + + } +, { "box" : { "id" : "obj-15", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 830.0, 499.5, 58.0, 22.0 ], + "patching_rect" : [ 859.0, 452.0, 58.0, 22.0 ], "text" : "loadbang" } @@ -53,13 +296,13 @@ , { "box" : { "id" : "obj-12", - "linecount" : 5, + "linecount" : 4, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 830.0, 529.5, 114.0, 76.0 ], - "text" : "/Users/jml/Documents/freelance/linda_bouchard/mgraph_project/mgraph_patchers/" + "patching_rect" : [ 859.0, 482.0, 114.0, 62.0 ], + "text" : "/Users/jml/Documents/freelance/linda_bouchard/mgraph_project/demo/" } } @@ -69,9 +312,9 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 298.5, 212.0, 22.0, 20.0 ], + "patching_rect" : [ 308.5, 208.0, 22.0, 20.0 ], "text" : "3. ", - "textcolor" : [ 1.0, 0.058823529411765, 0.058823529411765, 1.0 ] + "textcolor" : [ 0.988235294117647, 0.0, 0.996078431372549, 1.0 ] } } @@ -81,9 +324,9 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 806.0, 367.0, 150.0, 20.0 ], + "patching_rect" : [ 816.0, 363.0, 150.0, 20.0 ], "text" : "1. define SVG write path", - "textcolor" : [ 1.0, 0.058823529411765, 0.058823529411765, 1.0 ] + "textcolor" : [ 0.988235294117647, 0.0, 0.996078431372549, 1.0 ] } } @@ -94,7 +337,7 @@ "numinlets" : 1, "numoutlets" : 5, "outlettype" : [ "", "", "", "", "" ], - "patching_rect" : [ 780.0, 425.0, 90.0, 22.0 ], + "patching_rect" : [ 790.0, 421.0, 90.0, 22.0 ], "text" : "regexp .+:(.+)" } @@ -107,7 +350,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 780.0, 367.0, 24.0, 24.0 ] + "patching_rect" : [ 790.0, 363.0, 24.0, 24.0 ] } } @@ -118,7 +361,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], - "patching_rect" : [ 780.0, 401.0, 90.0, 22.0 ], + "patching_rect" : [ 790.0, 397.0, 90.0, 22.0 ], "text" : "opendialog fold" } @@ -130,26 +373,10 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 316.5, 212.0, 51.0, 22.0 ], + "patching_rect" : [ 326.5, 208.0, 51.0, 22.0 ], "text" : "process" } - } -, { - "box" : { - "border" : 0, - "filename" : "helpdetails.js", - "id" : "obj-2", - "ignoreclick" : 1, - "jsarguments" : [ "morphograph" ], - "maxclass" : "jsui", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "" ], - "parameter_enable" : 0, - "patching_rect" : [ 14.0, 15.5, 637.0, 113.0 ] - } - } , { "box" : { @@ -229,7 +456,7 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 55.0, 247.0, 109.0, 24.0 ], - "text" : "713728." + "text" : "416990." } } @@ -357,7 +584,7 @@ ] } , - "patching_rect" : [ 285.0, 596.5, 51.0, 22.0 ], + "patching_rect" : [ 295.0, 587.5, 51.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -377,9 +604,9 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 566.0, 159.5, 150.0, 33.0 ], + "patching_rect" : [ 576.0, 155.5, 150.0, 33.0 ], "text" : "2. dbl-click for example specification; edit", - "textcolor" : [ 1.0, 0.058823529411765, 0.058823529411765, 1.0 ] + "textcolor" : [ 0.988235294117647, 0.0, 0.996078431372549, 1.0 ] } } @@ -389,7 +616,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 24.0, 307.0, 94.0, 20.0 ], + "patching_rect" : [ 34.0, 303.0, 94.0, 20.0 ], "text" : "post information" } @@ -400,7 +627,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 28.0, 190.0, 93.0, 20.0 ], + "patching_rect" : [ 37.0, 186.0, 93.0, 20.0 ], "text" : "set active buffer" } @@ -411,7 +638,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 183.0, 190.0, 110.0, 20.0 ], + "patching_rect" : [ 192.0, 186.0, 110.0, 20.0 ], "text" : "set svg export path" } @@ -419,11 +646,10 @@ , { "box" : { "id" : "obj-26", - "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 418.0, 159.5, 76.0, 33.0 ], + "patching_rect" : [ 413.0, 186.0, 124.0, 20.0 ], "text" : "load svg file from disk" } @@ -436,7 +662,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 389.0, 159.5, 24.0, 24.0 ] + "patching_rect" : [ 399.0, 155.5, 24.0, 24.0 ] } } @@ -447,7 +673,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 389.0, 237.0, 79.0, 22.0 ], + "patching_rect" : [ 399.0, 233.0, 79.0, 22.0 ], "text" : "prepend load" } @@ -459,7 +685,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], - "patching_rect" : [ 389.0, 212.0, 133.0, 22.0 ], + "patching_rect" : [ 399.0, 208.0, 133.0, 22.0 ], "text" : "opendialog @types svg" } @@ -518,7 +744,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 796.0, 367.0, 140.0, 87.0 ], + "patching_rect" : [ 796.0, 367.0, 143.0, 87.0 ], "text" : "hint: the transform properties that you issue with the input dictionary determine the default dimensions for the generated shapes." } @@ -1756,7 +1982,7 @@ ] } , - "patching_rect" : [ 780.0, 310.152261123267749, 87.0, 22.0 ], + "patching_rect" : [ 790.0, 306.152261123267749, 122.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -1765,7 +1991,7 @@ "tags" : "" } , - "text" : "p mapping_api" + "text" : "p \"mapping api / info\"" } } @@ -1776,7 +2002,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 107.0, 549.0, 95.0, 22.0 ], + "patching_rect" : [ 117.0, 540.0, 95.0, 22.0 ], "text" : "prepend replace" } @@ -1788,7 +2014,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 39.0, 486.0, 85.0, 22.0 ], + "patching_rect" : [ 49.0, 474.0, 85.0, 22.0 ], "text" : "prepend prefix" } @@ -1800,7 +2026,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 39.0, 457.0, 80.0, 22.0 ], + "patching_rect" : [ 49.0, 445.0, 80.0, 22.0 ], "text" : "r morphopath" } @@ -1811,7 +2037,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 798.0, 467.652261123267749, 82.0, 22.0 ], + "patching_rect" : [ 808.0, 575.652261123267749, 82.0, 22.0 ], "text" : "s morphopath" } @@ -1823,7 +2049,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 170.0, 159.5, 80.0, 22.0 ], + "patching_rect" : [ 180.0, 155.5, 80.0, 22.0 ], "text" : "r morphopath" } @@ -1832,14 +2058,14 @@ "box" : { "autopopulate" : 1, "id" : "obj-25", - "items" : [ "Brahms_4.wav", ",", "Koonitz.wav" ], + "items" : [ "Allora_1_prt1.aif", ",", "BassGesture.aif", ",", "BowedCymbalNORM.wav", ",", "Brahms_4.wav", ",", "Calzadilla_1.aif", ",", "Coda_Box3_a.aif", ",", "Cymbal_onHead2.wav", ",", "Koonitz.wav", ",", "LoriFreedman_Improv4.wav", ",", "Meandre_1.aif", ",", "Pointillistic.aif", ",", "ReceidingSimple.aif", ",", "Scen2Box(a).aif", ",", "scene 3-box 4.aif", ",", "SustainedTextured_Crackel-Mix.aif", ",", "tongue6.wav", ",", "tongue7_FH.wav", ",", "TrombDrum.wav" ], "maxclass" : "umenu", "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "int", "", "" ], "parameter_enable" : 0, - "patching_rect" : [ 39.0, 521.0, 155.0, 22.0 ], - "prefix" : "~/Documents/freelance/linda_bouchard/mgraph_project/mgraph_patchers/", + "patching_rect" : [ 49.0, 513.0, 155.0, 22.0 ], + "prefix" : "~/Documents/freelance/linda_bouchard/mgraph_project/demo/", "types" : [ "WAVE", "AIFF", "MP3" ] } @@ -1851,7 +2077,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 14.0, 159.5, 58.0, 22.0 ], + "patching_rect" : [ 24.0, 155.5, 58.0, 22.0 ], "text" : "loadbang" } @@ -2032,7 +2258,7 @@ ] } , - "patching_rect" : [ 780.0, 336.152261123267749, 80.0, 22.0 ], + "patching_rect" : [ 790.0, 332.152261123267749, 80.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -2051,7 +2277,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 716.0, 190.0, 150.0, 20.0 ], + "patching_rect" : [ 726.0, 186.0, 150.0, 20.0 ], "text" : "errors if cannot find" } @@ -2063,7 +2289,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 170.0, 212.0, 102.0, 22.0 ], + "patching_rect" : [ 180.0, 208.0, 102.0, 22.0 ], "text" : "prepend set_path" } @@ -2075,7 +2301,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "dictionary" ], - "patching_rect" : [ 540.0, 271.0, 29.0, 22.0 ], + "patching_rect" : [ 550.0, 254.0, 29.0, 22.0 ], "text" : "thru" } @@ -2088,7 +2314,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 540.0, 159.5, 24.0, 24.0 ] + "patching_rect" : [ 550.0, 107.5, 44.5, 44.5 ] } } @@ -2097,18 +2323,18 @@ "data" : { "filename" : "mgraph_example.svg", "shape" : "triangles", - "style" : "stroke", + "style" : "both", "descmap" : { "energy" : "size", - "zcr" : "ylocation", - "speckurt" : "xscale", - "speccentr" : "brightness" + "speccrest" : "xscale", + "speckurt" : "brightness", + "zcr" : "ylocation" } , "transform" : { - "width" : 300, - "height" : 300, - "zoom" : 1.0 + "width" : 600, + "height" : 600, + "zoom" : 1 } } @@ -2118,7 +2344,7 @@ "numinlets" : 2, "numoutlets" : 4, "outlettype" : [ "dictionary", "", "", "" ], - "patching_rect" : [ 540.0, 212.0, 164.0, 22.0 ], + "patching_rect" : [ 550.0, 208.0, 164.0, 22.0 ], "saved_object_attributes" : { "embed" : 1, "parameter_enable" : 0, @@ -2137,7 +2363,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 170.0, 462.0, 24.0, 24.0 ] + "patching_rect" : [ 180.0, 477.0, 24.0, 24.0 ] } } @@ -2148,7 +2374,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 716.0, 212.0, 89.0, 22.0 ], + "patching_rect" : [ 726.0, 208.0, 89.0, 22.0 ], "text" : "dictionary putty" } @@ -2159,7 +2385,7 @@ "maxclass" : "dict.view", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 540.0, 307.0, 221.0, 315.0 ] + "patching_rect" : [ 550.0, 303.0, 207.0, 264.0 ] } } @@ -2171,7 +2397,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "p_hopsize" : 1024, - "patching_rect" : [ 170.0, 320.652261123267749, 352.0, 132.347738876732251 ] + "patching_rect" : [ 180.0, 299.65226100000001, 357.0, 162.999999999999943 ] } } @@ -2182,7 +2408,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], - "patching_rect" : [ 107.0, 572.5, 197.0, 22.0 ], + "patching_rect" : [ 117.0, 563.5, 197.0, 22.0 ], "text" : "buffer~ morph1 Brahms_4.wav -1 1" } @@ -2195,7 +2421,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 28.0, 271.0, 24.0, 24.0 ] + "patching_rect" : [ 38.0, 267.0, 24.0, 24.0 ] } } @@ -2206,7 +2432,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 14.0, 212.0, 69.0, 22.0 ], + "patching_rect" : [ 24.0, 208.0, 69.0, 22.0 ], "text" : "set morph1" } @@ -2218,7 +2444,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 85.0, 212.0, 33.0, 22.0 ], + "patching_rect" : [ 95.0, 208.0, 33.0, 22.0 ], "text" : "view" } @@ -2297,6 +2523,16 @@ , { "patchline" : { "destination" : [ "obj-40", 0 ], + "order" : 1, + "source" : [ "obj-25", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 1 ], + "hidden" : 1, + "order" : 0, "source" : [ "obj-25", 1 ] } @@ -2337,6 +2573,14 @@ "source" : [ "obj-33", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-54", 0 ], + "hidden" : 1, + "source" : [ "obj-34", 0 ] + } + } , { "patchline" : { @@ -2344,6 +2588,24 @@ "source" : [ "obj-35", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-37", 1 ], + "hidden" : 1, + "order" : 0, + "source" : [ "obj-38", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-37", 0 ], + "hidden" : 1, + "order" : 1, + "source" : [ "obj-38", 0 ] + } + } , { "patchline" : { @@ -2386,6 +2648,13 @@ "source" : [ "obj-5", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "source" : [ "obj-54", 0 ] + } + } , { "patchline" : { @@ -2409,13 +2678,21 @@ } ], - "dependency_cache" : [ { - "name" : "helpdetails.js", - "bootpath" : "C74:/help/resources", - "type" : "TEXT", - "implicit" : 1 + "parameters" : { + "obj-38" : [ "out", "out", 0 ], + "parameterbanks" : { + "0" : { + "index" : 0, + "name" : "", + "parameters" : [ "-", "-", "-", "-", "-", "-", "-", "-" ] + } + } -, { +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { "name" : "morphograph.mxo", "type" : "iLaX" } diff --git a/morphograph.xcodeproj/project.xcworkspace/xcuserdata/jml.xcuserdatad/UserInterfaceState.xcuserstate b/morphograph.xcodeproj/project.xcworkspace/xcuserdata/jml.xcuserdatad/UserInterfaceState.xcuserstate index 2b32e9c..4ea22b5 100644 Binary files a/morphograph.xcodeproj/project.xcworkspace/xcuserdata/jml.xcuserdatad/UserInterfaceState.xcuserstate and b/morphograph.xcodeproj/project.xcworkspace/xcuserdata/jml.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/source/mgraph.h b/source/mgraph.h index 4d11111..3254f82 100644 --- a/source/mgraph.h +++ b/source/mgraph.h @@ -15,32 +15,34 @@ #define SHAPE_DIVISOR 8 //#define MAX_NUM_SHAPES 12 //unimplemented -#define NUM_FEATURES 14 +//#define NUM_FEATURES 14 +#define NUM_FEATURES 8 #define FEATURE_ENERGY 0 #define FEATURE_ZCR 1 #define FEATURE_HFC 2 -#define FEATURE_INHARM 3 -#define FEATURE_SPECIRR 4 -#define FEATURE_SPECCENTER 5 -#define FEATURE_SPECSPREAD 6 +#define FEATURE_SPECIRR 3 +#define FEATURE_SPECKURT 4 +#define FEATURE_SPECCREST 5 +#define FEATURE_SPECFLAT 6 #define FEATURE_SPECSKEW 7 -#define FEATURE_SPECKURT 8 -#define FEATURE_SPECFLUX 9 -#define FEATURE_SPECDECR 10 -#define FEATURE_SPECSLOPE 11 -#define FEATURE_SPECFLAT 12 -#define FEATURE_SPECCREST 13 +//#define FEATURE_SPECCENTER 8 +//#define FEATURE_SPECSPREAD 9 +//#define FEATURE_SPECFLUX 10 +//#define FEATURE_SPECDECR 11 +//#define FEATURE_SPECSLOPE 12 +//#define FEATURE_INHARM 13 -#define NUM_ACTIONS 7 +//#define NUM_ACTIONS 7 +#define NUM_ACTIONS 5 -#define PARAM_ROTATION 0 -#define PARAM_XSCALE 1 -#define PARAM_YSCALE 2 -#define PARAM_SIZE 3 -#define PARAM_YLOC 4 -#define PARAM_XDEV 5 -#define PARAM_BRIGHTNESS 6 +#define PARAM_XSCALE 0 +#define PARAM_YSCALE 1 +#define PARAM_SIZE 2 +#define PARAM_YLOC 3 +#define PARAM_BRIGHTNESS 4 +//#define PARAM_ROTATION 5 +//#define PARAM_XDEV 6 #define NUM_SHAPES 6 #define NUM_STYLES 3 diff --git a/source/morphograph.cpp b/source/morphograph.cpp index beeacc1..b42725b 100644 --- a/source/morphograph.cpp +++ b/source/morphograph.cpp @@ -2,6 +2,11 @@ #include "ext.h" //core externals header #include "ext_obex.h" //basic max object functionality + +//need to include??? +#include "ext_path.h" +#include "ext_sysfile.h" + #include "ext_dictobj.h" #include "ext_buffer.h" #include "z_dsp.h" @@ -51,6 +56,12 @@ void morphograph_size(t_morphograph *x, long width, long height); //ui size void morphograph_load(t_morphograph *x, t_symbol *s); void morphograph_process(t_morphograph *x); +//------------------TEST FILE WRITER------------------------------- +//----------------------------------------------------------------- +void morphograph_writefile(t_morphograph *x, char *filename, short path); +void morphograph_dowrite(t_morphograph *x, t_symbol *s); +void morphograph_write(t_morphograph *x, t_symbol *s); + t_max_err morphograph_notify(t_morphograph *x, t_symbol *s, t_symbol *msg, void *sender, void *data); //buffer related //custom/private user methods- internal only @@ -91,7 +102,7 @@ class ShapeWriter { Document *doc; Parameters *params; std::string shape; - float rotation, size, width, height, y, xdev, linewidth; + float rotation, size, width, height, y, xdev, linewidth, trilen, yoffset; unsigned idx, vecsize, bright; double rv; short drawstyle; @@ -102,8 +113,8 @@ private: public: -// ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc, double scf, double scnrg, long vsize) { -ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { + ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { + //fork out primitive code to be the default, then stroke/fill x = _x; doc = _doc; shape = _shape; @@ -115,9 +126,9 @@ ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { height = 1.0; y = 0.5; xdev = 0.; - bright = 128; + bright = 0; linewidth = 0.5; - + drawstyle = 0; //stroke } virtual ~ShapeWriter() { @@ -127,10 +138,10 @@ ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { void draw(){ if(shape == std::string("circles")){ - draw_circle(drawstyle); + draw_circle(); } if(shape == std::string("rectangles")){ - draw_rectangle(drawstyle); + draw_rectangle(); } if(shape == std::string("ellipses")){ draw_ellipse(); @@ -140,7 +151,7 @@ ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { } if(shape == std::string("triangles")){ //object_error((t_object *)x, "triangle is not implemented."); - draw_triangle(drawstyle); + draw_triangle(); } } @@ -172,10 +183,9 @@ ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { void set_idx(unsigned _i){ idx = _i; } - void set_brightness(unsigned _bright){ + void set_brightness(char _bright){ bright = _bright; } - void set_drawstyle(std::string _style){ if(_style == std::string("stroke")){ @@ -191,34 +201,86 @@ ShapeWriter(t_morphograph *_x, std::string &_shape, Document *_doc) { private: - void draw_triangle(short style){ - - - double tx = (double)idx / vecsize * params->width; - double ty = y * params->height; - - //Polygon pg = Polygon(Stroke(1, Color(0,0,0))); - Polygon pg = Polygon(Fill(Color(0,0,0))); - - pg << pPoint(tx, ty); - //pPoint p2 = pPoint((tx + 10), ty + 0); - pPoint p2 = pPoint((tx + 10) + (size * 20), ty + 0); - pg << p2; - //pPoint p3 = pPoint((tx + 5), (ty + 10)); - pPoint p3 = pPoint((tx + 5) + (size * 10), (ty + 10) + (size * 20)); - pg << p3; - - (*doc) << pg; + void draw_triangle(){ + switch(drawstyle){ + case 0: { //stroke + //initial pos + double tx = (double)idx / vecsize * params->width; + double ty = (y * params->height) - 10.; + Polygon pg = Polygon(Fill(), Stroke(linewidth, Color(0,0,0))); + pg << pPoint(tx, ty); + double p2x = (tx + (size * 20)) * width; + pPoint p2 = pPoint(p2x, ty + 0); + pg << p2; + double p2y = (ty + (size * 20)) * height; + pPoint p3 = pPoint(tx, p2y); + pg << p3; + + (*doc) << pg; + } + break; + case 1: { //fill + //initial pos + double tx = (double)idx / vecsize * params->width; + double ty = (y * params->height) - 10.; + Polygon pg = Polygon(Fill(Color(bright, bright, bright))); + pg << pPoint(tx, ty); + double p2x = (tx + (size * 20)) * width; + pPoint p2 = pPoint(p2x, ty + 0); + pg << p2; + double p2y = (ty + (size * 20)) * height; + pPoint p3 = pPoint(tx, p2y); + pg << p3; + + (*doc) << pg; + } + break; + + case 2: { //both + //initial pos + double tx = (double)idx / vecsize * params->width; + double ty = (y * params->height) - 10.; + Polygon pg = Polygon(Fill(Color(bright, bright, bright)), Stroke(linewidth, Color(0,0,0))); + pg << pPoint(tx, ty); + double p2x = (tx + (size * 20)) * width; + pPoint p2 = pPoint(p2x, ty + 0); + pg << p2; + double p2y = (ty + (size * 20)) * height; + pPoint p3 = pPoint(tx, p2y); + pg << p3; + + (*doc) << pg; + } + break; + + default: { + //initial pos + double tx = (double)idx / vecsize * params->width; + double ty = (y * params->height) - 10.; + Polygon pg = Polygon(Fill(Color(bright, bright, bright))); + pg << pPoint(tx, ty); + double p2x = (tx + (size * 20)) * width; + pPoint p2 = pPoint(p2x, ty + 0); + pg << p2; + double p2y = (ty + (size * 20)) * height; + pPoint p3 = pPoint(tx, p2y); + pg << p3; + + (*doc) << pg; + } + break; + } + } - void draw_circle(short style){ - switch(style){ + void draw_circle(){ + switch(drawstyle){ case 0: //stroke (*doc) << Circle( pPoint (((double)idx / vecsize) * params->width, y * params->height), (params->width / SHAPE_DIVISOR) * size, Fill(), - Stroke(1, Color (0, 0, 0)) + Stroke(linewidth, Color (0, 0, 0)) ); break; case 1: //fill @@ -248,10 +310,11 @@ private: } } - void draw_rectangle(short style){ + void draw_rectangle(){ //Rectangle(pPoint, width, height); - switch(style){ + switch(drawstyle){ case 0: //stroke + (*doc) << Rectangle( pPoint(((double)idx / vecsize) * params->width, y * params->height), ((width * params->width) / SHAPE_DIVISOR) * size, ((height * params->height) / SHAPE_DIVISOR) * size, @@ -260,6 +323,7 @@ private: ); break; case 1: //fill + object_post((t_object *)x, "fill rectangle called"); (*doc) << Rectangle( pPoint(((double)idx / vecsize) * params->width, y * params->height), ((width * params->width) / SHAPE_DIVISOR) * size, ((height * params->height) / SHAPE_DIVISOR) * size, @@ -267,6 +331,7 @@ private: ); break; case 2: //both + object_post((t_object *)x, "both rectangle called"); (*doc) << Rectangle( pPoint(((double)idx / vecsize) * params->width, y * params->height), ((width * params->width) / SHAPE_DIVISOR) * size, ((height * params->height) / SHAPE_DIVISOR) * size, @@ -276,6 +341,7 @@ private: break; default: + object_post((t_object *)x, "default rectangle called"); (*doc) << Rectangle( pPoint(((double)idx / vecsize) * params->width, y * params->height), ((width * params->width) / SHAPE_DIVISOR) * size, ((height * params->height) / SHAPE_DIVISOR) * size, @@ -392,7 +458,7 @@ public: fname = std::string(x->l_fnamesvg->s_name); fpath = std::string(x->l_filepath->s_name); - Dimensions dims (params.width + OFFSET, params.height + OFFSET); + Dimensions dims (params.width, params.height); doc = new Document (fpath + fname, Layout(dims, Layout::BottomLeft, params.zoom)); } @@ -470,33 +536,33 @@ public: case FEATURE_HFC: { curr_feature_datum = layers[i].desc.hfc[j]; } break; - case FEATURE_INHARM: { - curr_feature_datum = layers[i].desc.inharmonicity[j]; - } break; +// case FEATURE_INHARM: { +// curr_feature_datum = layers[i].desc.inharmonicity[j]; +// } break; case FEATURE_SPECIRR: { curr_feature_datum = layers[i].desc.specirr[j]; } break; - case FEATURE_SPECCENTER: { - curr_feature_datum = layers[i].desc.speccentr[j]; - } break; - case FEATURE_SPECSPREAD: { - curr_feature_datum = layers[i].desc.specspread[j]; - } break; +// case FEATURE_SPECCENTER: { +// curr_feature_datum = layers[i].desc.speccentr[j]; +// } break; +// case FEATURE_SPECSPREAD: { +// curr_feature_datum = layers[i].desc.specspread[j]; +// } break; case FEATURE_SPECSKEW: { curr_feature_datum = layers[i].desc.specskew[j]; } break; case FEATURE_SPECKURT: { curr_feature_datum = layers[i].desc.speckurt[j]; } break; - case FEATURE_SPECFLUX: { - curr_feature_datum = layers[i].desc.specflux[j]; - } break; - case FEATURE_SPECDECR: { - curr_feature_datum = layers[i].desc.specdecr[j]; - } break; - case FEATURE_SPECSLOPE: { - curr_feature_datum = layers[i].desc.specslope[j]; - } break; +// case FEATURE_SPECFLUX: { +// curr_feature_datum = layers[i].desc.specflux[j]; +// } break; +// case FEATURE_SPECDECR: { +// curr_feature_datum = layers[i].desc.specdecr[j]; +// } break; +// case FEATURE_SPECSLOPE: { +// curr_feature_datum = layers[i].desc.specslope[j]; +// } break; case FEATURE_SPECFLAT: { curr_feature_datum = layers[i].desc.specflat[j]; } break; @@ -511,10 +577,10 @@ public: } switch(get_action_id(x, k)){ - case PARAM_ROTATION: { - //unimplemented - object_error((t_object *)x, "render: rotation is unimplemented."); - } break; +// case PARAM_ROTATION: { +// //unimplemented +// object_error((t_object *)x, "render: rotation is unimplemented."); +// } break; case PARAM_XSCALE: { //object_post((t_object *)x, "detected xscale"); swrite.set_width(curr_feature_datum); @@ -532,10 +598,10 @@ public: swrite.set_y(curr_feature_datum); } break; - case PARAM_XDEV: { - //unimplemented - object_error((t_object *)x, "x deviation is unimplemented."); - } break; +// case PARAM_XDEV: { +// //unimplemented +// object_error((t_object *)x, "x deviation is unimplemented."); +// } break; case PARAM_BRIGHTNESS: { char b = curr_feature_datum * 255; swrite.set_brightness(b); @@ -703,8 +769,9 @@ static void analyse_cpp(t_morphograph *x, Descriptors &d, BufferInstance *b) { } int ptr = 0; + bool feature_valid = true; - while (ptr < nsamps) { + while (ptr < nsamps && feature_valid) { if (p.fft_size + ptr > nsamps) break; // discard incomplete frame //run fft() @@ -733,6 +800,8 @@ static void analyse_cpp(t_morphograph *x, Descriptors &d, BufferInstance *b) { sum += a * a; } double e = std::sqrt (sum / p.fft_size); //we push this later + d.energy.push_back(e * 10.); + //d.energy.push_back(e); //centroid double sc = speccentr(&s[0], &freqs[0], p.fft_size / 2); @@ -750,7 +819,7 @@ static void analyse_cpp(t_morphograph *x, Descriptors &d, BufferInstance *b) { switch(get_feature_id(x, i)) { case FEATURE_ENERGY: { object_post((t_object *)x, "spec energy: %f", e * 10.); - d.energy.push_back(e * 10.); + //d.energy.push_back(e * 10.); } break; case FEATURE_ZCR: { //double z = zcr(&vsamples[ptr], p.fft_size / 2); @@ -763,65 +832,65 @@ static void analyse_cpp(t_morphograph *x, Descriptors &d, BufferInstance *b) { object_post((t_object *)x, "hfc: %f", h); d.hfc.push_back(h); } break; - case FEATURE_INHARM: { - //don't understand how to implement this - //double ih = inharmonicity(&s[0], &freqs[0], p.fft_size, <#T f0#>, <#T R#>, <#T &sumAmpl#>) - object_error((t_object *)x, "inharmonicity is currently unimplemented."); - return; - } break; +// case FEATURE_INHARM: { +// //don't understand how to implement this +// //double ih = inharmonicity(&s[0], &freqs[0], p.fft_size, <#T f0#>, <#T R#>, <#T &sumAmpl#>) +// object_error((t_object *)x, "inharmonicity is currently unimplemented."); +// feature_valid = false; +// } break; case FEATURE_SPECIRR: { double si = specirr(&s[0], p.fft_size / 2); - object_post((t_object *)x, "spec irr: %f", si); - d.specirr.push_back(si); - } break; - case FEATURE_SPECCENTER: { - //skip bc we already compute - should take this out - object_post((t_object *)x, "spec centroid: %f", sc); - } break; - case FEATURE_SPECSPREAD:{ - //skip bc we already compute - should take this out - object_post((t_object *)x, "spec spread: %f", sspr); + object_post((t_object *)x, "spec irr: %f", si * 0.001); + d.specirr.push_back(si * 0.001); } break; +// case FEATURE_SPECCENTER: { +// //skip bc we already compute - should take this out +// object_post((t_object *)x, "spec centroid: %f", sc); +// } break; +// case FEATURE_SPECSPREAD:{ +// //skip bc we already compute - should take this out +// object_post((t_object *)x, "spec spread: %f", sspr); +// } break; case FEATURE_SPECSKEW: { double ssk = specskew(&s[0], &freqs[0], p.fft_size / 2, sc, sspr); - object_post((t_object *)x, "spec skew: %f", ssk); - d.specskew.push_back(ssk); + object_post((t_object *)x, "spec skew: %f", ssk * 0.1); + d.specskew.push_back(ssk * 0.1); } break; case FEATURE_SPECKURT: { double k = speckurt(&s[0], &freqs[0], p.fft_size / 2, sc, sspr); object_post((t_object *)x, "spec kurt: %f", k); d.speckurt.push_back(k * 0.01); } break; - case FEATURE_SPECFLUX: { - //how to calculate the old amplitudes... ??? - //double f = specflux(&s[0], oa, p.fft_size); - object_error((t_object *)x, "spectral flux is currently unimplemented."); - return; - } break; - case FEATURE_SPECDECR: { - double sd = specdecr(&s[0], p.fft_size / 2); - object_post((t_object *)x, "spec decrease: %f", sd); - d.specdecr.push_back(sd); - } break; - case FEATURE_SPECSLOPE: { - double ssl = specslope(&s[0], &freqs[0], p.fft_size / 2); - object_post((t_object *)x, "spec slope: %f", ssl); - d.specslope.push_back(ssl); - } break; +// case FEATURE_SPECFLUX: { +// //how to calculate the old amplitudes... ??? +// //double f = specflux(&s[0], oa, p.fft_size); +// object_error((t_object *)x, "spectral flux is currently unimplemented."); +// feature_valid = false; +// } break; +// case FEATURE_SPECDECR: { +// double sd = specdecr(&s[0], p.fft_size / 2); +// object_post((t_object *)x, "spec decrease: %f", sd); +// d.specdecr.push_back(sd); +// } break; +// case FEATURE_SPECSLOPE: { +// double ssl = specslope(&s[0], &freqs[0], p.fft_size / 2); +// object_post((t_object *)x, "spec slope: %f", ssl); +// d.specslope.push_back(ssl); +// } break; case FEATURE_SPECFLAT: { double sf = specflat(&s[0], p.fft_size / 2); - object_post((t_object *)x, "spec flatness: %f", sf); - d.specflat.push_back(sf); + object_post((t_object *)x, "spec flatness: %f", sf * 10000.); + d.specflat.push_back(sf * 10000.); } break; case FEATURE_SPECCREST: { double scr = speccrest(&s[0], p.fft_size / 2); - object_post((t_object *)x, "spec crest: %f", scr); - d.speccrest.push_back(scr); + object_post((t_object *)x, "spec crest: %f", scr * 10); + d.speccrest.push_back(scr * 10); } break; default: { object_error((t_object *)x, "analysis: cannot find valid feature id."); - return; + feature_valid = false; } } } @@ -1036,27 +1105,31 @@ static void populate_features(t_morphograph *x){ x->l_features[0] = (char *)"energy"; x->l_features[1] = (char *)"zcr"; x->l_features[2] = (char *)"hfc"; - x->l_features[3] = (char *)"inharmonicity"; - x->l_features[4] = (char *)"specirr"; - x->l_features[5] = (char *)"speccentr"; - x->l_features[6] = (char *)"specspread"; + x->l_features[3] = (char *)"specirr"; + x->l_features[4] = (char *)"speckurt"; + x->l_features[5] = (char *)"speccrest"; + x->l_features[6] = (char *)"specflat"; x->l_features[7] = (char *)"specskew"; - x->l_features[8] = (char *)"speckurt"; - x->l_features[9] = (char *)"specflux"; - x->l_features[10] = (char *)"specdecr"; - x->l_features[11] = (char *)"specslope"; - x->l_features[12] = (char *)"specflat"; - x->l_features[13] = (char *)"speccrest"; + +// x->l_features[8] = (char *)"speccentr"; +// x->l_features[9] = (char *)"specspread"; +// x->l_features[10] = (char *)"specflux"; +// x->l_features[11] = (char *)"specdecr"; +// x->l_features[12] = (char *)"specslope"; +// x->l_features[13] = (char *)"inharmonicity"; } static void populate_actions(t_morphograph *x){ - x->l_actions[0] = (char *)"rotation"; - x->l_actions[1] = (char *)"xscale"; - x->l_actions[2] = (char *)"yscale"; - x->l_actions[3] = (char *)"size"; - x->l_actions[4] = (char *)"ylocation"; - x->l_actions[5] = (char *)"xdeviation"; - x->l_actions[6] = (char *)"brightness"; + + x->l_actions[0] = (char *)"xscale"; + x->l_actions[1] = (char *)"yscale"; + x->l_actions[2] = (char *)"size"; + x->l_actions[3] = (char *)"ylocation"; + x->l_actions[4] = (char *)"brightness"; + +// x->l_actions[5] = (char *)"rotation"; +// x->l_actions[6] = (char *)"xdeviation"; + } static void populate_shapes(t_morphograph *x){ @@ -1170,7 +1243,7 @@ void morphograph_set(t_morphograph *x, t_symbol *s) { void morphograph_set_path(t_morphograph *x, t_symbol *s) { x->l_filepath = s; - object_post((t_object *)x, "the path: %s", x->l_filepath->s_name); + object_post((t_object *)x, "svg write path: %s", x->l_filepath->s_name); } //this should be handled by the process_descmap() function @@ -1278,6 +1351,7 @@ void morphograph_load(t_morphograph *x, t_symbol *s){ } else { //path is input by user (via open dialog object for ex) strcpy(filename,s->s_name); + // locatefile_extended(<#char *name#>, <#short *outvol#>, <#t_fourcc *outtype#>, <#const t_fourcc *filetypelist#>, <#short numtypes#>) if (!locatefile_extended(filename, &pathid, &outtype, type, ntype)) { //continue } else { @@ -1337,20 +1411,21 @@ void morphograph_paint(t_morphograph *x, t_object *patcherview) { jsvg_render(x->l_svg, g); }else{ - t_jrgba color, color_r; - double offset = 5.; - double offset2 = 10.; + t_jrgba color_bg, color_rr; + double offset = 2.; + double offset2 = 7.; //alpha is transparent if zero - color.red = 0.; color.green = 1.; color.blue = 0.; color.alpha = 1.; - color_r.red = 0.2; color_r.green = 0.5; color_r.blue = 0.; color_r.alpha = 1.; - + color_bg.red = 0.064286; color_bg.green = 0.315738; color_bg.blue = 0.364286; color_bg.alpha = 1.; + color_rr.red = 0.217857; color_rr.green = 0.492961; color_rr.blue = 0.496429; color_rr.alpha = 1.; - jgraphics_set_source_jrgba(g, &color); - jgraphics_rectangle(g, offset, offset, rect.width - offset*2, rect.height - offset*2); + + + jgraphics_set_source_jrgba(g, &color_bg); + jgraphics_rectangle(g, 0, 0, rect.width, rect.height); jgraphics_fill(g); - jgraphics_set_source_jrgba(g, &color_r); + jgraphics_set_source_jrgba(g, &color_rr); jgraphics_rectangle_rounded(g, offset2, offset2, rect.width - offset2*2, rect.height - offset2*2, 30, 30); jgraphics_fill(g); } @@ -1358,10 +1433,57 @@ void morphograph_paint(t_morphograph *x, t_object *patcherview) { } + + //------------------------------------------------------------------------------------------------- //c functions: std max api //------------------------------------------------------------------------------------------------- +//test filewriter --------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------- +void morphograph_write(t_morphograph *x, t_symbol *s){ + defer(x, (method)morphograph_dowrite, s, 0, NULL); +} + +void morphograph_dowrite(t_morphograph *x, t_symbol *s){ +// long filetype = 'TEXT', outtype; + char filename[512]; + //short path; + + //jml + short pathid; + t_fourcc type = NULL; + t_fourcc otype; + + //prev + //saveasdialog_extended(filename, &path, &outtype, &filetype, 1) + + if (s == gensym("")) { // if no argument supplied, ask for file + if (saveasdialog_extended(filename, &pathid, &otype, &type, 1)) // non-zero: user cancelled + return; + } else { + strcpy(filename, s->s_name); + pathid = path_getdefault(); + } + morphograph_writefile(x, filename, pathid); +} + +void morphograph_writefile(t_morphograph *x, char *filename, short path){ + + char *buf = (char *)"write me into a file"; + + long err; + t_filehandle fh; + + err = path_createsysfile(filename, path, 'TEXT', &fh); + if (err) + return; + err = sysfile_writetextfile(fh, &buf, TEXT_LB_NATIVE); + sysfile_close(fh); + +} +//------------------------------------------------------------------------------------------------- + void morphograph_anything(t_morphograph *x, const t_symbol * const s, const long ac, const t_atom *av){ } @@ -1490,7 +1612,9 @@ void ext_main(void *r) { class_addmethod(c, (method)morphograph_anything, "anything", A_GIMME, 0); class_addmethod(c, (method)morphograph_bang, "bang", 0); class_addmethod(c, (method)morphograph_assist, "assist", A_CANT, 0); - + //test text stuff + class_addmethod(c, (method)morphograph_write, "write", A_DEFSYM, 0); + //register custom user methods class_addmethod(c, (method)morphograph_set, "set", A_SYM, 0); class_addmethod(c, (method)morphograph_size, "size", A_LONG, A_LONG, 0);