gswitch troubles
Helo,
in the attached example, I am trying to switch back and forth using a gswitch between a 220 and a 440 cycle~, using a metro set to 250 ms.
The gswitch only seems to work if I toggle audio on and off, but not when the metro sends its bangs.
This is happening in 5.0.6 and 5.0.7 which I just installed.
can anyone verify this problem? it has been driving me nuts all night, until I could at least determine where my problem happens...
am I doing something wrong? gswitch *should* switch the signal from the second to the third inlet on every bang, right?
Thanks for any help!
Kai
{
"patcher" : {
"fileversion" : 1,
"rect" : [ 25.0, 69.0, 640.0, 506.0 ],
"bglocked" : 0,
"defrect" : [ 25.0, 69.0, 640.0, 506.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"boxes" : [ {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 192.0, 125.0, 20.0, 20.0 ],
"id" : "obj-10",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 250",
"patching_rect" : [ 203.0, 168.0, 65.0, 20.0 ],
"id" : "obj-8",
"fontname" : "Arial",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "bang" ]
}
}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 275.0, 222.0, 20.0, 20.0 ],
"id" : "obj-7",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ]
}
}
, {
"box" : {
"maxclass" : "gain~",
"patching_rect" : [ 383.0, 293.0, 20.0, 140.0 ],
"id" : "obj-5",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "signal", "int" ]
}
}
, {
"box" : {
"maxclass" : "ezdac~",
"patching_rect" : [ 417.0, 390.0, 45.0, 45.0 ],
"id" : "obj-4",
"numinlets" : 2,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "cycle~ 220",
"patching_rect" : [ 405.0, 207.0, 68.0, 20.0 ],
"id" : "obj-3",
"fontname" : "Arial",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "signal" ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "cycle~ 440",
"patching_rect" : [ 337.0, 207.0, 68.0, 20.0 ],
"id" : "obj-2",
"fontname" : "Arial",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "signal" ]
}
}
, {
"box" : {
"maxclass" : "gswitch",
"patching_rect" : [ 379.0, 247.0, 41.0, 32.0 ],
"id" : "obj-1",
"numinlets" : 3,
"numoutlets" : 1,
"outlettype" : [ "" ]
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-1", 2 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-1", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-4", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-4", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-5", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}
}
]
}
}
I got the expected behaviour here. i.e., gswitch switches fine on metro's bangs. Max 5.0.6 OSX
it switches here too, but I don't hear the difference it should make.
Thank you very much for trying!, even though it only makes things more bizarre for me...
Kai
For switching between audio sources/destinations look at [gate~], [selector~] and [matrix~].
lh
Thank you so much! to me it was unclear that gswitch was the wrong object. Selector~does what I meant to do. in the help for gswitch it only says:
"gswitch switches its output between two input streams."
without specifying what kind of input streams it expects. Thus I was thinking that this is a way of saying "anything can be gswitched here"..
again thanks!
Kai
Gswitch is much older than MSP. Its a good bet to assume any object without ~ is made for messages. That it does pass audio is because the connection process for the audio chain is controlled by messages. That's also why send/receive without ~ work fine with audio, but you can't change connections on the fly that way....
Stefan