It is an interesting idea, I like it, but how (possibly also why) would you control widget layout from within Csound ? Oeyvind 2008/1/26, Rory Walsh : > > As I said in an earlier post, I do use two systems (chnset and outvalue) > > in the same orchestra. The important difference is that one is a > > This is a rare case but nonetheless a valid one. The issue at the moment > is that there is no standard which means users have to rewrite their > Csound code each time they want to run it with another GUI front end. > For example a users of MacCsound who's want to build a GUI instrument > that works both as a csLADSPA plugin and a MacCsound instrument cannot > do so without employing lots of #ifdef. Another example would be users > of Lettuce who want to port their work to MacCsound. At present this > will not work without completely rewriting ones code. In an ideal world > the following instrument would run as a csLADSPA, a MacCsound instrument > and a Lettuce instrument without changing a line of code: > > ;csLADSPA section > Name=Gain-Mono > Maker=John Doe > UniqueID=1054 > Copyright=GNU > ControlPort=Gain|gain > Range=0|2 > ;Lettuce section > > form "Untitled", 300, 250, 10, 10 > menu "menu_0", 0, TopItem:"File", RunCsound:"Start_Csound|Stop_Csound", > StdOut:"View_Console", Exit:"Close" > scrollbar "gain", 100, 17, 33, 40, 0, 100, 0, "horizontal" > > Name=Gain-Mono > Maker=John Doe > UniqueID=1054 > Copyright=GNU > ControlPort=Gain|gain > Range=0|2 > > ;MacCsound sectin > //I don't have a Mac!! > //In here would be the relevant MacCsound code > > > > /*Lettuce declared channels, do not code manually between these comments*/ > /*end of channel declaration*/ > sr = 44100 > ksmps = 64 > nchnls = 1 > > instr 1 > kGain chnget "gain" > ain inch 1 > out ain*kGain > endin > > > > i1 0 3600 > > > > > One obvious problem with the code presented above is that it's rather > cumbersome. After meeting Matt at Sounds Electric in November we started > to discuss the idea of developing an attribute based bussing system on > the premise that most front-ends use common components such as > scrollbars, buttons, comboboxes etc. For example, below we have a > hypothetical "allocwidget" opcode that creates a new channel and widget. > It also allows users to dynamically change widgets, if the host supports > such a thing. > > ; allocates widget and returns > ; 2 buschannel variables, > ; one for the value, one for the attributes > ; all input attribute text is optional and > gkvl1, gSa1 allocwidget "type(slider) channel(freq) size(100, 100) > colour(red) value(50)" > > ; real-time changing of the widget > instr 1 > printk gkv1 ; print current value of the widget > gkv1 = .2 ; sets the value of the widget > gSa1 = "value(.2) ; this does the same thing > gSa1 = "size(50, 50)"; change the size of the widget > endin > > With such a system the multi-frontend Csound code presented above could > be reduced in size to this: > > > > /*Lettuce declared channels, do not code manually between these comments*/ > /*end of channel declaration*/ > sr = 44100 > ksmps = 64 > nchnls = 1 > > gkvl1, gSa1 allocwidget "type(slider) channel("gain") size(100, 100) > position(10, 10) value(0)" > > instr 1 > ain inch 1 > out ain*gkvl1 > endin > > > > i1 0 3600 > > > > With the development of more and more GUI frontends I think now is the > time to starting thinking about such a system. What do others think? > > Rory. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net