Csound Csound-dev Csound-tekno Search About

[Cs-dev] faster fout

Date2012-08-08 17:03
FromTito Latini
Subject[Cs-dev] faster fout
AttachmentsNone  

Date2012-08-08 17:20
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] faster fout
Sounds good

]
> lisp is idle for some minutes and I have the code for an efficient `fout'.
> With the current version we have `kr' sf-write-calls in 1 second.
>
> Here I use the follow value for the buffer size:
>
>   (int(512 / ksmps) + 1) * ksmps * fout_channels
>
> if ksmps < 512, and
>
>   ksmps * fout_channels
>
> if ksmps >= 512.
>
> sf_write is called when there are at least 512*fout_channels samples in
> the buffer, if ksmps < 512, or ksmps*fout_channels samples if ksmps >=
> 512.
>
> In this way we have max `sr/512' sf-write-calls in 1 second.
> With sr=44100, ceiling(sr/512) = 87.
>
> Added also `fout_flush_callback' to write the possible not empty buffer at
> the end of the instance.
>
> If you think that it is good, I'll also change `foutk' and git-push
> tomorrow.
>
> tito
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-08 17:25
FromSteven Yi
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  None  
Question: Is this code applicable for when Csound is non-realtime and rendering to file?  It would be good if this is generalized and used where applicable.  It would then be easier to update all with same code should the writing be done asynchronously.

Otherwise, fantastic Tito!

steven

On Wed, Aug 8, 2012 at 12:20 PM, <jpff@cs.bath.ac.uk> wrote:
Sounds good

]
> lisp is idle for some minutes and I have the code for an efficient `fout'.
> With the current version we have `kr' sf-write-calls in 1 second.
>
> Here I use the follow value for the buffer size:
>
>   (int(512 / ksmps) + 1) * ksmps * fout_channels
>
> if ksmps < 512, and
>
>   ksmps * fout_channels
>
> if ksmps >= 512.
>
> sf_write is called when there are at least 512*fout_channels samples in
> the buffer, if ksmps < 512, or ksmps*fout_channels samples if ksmps >=
> 512.
>
> In this way we have max `sr/512' sf-write-calls in 1 second.
> With sr=44100, ceiling(sr/512) = 87.
>
> Added also `fout_flush_callback' to write the possible not empty buffer at
> the end of the instance.
>
> If you think that it is good, I'll also change `foutk' and git-push
> tomorrow.
>
> tito
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2012-08-08 17:41
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  

Date2012-08-08 20:18
FromRory Walsh
SubjectRe: [Cs-dev] faster fout
Great. What file is it in? I don't want to do a full checkout of the
code as I have my current version of Csound running just toasty.

On 8 August 2012 18:41, Tito Latini  wrote:
> Of course, it is good also in curved time :)
>
> On Wed, Aug 08, 2012 at 12:25:00PM -0400, Steven Yi wrote:
>> Question: Is this code applicable for when Csound is non-realtime and
>> rendering to file?  It would be good if this is generalized and used where
>> applicable.  It would then be easier to update all with same code should
>> the writing be done asynchronously.
>>
>> Otherwise, fantastic Tito!
>>
>> steven
>>
>> On Wed, Aug 8, 2012 at 12:20 PM,  wrote:
>>
>> > Sounds good
>> >
>> > ]
>> > > lisp is idle for some minutes and I have the code for an efficient
>> > `fout'.
>> > > With the current version we have `kr' sf-write-calls in 1 second.
>> > >
>> > > Here I use the follow value for the buffer size:
>> > >
>> > >   (int(512 / ksmps) + 1) * ksmps * fout_channels
>> > >
>> > > if ksmps < 512, and
>> > >
>> > >   ksmps * fout_channels
>> > >
>> > > if ksmps >= 512.
>> > >
>> > > sf_write is called when there are at least 512*fout_channels samples in
>> > > the buffer, if ksmps < 512, or ksmps*fout_channels samples if ksmps >=
>> > > 512.
>> > >
>> > > In this way we have max `sr/512' sf-write-calls in 1 second.
>> > > With sr=44100, ceiling(sr/512) = 87.
>> > >
>> > > Added also `fout_flush_callback' to write the possible not empty buffer
>> > at
>> > > the end of the instance.
>> > >
>> > > If you think that it is good, I'll also change `foutk' and git-push
>> > > tomorrow.
>> > >
>> > > tito
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-08 20:55
FromJustin Smith
SubjectRe: [Cs-dev] faster fout
here are awesome things you can do with git:

git branch local-awesome # this creates a snapshot of the code as it
exists right now
git pull origin master # this synchs your local master up with upstream master
git checkout local-awesome # this switches everything back to the
state where you took the snapshot (undo by doing git checkout master)
git diff master # displays all differences between current branch and
the master branch, file by file
git checkout master  # grabs the upstream version of that file
into your branch
and finally:
git merge master # merge upstream changes with your
not-commited-to-master branch changes

I usually have a few active branches in my local repo for projects I
am active in, and I also find it helpful to push a branch to an
upstream branch so another dev can look at or test the code without
having to commit to the main branch just yet.

maybe you knew all this already, but between this and another email in
a different thread about not wanting to mix up two different
modifications in a local repo, I figured it may be helpful to remind
people about how awesome branches are when you are juggling a few
parallel changes


On Wed, Aug 8, 2012 at 12:18 PM, Rory Walsh  wrote:
> Great. What file is it in? I don't want to do a full checkout of the
> code as I have my current version of Csound running just toasty.
>
> On 8 August 2012 18:41, Tito Latini  wrote:
>> Of course, it is good also in curved time :)
>>
>> On Wed, Aug 08, 2012 at 12:25:00PM -0400, Steven Yi wrote:
>>> Question: Is this code applicable for when Csound is non-realtime and
>>> rendering to file?  It would be good if this is generalized and used where
>>> applicable.  It would then be easier to update all with same code should
>>> the writing be done asynchronously.
>>>
>>> Otherwise, fantastic Tito!
>>>
>>> steven
>>>
>>> On Wed, Aug 8, 2012 at 12:20 PM,  wrote:
>>>
>>> > Sounds good
>>> >
>>> > ]
>>> > > lisp is idle for some minutes and I have the code for an efficient
>>> > `fout'.
>>> > > With the current version we have `kr' sf-write-calls in 1 second.
>>> > >
>>> > > Here I use the follow value for the buffer size:
>>> > >
>>> > >   (int(512 / ksmps) + 1) * ksmps * fout_channels
>>> > >
>>> > > if ksmps < 512, and
>>> > >
>>> > >   ksmps * fout_channels
>>> > >
>>> > > if ksmps >= 512.
>>> > >
>>> > > sf_write is called when there are at least 512*fout_channels samples in
>>> > > the buffer, if ksmps < 512, or ksmps*fout_channels samples if ksmps >=
>>> > > 512.
>>> > >
>>> > > In this way we have max `sr/512' sf-write-calls in 1 second.
>>> > > With sr=44100, ceiling(sr/512) = 87.
>>> > >
>>> > > Added also `fout_flush_callback' to write the possible not empty buffer
>>> > at
>>> > > the end of the instance.
>>> > >
>>> > > If you think that it is good, I'll also change `foutk' and git-push
>>> > > tomorrow.
>>> > >
>>> > > tito
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-08 22:08
FromRory Walsh
SubjectRe: [Cs-dev] faster fout
To be honest I had no idea. Thanks for the info!

Rory.



On 8 August 2012 21:55, Justin Smith  wrote:
> here are awesome things you can do with git:
>
> git branch local-awesome # this creates a snapshot of the code as it
> exists right now
> git pull origin master # this synchs your local master up with upstream master
> git checkout local-awesome # this switches everything back to the
> state where you took the snapshot (undo by doing git checkout master)
> git diff master # displays all differences between current branch and
> the master branch, file by file
> git checkout master  # grabs the upstream version of that file
> into your branch
> and finally:
> git merge master # merge upstream changes with your
> not-commited-to-master branch changes
>
> I usually have a few active branches in my local repo for projects I
> am active in, and I also find it helpful to push a branch to an
> upstream branch so another dev can look at or test the code without
> having to commit to the main branch just yet.
>
> maybe you knew all this already, but between this and another email in
> a different thread about not wanting to mix up two different
> modifications in a local repo, I figured it may be helpful to remind
> people about how awesome branches are when you are juggling a few
> parallel changes
>
>
> On Wed, Aug 8, 2012 at 12:18 PM, Rory Walsh  wrote:
>> Great. What file is it in? I don't want to do a full checkout of the
>> code as I have my current version of Csound running just toasty.
>>
>> On 8 August 2012 18:41, Tito Latini  wrote:
>>> Of course, it is good also in curved time :)
>>>
>>> On Wed, Aug 08, 2012 at 12:25:00PM -0400, Steven Yi wrote:
>>>> Question: Is this code applicable for when Csound is non-realtime and
>>>> rendering to file?  It would be good if this is generalized and used where
>>>> applicable.  It would then be easier to update all with same code should
>>>> the writing be done asynchronously.
>>>>
>>>> Otherwise, fantastic Tito!
>>>>
>>>> steven
>>>>
>>>> On Wed, Aug 8, 2012 at 12:20 PM,  wrote:
>>>>
>>>> > Sounds good
>>>> >
>>>> > ]
>>>> > > lisp is idle for some minutes and I have the code for an efficient
>>>> > `fout'.
>>>> > > With the current version we have `kr' sf-write-calls in 1 second.
>>>> > >
>>>> > > Here I use the follow value for the buffer size:
>>>> > >
>>>> > >   (int(512 / ksmps) + 1) * ksmps * fout_channels
>>>> > >
>>>> > > if ksmps < 512, and
>>>> > >
>>>> > >   ksmps * fout_channels
>>>> > >
>>>> > > if ksmps >= 512.
>>>> > >
>>>> > > sf_write is called when there are at least 512*fout_channels samples in
>>>> > > the buffer, if ksmps < 512, or ksmps*fout_channels samples if ksmps >=
>>>> > > 512.
>>>> > >
>>>> > > In this way we have max `sr/512' sf-write-calls in 1 second.
>>>> > > With sr=44100, ceiling(sr/512) = 87.
>>>> > >
>>>> > > Added also `fout_flush_callback' to write the possible not empty buffer
>>>> > at
>>>> > > the end of the instance.
>>>> > >
>>>> > > If you think that it is good, I'll also change `foutk' and git-push
>>>> > > tomorrow.
>>>> > >
>>>> > > tito
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-08 22:54
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  

Date2012-08-09 07:42
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  

Date2012-08-09 07:46
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  None  fout_fast.patch  None  None  

Date2012-08-09 10:17
FromRory Walsh
SubjectRe: [Cs-dev] faster fout
Great thanks Tito. One other question. Is it possible to build fout as
a plugin lib using fout.c and fout.h? Or would it conflict with
existing versions of the opcode? Turns out I don't actually build
Csound for this windows machine! But if I could just build a .dll that
would be handy. Thanks.

On 9 August 2012 08:46, Tito Latini  wrote:
> attached the patch (the prior message was faster)
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-09 11:28
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone  

Date2012-08-09 11:47
FromTito Latini
SubjectRe: [Cs-dev] faster fout
AttachmentsNone