Csound Csound-dev Csound-tekno Search About

[Csnd-dev] CsoundPerformanceThread->Record does not work any more

Date2021-07-16 19:28
FromTarmo Johannes
Subject[Csnd-dev] CsoundPerformanceThread->Record does not work any more
AttachmentscsPerfThreadExample.cpp  
Hi!

As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:

https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0

I add a  c++ file for testing (and paste the code  below for any case).

Before that commit recording worked as expected, after that the result is a 44-byte file or so.

Please check if you get the same result and this is a bug?

Thanks!
tarmo

-----

// compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux


#include <stdio.h>
#include <csound/csound.hpp>
#include <string>
#include <csound/csPerfThread.hpp>

int main()
{
std::string orc = "sr=44100\n\
ksmps=32\n\
nchnls=2\n\
0dbfs=1\n\
\n\
instr 1\n\
aout vco2 0.5, 440\n\
outs aout, aout\n\
endin";


std::string sco = "i1 0 1";

//create an instance of Csound
Csound* csound = new Csound();
//set CsOptions
csound->SetOption("-odac");

//compile orc
csound->CompileOrc(orc.c_str());

//compile sco
csound->ReadScore(sco.c_str());

//prepare Csound for performance
csound->Start();

//set up CsoundPerfThread object
CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound);

//start Csound performance
perfThread->Play();
perfThread->Record("perf-recording.wav");

//keep the application running while performance is ongoing
while(perfThread->GetStatus() == 0);
perfThread->StopRecord();
perfThread->Stop();
perfThread->Join();
                       
//free Csound and thread objects
delete csound;
delete perfThread;

return 0;
}

// works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14


---


Date2021-07-16 19:52
FromVictor Lazzarini
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] CsoundPerformanceThread->Record does not work any more
Can you open an issue?

Prof. Victor Lazzarini
Maynooth University
Ireland

On Jul 16, 2021, at 7:28 PM, Tarmo Johannes <trmjhnns@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hi!

As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:

https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0

I add a  c++ file for testing (and paste the code  below for any case).

Before that commit recording worked as expected, after that the result is a 44-byte file or so.

Please check if you get the same result and this is a bug?

Thanks!
tarmo

-----

// compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux


#include <stdio.h>
#include <csound/csound.hpp>
#include <string>
#include <csound/csPerfThread.hpp>

int main()
{
std::string orc = "sr=44100\n\
ksmps=32\n\
nchnls=2\n\
0dbfs=1\n\
\n\
instr 1\n\
aout vco2 0.5, 440\n\
outs aout, aout\n\
endin";


std::string sco = "i1 0 1";

//create an instance of Csound
Csound* csound = new Csound();
//set CsOptions
csound->SetOption("-odac");

//compile orc
csound->CompileOrc(orc.c_str());

//compile sco
csound->ReadScore(sco.c_str());

//prepare Csound for performance
csound->Start();

//set up CsoundPerfThread object
CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound);

//start Csound performance
perfThread->Play();
perfThread->Record("perf-recording.wav");

//keep the application running while performance is ongoing
while(perfThread->GetStatus() == 0);
perfThread->StopRecord();
perfThread->Stop();
perfThread->Join();
                       
//free Csound and thread objects
delete csound;
delete perfThread;

return 0;
}

// works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14


---

<csPerfThreadExample.cpp>

Date2021-07-17 10:12
FromVictor Lazzarini
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] CsoundPerformanceThread->Record does not work any more
A 6.16.2 hotfix release with Windows and MacOS packages has been put out now to deal with this bug. 
I have reverted the code and tested on MacOS.

I am opening an issue so we can provide a better fix on develop.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Jul 2021, at 19:28, Tarmo Johannes  wrote:
> 
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Hi!
> 
> As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:
> 
> https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0
> 
> I add a  c++ file for testing (and paste the code  below for any case).
> 
> Before that commit recording worked as expected, after that the result is a 44-byte file or so.
> 
> Please check if you get the same result and this is a bug?
> 
> Thanks!
> tarmo
> 
> -----
> 
> // compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux
> 
> 
> #include 
> #include 
> #include 
> #include 
> 
> int main()
> {
> std::string orc = "sr=44100\n\
> ksmps=32\n\
> nchnls=2\n\
> 0dbfs=1\n\
> \n\
> instr 1\n\
> aout vco2 0.5, 440\n\
> outs aout, aout\n\
> endin";
> 
> 
> std::string sco = "i1 0 1"; 
> 
> //create an instance of Csound
> Csound* csound = new Csound();
> //set CsOptions
> csound->SetOption("-odac");
> 
> //compile orc
> csound->CompileOrc(orc.c_str());
> 
> //compile sco
> csound->ReadScore(sco.c_str());
> 
> //prepare Csound for performance
> csound->Start();
> 
> //set up CsoundPerfThread object 
> CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound); 
> 
> //start Csound performance
> perfThread->Play();
> perfThread->Record("perf-recording.wav");
> 
> //keep the application running while performance is ongoing
> while(perfThread->GetStatus() == 0);
> perfThread->StopRecord();
> perfThread->Stop();
> perfThread->Join();
>                         
> //free Csound and thread objects
> delete csound;
> delete perfThread;
> 
> return 0;
> }
> 
> // works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14
> 
> 
> ---
> 
> 

Date2021-07-17 11:25
FromTarmo Johannes
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] CsoundPerformanceThread->Record does not work any more
Splendid!

Thanks for this, Victor! I can can confirm that with Csound 6.26.2 recording works again in CsoundQt.
And sorry for being slow opening the ticket myself...

Best!
tarmo

L, 17. juuli 2021 12:12 Victor Lazzarini <Victor.Lazzarini@mu.ie> kirjutas:
A 6.16.2 hotfix release with Windows and MacOS packages has been put out now to deal with this bug.
I have reverted the code and tested on MacOS.

I am opening an issue so we can provide a better fix on develop.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Jul 2021, at 19:28, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Hi!
>
> As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:
>
> https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0
>
> I add a  c++ file for testing (and paste the code  below for any case).
>
> Before that commit recording worked as expected, after that the result is a 44-byte file or so.
>
> Please check if you get the same result and this is a bug?
>
> Thanks!
> tarmo
>
> -----
>
> // compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux
>
>
> #include <stdio.h>
> #include <csound/csound.hpp>
> #include <string>
> #include <csound/csPerfThread.hpp>
>
> int main()
> {
> std::string orc = "sr=44100\n\
> ksmps=32\n\
> nchnls=2\n\
> 0dbfs=1\n\
> \n\
> instr 1\n\
> aout vco2 0.5, 440\n\
> outs aout, aout\n\
> endin";
>
>
> std::string sco = "i1 0 1";
>
> //create an instance of Csound
> Csound* csound = new Csound();
> //set CsOptions
> csound->SetOption("-odac");
>
> //compile orc
> csound->CompileOrc(orc.c_str());
>
> //compile sco
> csound->ReadScore(sco.c_str());
>
> //prepare Csound for performance
> csound->Start();
>
> //set up CsoundPerfThread object
> CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound);
>
> //start Csound performance
> perfThread->Play();
> perfThread->Record("perf-recording.wav");
>
> //keep the application running while performance is ongoing
> while(perfThread->GetStatus() == 0);
> perfThread->StopRecord();
> perfThread->Stop();
> perfThread->Join();
>                         
> //free Csound and thread objects
> delete csound;
> delete perfThread;
>
> return 0;
> }
>
> // works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14
>
>
> ---
>
> <csPerfThreadExample.cpp>

Date2021-07-17 14:04
FromVictor Lazzarini
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] CsoundPerformanceThread->Record does not work any more
I'm glad that's fixed

Prof. Victor Lazzarini
Maynooth University
Ireland

On Jul 17, 2021, at 11:25 AM, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Splendid!

Thanks for this, Victor! I can can confirm that with Csound 6.26.2 recording works again in CsoundQt.
And sorry for being slow opening the ticket myself...

Best!
tarmo

L, 17. juuli 2021 12:12 Victor Lazzarini <Victor.Lazzarini@mu.ie> kirjutas:
A 6.16.2 hotfix release with Windows and MacOS packages has been put out now to deal with this bug.
I have reverted the code and tested on MacOS.

I am opening an issue so we can provide a better fix on develop.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Jul 2021, at 19:28, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Hi!
>
> As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:
>
> https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0
>
> I add a  c++ file for testing (and paste the code  below for any case).
>
> Before that commit recording worked as expected, after that the result is a 44-byte file or so.
>
> Please check if you get the same result and this is a bug?
>
> Thanks!
> tarmo
>
> -----
>
> // compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux
>
>
> #include <stdio.h>
> #include <csound/csound.hpp>
> #include <string>
> #include <csound/csPerfThread.hpp>
>
> int main()
> {
> std::string orc = "sr=44100\n\
> ksmps=32\n\
> nchnls=2\n\
> 0dbfs=1\n\
> \n\
> instr 1\n\
> aout vco2 0.5, 440\n\
> outs aout, aout\n\
> endin";
>
>
> std::string sco = "i1 0 1";
>
> //create an instance of Csound
> Csound* csound = new Csound();
> //set CsOptions
> csound->SetOption("-odac");
>
> //compile orc
> csound->CompileOrc(orc.c_str());
>
> //compile sco
> csound->ReadScore(sco.c_str());
>
> //prepare Csound for performance
> csound->Start();
>
> //set up CsoundPerfThread object
> CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound);
>
> //start Csound performance
> perfThread->Play();
> perfThread->Record("perf-recording.wav");
>
> //keep the application running while performance is ongoing
> while(perfThread->GetStatus() == 0);
> perfThread->StopRecord();
> perfThread->Stop();
> perfThread->Join();
>                         
> //free Csound and thread objects
> delete csound;
> delete perfThread;
>
> return 0;
> }
>
> // works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14
>
>
> ---
>
> <csPerfThreadExample.cpp>

Date2021-07-17 16:22
From"Dr. Richard Boulanger"
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] CsoundPerformanceThread->Record does not work any more
Thank you both so very very much.  And thanks to Eduardo for his advice as well.

- dB


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Sat, Jul 17, 2021 at 9:04 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I'm glad that's fixed

Prof. Victor Lazzarini
Maynooth University
Ireland

On Jul 17, 2021, at 11:25 AM, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Splendid!

Thanks for this, Victor! I can can confirm that with Csound 6.26.2 recording works again in CsoundQt.
And sorry for being slow opening the ticket myself...

Best!
tarmo

L, 17. juuli 2021 12:12 Victor Lazzarini < Victor.Lazzarini@mu.ie> kirjutas:
A 6.16.2 hotfix release with Windows and MacOS packages has been put out now to deal with this bug.
I have reverted the code and tested on MacOS.

I am opening an issue so we can provide a better fix on develop.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Jul 2021, at 19:28, Tarmo Johannes < trmjhnns@GMAIL.COM> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Hi!
>
> As it came out debugging one issue by CsoundQt (that recording does not work any more with Csoun 6.16), seems that there is something in this commit that broke it:
>
> https://github.com/csound/csound/commit/8ac630138219865fd452b8eaa44463f50d78dab2#diff-1de40d48e3a3126003edbb255f00e1662f7b314d517c5f446222b91ca2c830c0
>
> I add a  c++ file for testing (and paste the code  below for any case).
>
> Before that commit recording worked as expected, after that the result is a 44-byte file or so.
>
> Please check if you get the same result and this is a bug?
>
> Thanks!
> tarmo
>
> -----
>
> // compile as: g++ -o perfThreadExample csPerfThreadExample.cpp -lcsound64 -lcsnd6 on Linux
>
>
> #include <stdio.h>
> #include <csound/csound.hpp>
> #include <string>
> #include <csound/csPerfThread.hpp>
>
> int main()
> {
> std::string orc = "sr=44100\n\
> ksmps=32\n\
> nchnls=2\n\
> 0dbfs=1\n\
> \n\
> instr 1\n\
> aout vco2 0.5, 440\n\
> outs aout, aout\n\
> endin";
>
>
> std::string sco = "i1 0 1";
>
> //create an instance of Csound
> Csound* csound = new Csound();
> //set CsOptions
> csound->SetOption("-odac");
>
> //compile orc
> csound->CompileOrc(orc.c_str());
>
> //compile sco
> csound->ReadScore(sco.c_str());
>
> //prepare Csound for performance
> csound->Start();
>
> //set up CsoundPerfThread object
> CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound);
>
> //start Csound performance
> perfThread->Play();
> perfThread->Record("perf-recording.wav");
>
> //keep the application running while performance is ongoing
> while(perfThread->GetStatus() == 0);
> perfThread->StopRecord();
> perfThread->Stop();
> perfThread->Join();
>                         
> //free Csound and thread objects
> delete csound;
> delete perfThread;
>
> return 0;
> }
>
> // works before  git commit 8ac630138219865fd452b8eaa44463f50d78dab2: Merge pull request #1269 from iskunk/vg-fix-14
>
>
> ---
>
> <csPerfThreadExample.cpp>