[Qutecsound-users] Chnget/Chnset fixed

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
Hi all,

I've just committed a fix for the chnset/chnget opcodes. I think this
will be the recommended method to interact with widgets in the future,
so please give it a try if you are building.

Using chnget/chnset will significantly reduce CPU usage, especially
with a larger number of widgets.

Cheers,
Andres

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

joachim-3
hi andrés -

sounds interesting. can you describe a little bit more in detail? what
has been the problem with chnget/chnset? what are the advantages in
performance using chnget/chnset compared with invalue/outvalue now?

thanks -

        joachim


Am 21.01.2012 17:28, schrieb Andres Cabrera:

> Hi all,
>
> I've just committed a fix for the chnset/chnget opcodes. I think this
> will be the recommended method to interact with widgets in the future,
> so please give it a try if you are building.
>
> Using chnget/chnset will significantly reduce CPU usage, especially
> with a larger number of widgets.
>
> Cheers,
> Andres
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

joachim-3
one more question:
i think up to now, nearly all examples for csoundqt work with
invalue/outvalue for the widgets communication. if we change now to
chnget/chnset, the user has to change in configure>widgets to "use
chnget/chnset" instead of "use invalue/outvalue", and all the examples
(amongst them rené's translation of iains realtime collection) will not
work for him/her.
is it a problem to allow both, invalue/outvalue and chnget/chnset for
the communication between csoundqt and the widget panel?
cheers -
        joachim


Am 21.01.2012 20:49, schrieb joachim heintz:

> hi andrés -
>
> sounds interesting. can you describe a little bit more in detail? what
> has been the problem with chnget/chnset? what are the advantages in
> performance using chnget/chnset compared with invalue/outvalue now?
>
> thanks -
>
> joachim
>
>
> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>> Hi all,
>>
>> I've just committed a fix for the chnset/chnget opcodes. I think this
>> will be the recommended method to interact with widgets in the future,
>> so please give it a try if you are building.
>>
>> Using chnget/chnset will significantly reduce CPU usage, especially
>> with a larger number of widgets.
>>
>> Cheers,
>> Andres
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
Hi Joachim,

The problem with chnget/chnset was that I hadn't understood how it
worked correctly when I initially tried to implement it (two or three
years ago), but now I've got a good way of using it. I was also
striving for full compatibility with MacCsound, which used only
invalue/outvalue and did not support chnget/chnset.

The main difference between invalue/outvalue and chnget/chnset is
internal. invalue/outvalue use callback functions, so every control
pass, when there is an invalue or outvalue opcode, the callback
function is called. In CsoundQt this currently means that each
invalue/outvalue reads or writes to a widget (if the channel matches),
which means locking and unlocking the widget, which can be very
inefficient for large number of widgets. On much earlier versions of
CsoundQt, I was storing the values in an intermediate buffer which
were then passed to the widgets later by another thread. This was much
more efficient but didn't work well as the value of the widget didn't
really change until the value was processed, which could happen any
time later, so if you read the widget value just after writing to it,
you could sometimes get the old value.

For chnget/chnset, the values are stored internally in the Csound
library (invalue and outvalue rely on the host application providing
storage), so when they are called, there is no locking (actually just
a single lock per control pass), just a reading of the current value.
What I am doing right now is that when the user moves a widget, I
store those changes in a queue which is processed between control
passes. This ends up being significantly more efficient as widgets are
only locked when they need to be written to (whenever the channel
value changes), and not all widgets on every pass. The change has
provided a significant improvement in CPU usage with what I am working
on right now, and I think most users will benefit from switching to
chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
CsoundQt.

But you are also right about the fact that CsoundQt examples all use
invalue/outvalue and that most users will probably have followed that
convention. I was initially thinking that it had to be just one or the
other, but you made me realise that it might be no problem to allow
both, so that's what I'll do.

Cheers,
Andrés

On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]> wrote:

> one more question:
> i think up to now, nearly all examples for csoundqt work with
> invalue/outvalue for the widgets communication. if we change now to
> chnget/chnset, the user has to change in configure>widgets to "use
> chnget/chnset" instead of "use invalue/outvalue", and all the examples
> (amongst them rené's translation of iains realtime collection) will not
> work for him/her.
> is it a problem to allow both, invalue/outvalue and chnget/chnset for
> the communication between csoundqt and the widget panel?
> cheers -
>        joachim
>
>
> Am 21.01.2012 20:49, schrieb joachim heintz:
>> hi andrés -
>>
>> sounds interesting. can you describe a little bit more in detail? what
>> has been the problem with chnget/chnset? what are the advantages in
>> performance using chnget/chnset compared with invalue/outvalue now?
>>
>> thanks -
>>
>>       joachim
>>
>>
>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>>> Hi all,
>>>
>>> I've just committed a fix for the chnset/chnget opcodes. I think this
>>> will be the recommended method to interact with widgets in the future,
>>> so please give it a try if you are building.
>>>
>>> Using chnget/chnset will significantly reduce CPU usage, especially
>>> with a larger number of widgets.
>>>
>>> Cheers,
>>> Andres
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Qutecsound-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

joachim-3
thanks, andrés. having both opportunities will be perfect.
can you ping when current svn supports both? then i am happy to test.
best -
        joachim



Am 22.01.2012 08:28, schrieb Andres Cabrera:

> Hi Joachim,
>
> The problem with chnget/chnset was that I hadn't understood how it
> worked correctly when I initially tried to implement it (two or three
> years ago), but now I've got a good way of using it. I was also
> striving for full compatibility with MacCsound, which used only
> invalue/outvalue and did not support chnget/chnset.
>
> The main difference between invalue/outvalue and chnget/chnset is
> internal. invalue/outvalue use callback functions, so every control
> pass, when there is an invalue or outvalue opcode, the callback
> function is called. In CsoundQt this currently means that each
> invalue/outvalue reads or writes to a widget (if the channel matches),
> which means locking and unlocking the widget, which can be very
> inefficient for large number of widgets. On much earlier versions of
> CsoundQt, I was storing the values in an intermediate buffer which
> were then passed to the widgets later by another thread. This was much
> more efficient but didn't work well as the value of the widget didn't
> really change until the value was processed, which could happen any
> time later, so if you read the widget value just after writing to it,
> you could sometimes get the old value.
>
> For chnget/chnset, the values are stored internally in the Csound
> library (invalue and outvalue rely on the host application providing
> storage), so when they are called, there is no locking (actually just
> a single lock per control pass), just a reading of the current value.
> What I am doing right now is that when the user moves a widget, I
> store those changes in a queue which is processed between control
> passes. This ends up being significantly more efficient as widgets are
> only locked when they need to be written to (whenever the channel
> value changes), and not all widgets on every pass. The change has
> provided a significant improvement in CPU usage with what I am working
> on right now, and I think most users will benefit from switching to
> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
> CsoundQt.
>
> But you are also right about the fact that CsoundQt examples all use
> invalue/outvalue and that most users will probably have followed that
> convention. I was initially thinking that it had to be just one or the
> other, but you made me realise that it might be no problem to allow
> both, so that's what I'll do.
>
> Cheers,
> Andrés
>
> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]> wrote:
>> one more question:
>> i think up to now, nearly all examples for csoundqt work with
>> invalue/outvalue for the widgets communication. if we change now to
>> chnget/chnset, the user has to change in configure>widgets to "use
>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
>> (amongst them rené's translation of iains realtime collection) will not
>> work for him/her.
>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
>> the communication between csoundqt and the widget panel?
>> cheers -
>>        joachim
>>
>>
>> Am 21.01.2012 20:49, schrieb joachim heintz:
>>> hi andrés -
>>>
>>> sounds interesting. can you describe a little bit more in detail? what
>>> has been the problem with chnget/chnset? what are the advantages in
>>> performance using chnget/chnset compared with invalue/outvalue now?
>>>
>>> thanks -
>>>
>>>       joachim
>>>
>>>
>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>>>> Hi all,
>>>>
>>>> I've just committed a fix for the chnset/chnget opcodes. I think this
>>>> will be the recommended method to interact with widgets in the future,
>>>> so please give it a try if you are building.
>>>>
>>>> Using chnget/chnset will significantly reduce CPU usage, especially
>>>> with a larger number of widgets.
>>>>
>>>> Cheers,
>>>> Andres
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Try before you buy = See our experts in action!
>>>> The most comprehensive online learning library for Microsoft developers
>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>> _______________________________________________
>>>> Qutecsound-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Qutecsound-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

tarmoj
In reply to this post by Andres Cabrera
Sounds great!

I wanted to test it and encountered some problems:

1) building
For any case I pulled the source from svn repository to a fresh directory to avoid any trouble from old sources, but still

the Makefile generated by qmake does not add -DQCS_PYTHONQT in the line of  DEFINES
and I got error 'CsoundEngine’ has no member named ‘registerProcessCallback’

after adding  -DQCS_PYTHONQT to the Makefile manually, I got error:

doubles/obj/pyqcsobject.o: In function `PyQcsObject::registerProcessCallback(QString, int, int)':
pyqcsobject.cpp:(.text+0x1ffb): undefined reference to `CsoundEngine::registerProcessCallback(QString, int)'


That's strange, before it did not happen

Then I commented out all lines like #ifdef QCS_PYTHONQT ... #endif
in csoundengine.cpp and csoundengine.h
and it compiled.
Of course it should not be like that.


2) I ran the fresh CsoundQt with a test csd haveing four groups of widgets (I attach the csd) - pushbuttons and scrollnumbers.
Using the old invalue version, it worked but ate a lot of CPU (like it used to be)
after invalue->chnset there was unfortunately no interaction with the widgets at all

output from the program:

-----

csound
-b1024
-B4096
--new-parser
-+rtaudio=alsa
-iadc
-odac
-+rtmidi=alsa
--env:CSNOSTOP=yes
/home/tarmo/tarmo/csound/widget-test.csd
WidgetLayout::setOuterGeometry 870 69 -1 -1
WidgetLayout::setOuterGeometry -1 -1 94 24
WidgetLayout::setOuterGeometry 0 0 -1 -1
WidgetLayout::setOuterGeometry -1 -1 388 443
CsoundQt::stop()  -1
csoundDestroyThreadLock: : Resource temporarily unavailable
csoundDestroyThreadLock: : Resource temporarily unavailable
CsoundEngine::stopCsound() joined
CsoundQt::stop()  -1
CsoundQt::stop()  -1

----

Would be wonderful to get it work!

(Csound 5.15 double, CsoundQt

tarmo



On Saturday 21 January 2012 18:28:22 Andres Cabrera wrote:

> Hi all,
>
> I've just committed a fix for the chnset/chnget opcodes. I think this
> will be the recommended method to interact with widgets in the future,
> so please give it a try if you are building.
>
> Using chnget/chnset will significantly reduce CPU usage, especially
> with a larger number of widgets.
>
> Cheers,
> Andres
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users

widget-test.csd (25K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
Hi Tarmo,

Problem 1 seems more to do with leftovers from previous builds. Can
you try cleaning, running qmake and building to see if the problem
persists?

In your csd you are missing the chn_k declarations. These declarations
expose the channels to the API. chnget and chnset channels will work
internally without the declarations but they must be declared in the
header for CsoundQt to see them.

I was thinking of writing a python script that could do this
automatically, but don't know when I'll have the time...

Cheers,
Andrés

2012/1/23 Tarmo Johannes <[hidden email]>:

> Sounds great!
>
> I wanted to test it and encountered some problems:
>
> 1) building
> For any case I pulled the source from svn repository to a fresh directory to avoid any trouble from old sources, but still
>
> the Makefile generated by qmake does not add -DQCS_PYTHONQT in the line of  DEFINES
> and I got error 'CsoundEngine’ has no member named ‘registerProcessCallback’
>
> after adding  -DQCS_PYTHONQT to the Makefile manually, I got error:
>
> doubles/obj/pyqcsobject.o: In function `PyQcsObject::registerProcessCallback(QString, int, int)':
> pyqcsobject.cpp:(.text+0x1ffb): undefined reference to `CsoundEngine::registerProcessCallback(QString, int)'
>
>
> That's strange, before it did not happen
>
> Then I commented out all lines like #ifdef QCS_PYTHONQT ... #endif
> in csoundengine.cpp and csoundengine.h
> and it compiled.
> Of course it should not be like that.
>
>
> 2) I ran the fresh CsoundQt with a test csd haveing four groups of widgets (I attach the csd) - pushbuttons and scrollnumbers.
> Using the old invalue version, it worked but ate a lot of CPU (like it used to be)
> after invalue->chnset there was unfortunately no interaction with the widgets at all
>
> output from the program:
>
> -----
>
> csound
> -b1024
> -B4096
> --new-parser
> -+rtaudio=alsa
> -iadc
> -odac
> -+rtmidi=alsa
> --env:CSNOSTOP=yes
> /home/tarmo/tarmo/csound/widget-test.csd
> WidgetLayout::setOuterGeometry 870 69 -1 -1
> WidgetLayout::setOuterGeometry -1 -1 94 24
> WidgetLayout::setOuterGeometry 0 0 -1 -1
> WidgetLayout::setOuterGeometry -1 -1 388 443
> CsoundQt::stop()  -1
> csoundDestroyThreadLock: : Resource temporarily unavailable
> csoundDestroyThreadLock: : Resource temporarily unavailable
> CsoundEngine::stopCsound() joined
> CsoundQt::stop()  -1
> CsoundQt::stop()  -1
>
> ----
>
> Would be wonderful to get it work!
>
> (Csound 5.15 double, CsoundQt
>
> tarmo
>
>
>
> On Saturday 21 January 2012 18:28:22 Andres Cabrera wrote:
>> Hi all,
>>
>> I've just committed a fix for the chnset/chnget opcodes. I think this
>> will be the recommended method to interact with widgets in the future,
>> so please give it a try if you are building.
>>
>> Using chnget/chnset will significantly reduce CPU usage, especially
>> with a larger number of widgets.
>>
>> Cheers,
>> Andres
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
In reply to this post by joachim-3
Hi Joachim,

Done. Both options are now enabled by default and can be used simultaneously.

Cheers,
Andrés

On Sun, Jan 22, 2012 at 9:37 AM, joachim heintz <[hidden email]> wrote:

> thanks, andrés. having both opportunities will be perfect.
> can you ping when current svn supports both? then i am happy to test.
> best -
>        joachim
>
>
>
> Am 22.01.2012 08:28, schrieb Andres Cabrera:
>> Hi Joachim,
>>
>> The problem with chnget/chnset was that I hadn't understood how it
>> worked correctly when I initially tried to implement it (two or three
>> years ago), but now I've got a good way of using it. I was also
>> striving for full compatibility with MacCsound, which used only
>> invalue/outvalue and did not support chnget/chnset.
>>
>> The main difference between invalue/outvalue and chnget/chnset is
>> internal. invalue/outvalue use callback functions, so every control
>> pass, when there is an invalue or outvalue opcode, the callback
>> function is called. In CsoundQt this currently means that each
>> invalue/outvalue reads or writes to a widget (if the channel matches),
>> which means locking and unlocking the widget, which can be very
>> inefficient for large number of widgets. On much earlier versions of
>> CsoundQt, I was storing the values in an intermediate buffer which
>> were then passed to the widgets later by another thread. This was much
>> more efficient but didn't work well as the value of the widget didn't
>> really change until the value was processed, which could happen any
>> time later, so if you read the widget value just after writing to it,
>> you could sometimes get the old value.
>>
>> For chnget/chnset, the values are stored internally in the Csound
>> library (invalue and outvalue rely on the host application providing
>> storage), so when they are called, there is no locking (actually just
>> a single lock per control pass), just a reading of the current value.
>> What I am doing right now is that when the user moves a widget, I
>> store those changes in a queue which is processed between control
>> passes. This ends up being significantly more efficient as widgets are
>> only locked when they need to be written to (whenever the channel
>> value changes), and not all widgets on every pass. The change has
>> provided a significant improvement in CPU usage with what I am working
>> on right now, and I think most users will benefit from switching to
>> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
>> CsoundQt.
>>
>> But you are also right about the fact that CsoundQt examples all use
>> invalue/outvalue and that most users will probably have followed that
>> convention. I was initially thinking that it had to be just one or the
>> other, but you made me realise that it might be no problem to allow
>> both, so that's what I'll do.
>>
>> Cheers,
>> Andrés
>>
>> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]> wrote:
>>> one more question:
>>> i think up to now, nearly all examples for csoundqt work with
>>> invalue/outvalue for the widgets communication. if we change now to
>>> chnget/chnset, the user has to change in configure>widgets to "use
>>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
>>> (amongst them rené's translation of iains realtime collection) will not
>>> work for him/her.
>>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
>>> the communication between csoundqt and the widget panel?
>>> cheers -
>>>        joachim
>>>
>>>
>>> Am 21.01.2012 20:49, schrieb joachim heintz:
>>>> hi andrés -
>>>>
>>>> sounds interesting. can you describe a little bit more in detail? what
>>>> has been the problem with chnget/chnset? what are the advantages in
>>>> performance using chnget/chnset compared with invalue/outvalue now?
>>>>
>>>> thanks -
>>>>
>>>>       joachim
>>>>
>>>>
>>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>>>>> Hi all,
>>>>>
>>>>> I've just committed a fix for the chnset/chnget opcodes. I think this
>>>>> will be the recommended method to interact with widgets in the future,
>>>>> so please give it a try if you are building.
>>>>>
>>>>> Using chnget/chnset will significantly reduce CPU usage, especially
>>>>> with a larger number of widgets.
>>>>>
>>>>> Cheers,
>>>>> Andres
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Try before you buy = See our experts in action!
>>>>> The most comprehensive online learning library for Microsoft developers
>>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>>> _______________________________________________
>>>>> Qutecsound-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Try before you buy = See our experts in action!
>>>> The most comprehensive online learning library for Microsoft developers
>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>> _______________________________________________
>>>> Qutecsound-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Qutecsound-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Rene Jopi
Hi Andrés, Tarmo,

Have tried too without succed.

widget-test_with_ch_k.csd  give the error:

INIT ERROR in instr 0: invalid channel name, chn_k "bitt1-1" 2 0 0 0 0


Have tested on a midi synth:

Moog_using_invalue.csd and its presets are working in midi realtime. 

With Moog_using_chnget.csd I have a strange behavour,
Its sounds different, presets are not working, but action on knobs change the sound.

First Note ON : no sound, (midi instr 1 is normaly activated).
Second Note ON: no sound  (second midi instr 1 is activated).
etc...

To get a sound on futures notes, I have to release one note.

Hope this help, not easy for me to explain :)


Cheers,
René
(Csound 5.15; CsoundQt rev 949; Ubuntu 10.04)



2012/1/23 Andres Cabrera <[hidden email]>
Hi Joachim,

Done. Both options are now enabled by default and can be used simultaneously.

Cheers,
Andrés

On Sun, Jan 22, 2012 at 9:37 AM, joachim heintz <[hidden email]> wrote:
> thanks, andrés. having both opportunities will be perfect.
> can you ping when current svn supports both? then i am happy to test.
> best -
>        joachim
>
>
>
> Am 22.01.2012 08:28, schrieb Andres Cabrera:
>> Hi Joachim,
>>
>> The problem with chnget/chnset was that I hadn't understood how it
>> worked correctly when I initially tried to implement it (two or three
>> years ago), but now I've got a good way of using it. I was also
>> striving for full compatibility with MacCsound, which used only
>> invalue/outvalue and did not support chnget/chnset.
>>
>> The main difference between invalue/outvalue and chnget/chnset is
>> internal. invalue/outvalue use callback functions, so every control
>> pass, when there is an invalue or outvalue opcode, the callback
>> function is called. In CsoundQt this currently means that each
>> invalue/outvalue reads or writes to a widget (if the channel matches),
>> which means locking and unlocking the widget, which can be very
>> inefficient for large number of widgets. On much earlier versions of
>> CsoundQt, I was storing the values in an intermediate buffer which
>> were then passed to the widgets later by another thread. This was much
>> more efficient but didn't work well as the value of the widget didn't
>> really change until the value was processed, which could happen any
>> time later, so if you read the widget value just after writing to it,
>> you could sometimes get the old value.
>>
>> For chnget/chnset, the values are stored internally in the Csound
>> library (invalue and outvalue rely on the host application providing
>> storage), so when they are called, there is no locking (actually just
>> a single lock per control pass), just a reading of the current value.
>> What I am doing right now is that when the user moves a widget, I
>> store those changes in a queue which is processed between control
>> passes. This ends up being significantly more efficient as widgets are
>> only locked when they need to be written to (whenever the channel
>> value changes), and not all widgets on every pass. The change has
>> provided a significant improvement in CPU usage with what I am working
>> on right now, and I think most users will benefit from switching to
>> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
>> CsoundQt.
>>
>> But you are also right about the fact that CsoundQt examples all use
>> invalue/outvalue and that most users will probably have followed that
>> convention. I was initially thinking that it had to be just one or the
>> other, but you made me realise that it might be no problem to allow
>> both, so that's what I'll do.
>>
>> Cheers,
>> Andrés
>>
>> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]> wrote:
>>> one more question:
>>> i think up to now, nearly all examples for csoundqt work with
>>> invalue/outvalue for the widgets communication. if we change now to
>>> chnget/chnset, the user has to change in configure>widgets to "use
>>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
>>> (amongst them rené's translation of iains realtime collection) will not
>>> work for him/her.
>>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
>>> the communication between csoundqt and the widget panel?
>>> cheers -
>>>        joachim
>>>
>>>
>>> Am 21.01.2012 20:49, schrieb joachim heintz:
>>>> hi andrés -
>>>>
>>>> sounds interesting. can you describe a little bit more in detail? what
>>>> has been the problem with chnget/chnset? what are the advantages in
>>>> performance using chnget/chnset compared with invalue/outvalue now?
>>>>
>>>> thanks -
>>>>
>>>>       joachim
>>>>
>>>>
>>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>>>>> Hi all,
>>>>>
>>>>> I've just committed a fix for the chnset/chnget opcodes. I think this
>>>>> will be the recommended method to interact with widgets in the future,
>>>>> so please give it a try if you are building.
>>>>>
>>>>> Using chnget/chnset will significantly reduce CPU usage, especially
>>>>> with a larger number of widgets.
>>>>>
>>>>> Cheers,
>>>>> Andres
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Try before you buy = See our experts in action!
>>>>> The most comprehensive online learning library for Microsoft developers
>>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>>> _______________________________________________
>>>>> Qutecsound-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Try before you buy = See our experts in action!
>>>> The most comprehensive online learning library for Microsoft developers
>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>> _______________________________________________
>>>> Qutecsound-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Qutecsound-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users

widget-test_with_ch_k.csd (29K) Download Attachment
Moog_using_chnget.csd (49K) Download Attachment
Moog_using_invalue.csd (48K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
Hi,

Ah! I see the problem! Chnget and chnset dont like the "-" character
in the name of channels. If you change this it will work.

The moog example is working for me... (I just tested with a printk2
whether the amp widget was transmitting)

Cheers,
Andrés

On Tue, Jan 24, 2012 at 3:11 PM, Rene Jopi <[hidden email]> wrote:

> Hi Andrés, Tarmo,
>
> Have tried too without succed.
>
> widget-test_with_ch_k.csd  give the error:
>
> INIT ERROR in instr 0: invalid channel name, chn_k "bitt1-1" 2 0 0 0 0
>
>
> Have tested on a midi synth:
>
> Moog_using_invalue.csd and its presets are working in midi realtime.
>
> With Moog_using_chnget.csd I have a strange behavour,
> Its sounds different, presets are not working, but action on knobs change
> the sound.
>
> First Note ON : no sound, (midi instr 1 is normaly activated).
> Second Note ON: no sound  (second midi instr 1 is activated).
> etc...
>
> To get a sound on futures notes, I have to release one note.
>
> Hope this help, not easy for me to explain :)
>
>
> Cheers,
> René
> (Csound 5.15; CsoundQt rev 949; Ubuntu 10.04)
>
>
>
>
> 2012/1/23 Andres Cabrera <[hidden email]>
>>
>> Hi Joachim,
>>
>> Done. Both options are now enabled by default and can be used
>> simultaneously.
>>
>> Cheers,
>> Andrés
>>
>> On Sun, Jan 22, 2012 at 9:37 AM, joachim heintz <[hidden email]>
>> wrote:
>> > thanks, andrés. having both opportunities will be perfect.
>> > can you ping when current svn supports both? then i am happy to test.
>> > best -
>> >        joachim
>> >
>> >
>> >
>> > Am 22.01.2012 08:28, schrieb Andres Cabrera:
>> >> Hi Joachim,
>> >>
>> >> The problem with chnget/chnset was that I hadn't understood how it
>> >> worked correctly when I initially tried to implement it (two or three
>> >> years ago), but now I've got a good way of using it. I was also
>> >> striving for full compatibility with MacCsound, which used only
>> >> invalue/outvalue and did not support chnget/chnset.
>> >>
>> >> The main difference between invalue/outvalue and chnget/chnset is
>> >> internal. invalue/outvalue use callback functions, so every control
>> >> pass, when there is an invalue or outvalue opcode, the callback
>> >> function is called. In CsoundQt this currently means that each
>> >> invalue/outvalue reads or writes to a widget (if the channel matches),
>> >> which means locking and unlocking the widget, which can be very
>> >> inefficient for large number of widgets. On much earlier versions of
>> >> CsoundQt, I was storing the values in an intermediate buffer which
>> >> were then passed to the widgets later by another thread. This was much
>> >> more efficient but didn't work well as the value of the widget didn't
>> >> really change until the value was processed, which could happen any
>> >> time later, so if you read the widget value just after writing to it,
>> >> you could sometimes get the old value.
>> >>
>> >> For chnget/chnset, the values are stored internally in the Csound
>> >> library (invalue and outvalue rely on the host application providing
>> >> storage), so when they are called, there is no locking (actually just
>> >> a single lock per control pass), just a reading of the current value.
>> >> What I am doing right now is that when the user moves a widget, I
>> >> store those changes in a queue which is processed between control
>> >> passes. This ends up being significantly more efficient as widgets are
>> >> only locked when they need to be written to (whenever the channel
>> >> value changes), and not all widgets on every pass. The change has
>> >> provided a significant improvement in CPU usage with what I am working
>> >> on right now, and I think most users will benefit from switching to
>> >> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
>> >> CsoundQt.
>> >>
>> >> But you are also right about the fact that CsoundQt examples all use
>> >> invalue/outvalue and that most users will probably have followed that
>> >> convention. I was initially thinking that it had to be just one or the
>> >> other, but you made me realise that it might be no problem to allow
>> >> both, so that's what I'll do.
>> >>
>> >> Cheers,
>> >> Andrés
>> >>
>> >> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]>
>> >> wrote:
>> >>> one more question:
>> >>> i think up to now, nearly all examples for csoundqt work with
>> >>> invalue/outvalue for the widgets communication. if we change now to
>> >>> chnget/chnset, the user has to change in configure>widgets to "use
>> >>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
>> >>> (amongst them rené's translation of iains realtime collection) will
>> >>> not
>> >>> work for him/her.
>> >>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
>> >>> the communication between csoundqt and the widget panel?
>> >>> cheers -
>> >>>        joachim
>> >>>
>> >>>
>> >>> Am 21.01.2012 20:49, schrieb joachim heintz:
>> >>>> hi andrés -
>> >>>>
>> >>>> sounds interesting. can you describe a little bit more in detail?
>> >>>> what
>> >>>> has been the problem with chnget/chnset? what are the advantages in
>> >>>> performance using chnget/chnset compared with invalue/outvalue now?
>> >>>>
>> >>>> thanks -
>> >>>>
>> >>>>       joachim
>> >>>>
>> >>>>
>> >>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>> >>>>> Hi all,
>> >>>>>
>> >>>>> I've just committed a fix for the chnset/chnget opcodes. I think
>> >>>>> this
>> >>>>> will be the recommended method to interact with widgets in the
>> >>>>> future,
>> >>>>> so please give it a try if you are building.
>> >>>>>
>> >>>>> Using chnget/chnset will significantly reduce CPU usage, especially
>> >>>>> with a larger number of widgets.
>> >>>>>
>> >>>>> Cheers,
>> >>>>> Andres
>> >>>>>
>> >>>>>
>> >>>>> ------------------------------------------------------------------------------
>> >>>>> Try before you buy = See our experts in action!
>> >>>>> The most comprehensive online learning library for Microsoft
>> >>>>> developers
>> >>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
>> >>>>> MVC3,
>> >>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>> >>>>> http://p.sf.net/sfu/learndevnow-dev2
>> >>>>> _______________________________________________
>> >>>>> Qutecsound-users mailing list
>> >>>>> [hidden email]
>> >>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>> >>>>>
>> >>>>
>> >>>>
>> >>>> ------------------------------------------------------------------------------
>> >>>> Try before you buy = See our experts in action!
>> >>>> The most comprehensive online learning library for Microsoft
>> >>>> developers
>> >>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
>> >>>> MVC3,
>> >>>> Metro Style Apps, more. Free future releases when you subscribe now!
>> >>>> http://p.sf.net/sfu/learndevnow-dev2
>> >>>> _______________________________________________
>> >>>> Qutecsound-users mailing list
>> >>>> [hidden email]
>> >>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>> >>>
>> >>>
>> >>> ------------------------------------------------------------------------------
>> >>> Try before you buy = See our experts in action!
>> >>> The most comprehensive online learning library for Microsoft
>> >>> developers
>> >>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
>> >>> MVC3,
>> >>> Metro Style Apps, more. Free future releases when you subscribe now!
>> >>> http://p.sf.net/sfu/learndevnow-dev2
>> >>> _______________________________________________
>> >>> Qutecsound-users mailing list
>> >>> [hidden email]
>> >>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Try before you buy = See our experts in action!
>> >> The most comprehensive online learning library for Microsoft developers
>> >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
>> >> MVC3,
>> >> Metro Style Apps, more. Free future releases when you subscribe now!
>> >> http://p.sf.net/sfu/learndevnow-dev2
>> >> _______________________________________________
>> >> Qutecsound-users mailing list
>> >> [hidden email]
>> >> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Try before you buy = See our experts in action!
>> > The most comprehensive online learning library for Microsoft developers
>> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> > Metro Style Apps, more. Free future releases when you subscribe now!
>> > http://p.sf.net/sfu/learndevnow-dev2
>> > _______________________________________________
>> > Qutecsound-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

joachim-3
In reply to this post by Andres Cabrera
hi andrés -
tested now. works flawlessly in a small example (ubuntu 11.04, csound
5.15). i'll check out a more complex example and report the cpu gain.
thanks for your work!
        joachim

Am 23.01.2012 21:32, schrieb Andres Cabrera:

> Hi Joachim,
>
> Done. Both options are now enabled by default and can be used simultaneously.
>
> Cheers,
> Andrés
>
> On Sun, Jan 22, 2012 at 9:37 AM, joachim heintz <[hidden email]> wrote:
>> thanks, andrés. having both opportunities will be perfect.
>> can you ping when current svn supports both? then i am happy to test.
>> best -
>>        joachim
>>
>>
>>
>> Am 22.01.2012 08:28, schrieb Andres Cabrera:
>>> Hi Joachim,
>>>
>>> The problem with chnget/chnset was that I hadn't understood how it
>>> worked correctly when I initially tried to implement it (two or three
>>> years ago), but now I've got a good way of using it. I was also
>>> striving for full compatibility with MacCsound, which used only
>>> invalue/outvalue and did not support chnget/chnset.
>>>
>>> The main difference between invalue/outvalue and chnget/chnset is
>>> internal. invalue/outvalue use callback functions, so every control
>>> pass, when there is an invalue or outvalue opcode, the callback
>>> function is called. In CsoundQt this currently means that each
>>> invalue/outvalue reads or writes to a widget (if the channel matches),
>>> which means locking and unlocking the widget, which can be very
>>> inefficient for large number of widgets. On much earlier versions of
>>> CsoundQt, I was storing the values in an intermediate buffer which
>>> were then passed to the widgets later by another thread. This was much
>>> more efficient but didn't work well as the value of the widget didn't
>>> really change until the value was processed, which could happen any
>>> time later, so if you read the widget value just after writing to it,
>>> you could sometimes get the old value.
>>>
>>> For chnget/chnset, the values are stored internally in the Csound
>>> library (invalue and outvalue rely on the host application providing
>>> storage), so when they are called, there is no locking (actually just
>>> a single lock per control pass), just a reading of the current value.
>>> What I am doing right now is that when the user moves a widget, I
>>> store those changes in a queue which is processed between control
>>> passes. This ends up being significantly more efficient as widgets are
>>> only locked when they need to be written to (whenever the channel
>>> value changes), and not all widgets on every pass. The change has
>>> provided a significant improvement in CPU usage with what I am working
>>> on right now, and I think most users will benefit from switching to
>>> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
>>> CsoundQt.
>>>
>>> But you are also right about the fact that CsoundQt examples all use
>>> invalue/outvalue and that most users will probably have followed that
>>> convention. I was initially thinking that it had to be just one or the
>>> other, but you made me realise that it might be no problem to allow
>>> both, so that's what I'll do.
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]> wrote:
>>>> one more question:
>>>> i think up to now, nearly all examples for csoundqt work with
>>>> invalue/outvalue for the widgets communication. if we change now to
>>>> chnget/chnset, the user has to change in configure>widgets to "use
>>>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
>>>> (amongst them rené's translation of iains realtime collection) will not
>>>> work for him/her.
>>>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
>>>> the communication between csoundqt and the widget panel?
>>>> cheers -
>>>>        joachim
>>>>
>>>>
>>>> Am 21.01.2012 20:49, schrieb joachim heintz:
>>>>> hi andrés -
>>>>>
>>>>> sounds interesting. can you describe a little bit more in detail? what
>>>>> has been the problem with chnget/chnset? what are the advantages in
>>>>> performance using chnget/chnset compared with invalue/outvalue now?
>>>>>
>>>>> thanks -
>>>>>
>>>>>       joachim
>>>>>
>>>>>
>>>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
>>>>>> Hi all,
>>>>>>
>>>>>> I've just committed a fix for the chnset/chnget opcodes. I think this
>>>>>> will be the recommended method to interact with widgets in the future,
>>>>>> so please give it a try if you are building.
>>>>>>
>>>>>> Using chnget/chnset will significantly reduce CPU usage, especially
>>>>>> with a larger number of widgets.
>>>>>>
>>>>>> Cheers,
>>>>>> Andres
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Try before you buy = See our experts in action!
>>>>>> The most comprehensive online learning library for Microsoft developers
>>>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>>>> _______________________________________________
>>>>>> Qutecsound-users mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Try before you buy = See our experts in action!
>>>>> The most comprehensive online learning library for Microsoft developers
>>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>>> _______________________________________________
>>>>> Qutecsound-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Try before you buy = See our experts in action!
>>>> The most comprehensive online learning library for Microsoft developers
>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>>> http://p.sf.net/sfu/learndevnow-dev2
>>>> _______________________________________________
>>>> Qutecsound-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Qutecsound-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Qutecsound-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

tarmoj
In reply to this post by Andres Cabrera
Thank you, Andrés,

I repaced the '-' sine in the widgets and channels and now it works.
I did not notice any big difference in cpu usage - if all the widgets are active, the cpu usage is around 42% with the new chnget version and it is about the same with old invalue version (with the same and also with an older version of CsoudnQt binary).

Most of the load is caused by the group of 4 scrollnumbers. I don't know but it might be aslo a problem of Qt, not CsoundQt.

But anyway - I find this possibility wonderful - so it is possible to use either the widgets or software channels controlled by other instuments or the Csound API. I missed it very much in one application before and now it's there! Thank you, Andrés!

greetings,
tarmo

On Wednesday 25 January 2012 23:13:33 Andres Cabrera wrote:

> Hi,
>
> Ah! I see the problem! Chnget and chnset dont like the "-" character
> in the name of channels. If you change this it will work.
>
> The moog example is working for me... (I just tested with a printk2
> whether the amp widget was transmitting)
>
> Cheers,
> Andrés
>
> On Tue, Jan 24, 2012 at 3:11 PM, Rene Jopi <[hidden email]> wrote:
> > Hi Andrés, Tarmo,
> >
> > Have tried too without succed.
> >
> > widget-test_with_ch_k.csd  give the error:
> >
> > INIT ERROR in instr 0: invalid channel name, chn_k "bitt1-1" 2 0 0 0 0
> >
> >
> > Have tested on a midi synth:
> >
> > Moog_using_invalue.csd and its presets are working in midi realtime.
> >
> > With Moog_using_chnget.csd I have a strange behavour,
> > Its sounds different, presets are not working, but action on knobs change
> > the sound.
> >
> > First Note ON : no sound, (midi instr 1 is normaly activated).
> > Second Note ON: no sound  (second midi instr 1 is activated).
> > etc...
> >
> > To get a sound on futures notes, I have to release one note.
> >
> > Hope this help, not easy for me to explain :)
> >
> >
> > Cheers,
> > René
> > (Csound 5.15; CsoundQt rev 949; Ubuntu 10.04)
> >
> >
> >
> >
> > 2012/1/23 Andres Cabrera <[hidden email]>
> >>
> >> Hi Joachim,
> >>
> >> Done. Both options are now enabled by default and can be used
> >> simultaneously.
> >>
> >> Cheers,
> >> Andrés
> >>
> >> On Sun, Jan 22, 2012 at 9:37 AM, joachim heintz <[hidden email]>
> >> wrote:
> >> > thanks, andrés. having both opportunities will be perfect.
> >> > can you ping when current svn supports both? then i am happy to test.
> >> > best -
> >> >        joachim
> >> >
> >> >
> >> >
> >> > Am 22.01.2012 08:28, schrieb Andres Cabrera:
> >> >> Hi Joachim,
> >> >>
> >> >> The problem with chnget/chnset was that I hadn't understood how it
> >> >> worked correctly when I initially tried to implement it (two or three
> >> >> years ago), but now I've got a good way of using it. I was also
> >> >> striving for full compatibility with MacCsound, which used only
> >> >> invalue/outvalue and did not support chnget/chnset.
> >> >>
> >> >> The main difference between invalue/outvalue and chnget/chnset is
> >> >> internal. invalue/outvalue use callback functions, so every control
> >> >> pass, when there is an invalue or outvalue opcode, the callback
> >> >> function is called. In CsoundQt this currently means that each
> >> >> invalue/outvalue reads or writes to a widget (if the channel matches),
> >> >> which means locking and unlocking the widget, which can be very
> >> >> inefficient for large number of widgets. On much earlier versions of
> >> >> CsoundQt, I was storing the values in an intermediate buffer which
> >> >> were then passed to the widgets later by another thread. This was much
> >> >> more efficient but didn't work well as the value of the widget didn't
> >> >> really change until the value was processed, which could happen any
> >> >> time later, so if you read the widget value just after writing to it,
> >> >> you could sometimes get the old value.
> >> >>
> >> >> For chnget/chnset, the values are stored internally in the Csound
> >> >> library (invalue and outvalue rely on the host application providing
> >> >> storage), so when they are called, there is no locking (actually just
> >> >> a single lock per control pass), just a reading of the current value.
> >> >> What I am doing right now is that when the user moves a widget, I
> >> >> store those changes in a queue which is processed between control
> >> >> passes. This ends up being significantly more efficient as widgets are
> >> >> only locked when they need to be written to (whenever the channel
> >> >> value changes), and not all widgets on every pass. The change has
> >> >> provided a significant improvement in CPU usage with what I am working
> >> >> on right now, and I think most users will benefit from switching to
> >> >> chnget/chnset instead of invalue/outvalue in the coming 0.7 version of
> >> >> CsoundQt.
> >> >>
> >> >> But you are also right about the fact that CsoundQt examples all use
> >> >> invalue/outvalue and that most users will probably have followed that
> >> >> convention. I was initially thinking that it had to be just one or the
> >> >> other, but you made me realise that it might be no problem to allow
> >> >> both, so that's what I'll do.
> >> >>
> >> >> Cheers,
> >> >> Andrés
> >> >>
> >> >> On Sat, Jan 21, 2012 at 8:10 PM, joachim heintz <[hidden email]>
> >> >> wrote:
> >> >>> one more question:
> >> >>> i think up to now, nearly all examples for csoundqt work with
> >> >>> invalue/outvalue for the widgets communication. if we change now to
> >> >>> chnget/chnset, the user has to change in configure>widgets to "use
> >> >>> chnget/chnset" instead of "use invalue/outvalue", and all the examples
> >> >>> (amongst them rené's translation of iains realtime collection) will
> >> >>> not
> >> >>> work for him/her.
> >> >>> is it a problem to allow both, invalue/outvalue and chnget/chnset for
> >> >>> the communication between csoundqt and the widget panel?
> >> >>> cheers -
> >> >>>        joachim
> >> >>>
> >> >>>
> >> >>> Am 21.01.2012 20:49, schrieb joachim heintz:
> >> >>>> hi andrés -
> >> >>>>
> >> >>>> sounds interesting. can you describe a little bit more in detail?
> >> >>>> what
> >> >>>> has been the problem with chnget/chnset? what are the advantages in
> >> >>>> performance using chnget/chnset compared with invalue/outvalue now?
> >> >>>>
> >> >>>> thanks -
> >> >>>>
> >> >>>>       joachim
> >> >>>>
> >> >>>>
> >> >>>> Am 21.01.2012 17:28, schrieb Andres Cabrera:
> >> >>>>> Hi all,
> >> >>>>>
> >> >>>>> I've just committed a fix for the chnset/chnget opcodes. I think
> >> >>>>> this
> >> >>>>> will be the recommended method to interact with widgets in the
> >> >>>>> future,
> >> >>>>> so please give it a try if you are building.
> >> >>>>>
> >> >>>>> Using chnget/chnset will significantly reduce CPU usage, especially
> >> >>>>> with a larger number of widgets.
> >> >>>>>
> >> >>>>> Cheers,
> >> >>>>> Andres
> >> >>>>>
> >> >>>>>
> >> >>>>> ------------------------------------------------------------------------------
> >> >>>>> Try before you buy = See our experts in action!
> >> >>>>> The most comprehensive online learning library for Microsoft
> >> >>>>> developers
> >> >>>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> >> >>>>> MVC3,
> >> >>>>> Metro Style Apps, more. Free future releases when you subscribe now!
> >> >>>>> http://p.sf.net/sfu/learndevnow-dev2
> >> >>>>> _______________________________________________
> >> >>>>> Qutecsound-users mailing list
> >> >>>>> [hidden email]
> >> >>>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >> >>>>>
> >> >>>>
> >> >>>>
> >> >>>> ------------------------------------------------------------------------------
> >> >>>> Try before you buy = See our experts in action!
> >> >>>> The most comprehensive online learning library for Microsoft
> >> >>>> developers
> >> >>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> >> >>>> MVC3,
> >> >>>> Metro Style Apps, more. Free future releases when you subscribe now!
> >> >>>> http://p.sf.net/sfu/learndevnow-dev2
> >> >>>> _______________________________________________
> >> >>>> Qutecsound-users mailing list
> >> >>>> [hidden email]
> >> >>>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >> >>>
> >> >>>
> >> >>> ------------------------------------------------------------------------------
> >> >>> Try before you buy = See our experts in action!
> >> >>> The most comprehensive online learning library for Microsoft
> >> >>> developers
> >> >>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> >> >>> MVC3,
> >> >>> Metro Style Apps, more. Free future releases when you subscribe now!
> >> >>> http://p.sf.net/sfu/learndevnow-dev2
> >> >>> _______________________________________________
> >> >>> Qutecsound-users mailing list
> >> >>> [hidden email]
> >> >>> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >> >>
> >> >>
> >> >> ------------------------------------------------------------------------------
> >> >> Try before you buy = See our experts in action!
> >> >> The most comprehensive online learning library for Microsoft developers
> >> >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> >> >> MVC3,
> >> >> Metro Style Apps, more. Free future releases when you subscribe now!
> >> >> http://p.sf.net/sfu/learndevnow-dev2
> >> >> _______________________________________________
> >> >> Qutecsound-users mailing list
> >> >> [hidden email]
> >> >> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >> >
> >> >
> >> > ------------------------------------------------------------------------------
> >> > Try before you buy = See our experts in action!
> >> > The most comprehensive online learning library for Microsoft developers
> >> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> >> > Metro Style Apps, more. Free future releases when you subscribe now!
> >> > http://p.sf.net/sfu/learndevnow-dev2
> >> > _______________________________________________
> >> > Qutecsound-users mailing list
> >> > [hidden email]
> >> > https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Try before you buy = See our experts in action!
> >> The most comprehensive online learning library for Microsoft developers
> >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> >> Metro Style Apps, more. Free future releases when you subscribe now!
> >> http://p.sf.net/sfu/learndevnow-dev2
> >> _______________________________________________
> >> Qutecsound-users mailing list
> >> [hidden email]
> >> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Keep Your Developer Skills Current with LearnDevNow!
> > The most comprehensive online learning library for Microsoft developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-d2d
> > _______________________________________________
> > Qutecsound-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/qutecsound-users
> >
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Qutecsound-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qutecsound-users
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users

widget-test_with_ch_k.csd (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Andres Cabrera
Administrator
Hi Tarmo,

On Thu, Jan 26, 2012 at 1:50 PM, Tarmo Johannes <[hidden email]> wrote:
> Thank you, Andrés,
>
> I repaced the '-' sine in the widgets and channels and now it works.
> I did not notice any big difference in cpu usage - if all the widgets are active, the cpu usage is around 42% with the new chnget version and it is about the same with old invalue version (with the same and also with an older version of CsoudnQt binary).

Interesting. There was a massive change in CPU usage on my system, but
I guess it might not apply to others then. I was using a higher number
of channels (about 50 control channels), and since things will get
worse with invalue as the number of channels increase, maybe only the
csds with many channels will see a difference. I guess polyphonic
instruments will also see an improvement, since each note of the csd
file will generate a lock when you use invalue/outvalue.

The downside of the chnset/chnget mechanism is that the change in
values is sparser, meaning that you will be more likely to need
smoothing for the values from the widgets. I'm interested to see if
this is being a problem for people, as I've gone for the most
efficient option (where the realtime thread tries to lock, and if it
can't it will not update the values, which results in some
intermediate values in a widget movement being discarded).

>
> Most of the load is caused by the group of 4 scrollnumbers. I don't know but it might be aslo a problem of Qt, not CsoundQt.

Is the load being generated by the widgets themselves, i.e. if you
take out the invalue/outvalue opcodes is the CPU usage still hig?
(this would mean that something in the widget could be done better,
scrollnumbers are actually custom widgets so maybe I'm not doing
things as efficiently as they could be)

>
> But anyway - I find this possibility wonderful - so it is possible to use either the widgets or software channels controlled by other instuments or the Csound API. I missed it very much in one application before and now it's there! Thank you, Andrés!

Yes, this was actually an old request...

Cheers,
Andrés

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] Chnget/Chnset fixed

Tarmo Johannes
Hi Andrés,

Yes, I tested it before, it is the scrollnumber widget that uses a lot of cpu.
Pushbuttons behave in muc much more economic way.


I did another test and I can confirm your results -

I created 100 sliders (with my changed createNewSlider method :) )
and made them move by jspline values (csd below).

I had to make the ksmps value really big - 2048 - to avoid xruns
with invalue CsoundQt took  around 30% of cpu
with chnget 20% or less.

greetings,
tarmo

------------

<CsoundSynthesizer>
<CsOptions>
;-n -d  
</CsOptions>
<CsInstruments>

; run in scratchpad:
;for row in range(0,5):
;    for col in range(0,20):
;        nr=row*20+col
;        q.createNewSlider(10+col*30,10+row*120,"slider"+str(nr))
;        q.insertText('chn_k "slider%d", 3\n' % nr) # put the cursor to the
point you want in in the score!
       

sr = 44100
ksmps = 2048
nchnls = 1



instr 1 ; start subinstruments
        icount=0
lp:
    event_i "i", "write", 0, p3, icount
        loop_lt icount, 1, 100, lp
       
endin


instr write; write to slider
        ino=p4 ; number of slider
        kval jspline 1, 0.1, 0.8
        Sslider sprintf "slider%d",ino
        chnset  kval, Sslider
endin



</CsInstruments>
<CsScore>

i 1 0 120
e
</CsScore>
</CsoundSynthesizer>






--------------


On Thursday 26 January 2012 17:36:38 Andres Cabrera wrote:
> Hi Tarmo,
>
> On Thu, Jan 26, 2012 at 1:50 PM, Tarmo Johannes <[hidden email]>
wrote:

> > Thank you, Andrés,
> >
> > I repaced the '-' sine in the widgets and channels and now it works.
> > I did not notice any big difference in cpu usage - if all the widgets
> > are active, the cpu usage is around 42% with the new chnget version and
> > it is about the same with old invalue version (with the same and also
> > with an older version of CsoudnQt binary).
> Interesting. There was a massive change in CPU usage on my system, but
> I guess it might not apply to others then. I was using a higher number
> of channels (about 50 control channels), and since things will get
> worse with invalue as the number of channels increase, maybe only the
> csds with many channels will see a difference. I guess polyphonic
> instruments will also see an improvement, since each note of the csd
> file will generate a lock when you use invalue/outvalue.
>
> The downside of the chnset/chnget mechanism is that the change in
> values is sparser, meaning that you will be more likely to need
> smoothing for the values from the widgets. I'm interested to see if
> this is being a problem for people, as I've gone for the most
> efficient option (where the realtime thread tries to lock, and if it
> can't it will not update the values, which results in some
> intermediate values in a widget movement being discarded).
>
> > Most of the load is caused by the group of 4 scrollnumbers. I don't know
> > but it might be aslo a problem of Qt, not CsoundQt.
> Is the load being generated by the widgets themselves, i.e. if you
> take out the invalue/outvalue opcodes is the CPU usage still hig?
> (this would mean that something in the widget could be done better,
> scrollnumbers are actually custom widgets so maybe I'm not doing
> things as efficiently as they could be)
>
> > But anyway - I find this possibility wonderful - so it is possible to
> > use either the widgets or software channels controlled by other
> > instuments or the Csound API. I missed it very much in one application
> > before and now it's there! Thank you, Andrés!
> Yes, this was actually an old request...
>
> Cheers,
> Andrés
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users

widget-test-simple.csd (57K) Download Attachment