Csound Csound-dev Csound-tekno Search About

[Csnd] mp3s and Csound

Date2020-08-29 03:45
FromDavid Bellows
Subject[Csnd] mp3s and Csound
I saw that back with Csound 6.14 preliminary support for creating mp3
files was added to Csound. I didn't install that version of Csound but
today I did install 6.15 (building from source for Ubuntu) and tried
the example code:




ksmps = 1000

instr 1
  aa diskin "piano.wav", 1
  mp3out  aa,aa,"test.mp3"
  endin



i1 0 3
e




When I run it, "csound mp3.csd", I get the following error:

error: syntax error, unexpected T_IDENT  (token "aa") from file mp3.csd (1)
 line 8:
>>>  mp3out  aa <<<
Unexpected untyped word mp3out when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra

I don't know exactly what this means but hopefully someone here does.

Also, are their plans to add this mp3 out support to the command line
like with the other audio output formats?

Thanks everyone!

Dave Bellows

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-08-29 04:50
FromPete Goodeve
SubjectRe: [Csnd] mp3s and Csound
AttachmentsNone  

Date2020-08-29 20:51
FromDavid Bellows
SubjectRe: [Csnd] mp3s and Csound
Hi Pete,

> Use 'csound -z' to see if the opcode is actually there.
I suspect not.

You are correct, it's not there.

> It won't get built if you don't have the lame develop kit.  apt-get should
solve that.

Ok, I installed both libtwolame-dev and libmp3lame-dev and it's still
not working with the same error message.

I notice that when running cmake ../csound I get the following:
searching for lame.h
not found

Running "locate lame.h" gets the following:
/usr/include/twolame.h
/usr/include/lame/lame.h

So I'm not sure what's going on.

Thanks for your help on this.

On Fri, Aug 28, 2020 at 8:50 PM Pete Goodeve  wrote:
>
> On Fri, Aug 28, 2020 at 07:45:01PM -0700, David Bellows wrote:
> > I saw that back with Csound 6.14 preliminary support for creating mp3
> > files was added to Csound. I didn't install that version of Csound but
> > today I did install 6.15 (building from source for Ubuntu) and tried
> > the example code:
> > [....]
> >
> > When I run it, "csound mp3.csd", I get the following error:
> >
> > error: syntax error, unexpected T_IDENT  (token "aa") from file mp3.csd (1)
> >  line 8:
> > >>>  mp3out  aa <<<
> > Unexpected untyped word mp3out when expecting a variable
> > Parsing failed due to invalid input!
> > Stopping on parser failure
> > cannot compile orchestra
> >
> > I don't know exactly what this means but hopefully someone here does.
>
> This just means that the opcode isn't actually in your system, so it
> didn't recognize the name.
>
> Either it didn't get built, or you don't have the LAME library it needs
> on your machine.,  (Use 'csound -z' to see if the opcode is actually there.
> I suspect not.)
>
> It won't get built if you don't have the lame develop kit.  apt-get should
> solve that.
>
> Cheersw,
>
>         -- Pete --
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-08-29 21:18
Fromjohn
SubjectRe: [Csnd] mp3s and Csound
I think twolame is a dfferent entity.  I used lame.  On my system 
(OpenSuSE) I reqyuire libmp3lame.so
and the buid looks for

check_include_file(lame.h LAME_HEADER)
find_library(LAME_LIB mp3lame)

==John


On Sat, 29 Aug 2020, David Bellows wrote:

> Hi Pete,
>
>> Use 'csound -z' to see if the opcode is actually there.
> I suspect not.
>
> You are correct, it's not there.
>
>> It won't get built if you don't have the lame develop kit.  apt-get should
> solve that.
>
> Ok, I installed both libtwolame-dev and libmp3lame-dev and it's still
> not working with the same error message.
>
> I notice that when running cmake ../csound I get the following:
> searching for lame.h
> not found
>
> Running "locate lame.h" gets the following:
> /usr/include/twolame.h
> /usr/include/lame/lame.h
>
> So I'm not sure what's going on.
>
> Thanks for your help on this.
>
> On Fri, Aug 28, 2020 at 8:50 PM Pete Goodeve  wrote:
>>
>> On Fri, Aug 28, 2020 at 07:45:01PM -0700, David Bellows wrote:
>>> I saw that back with Csound 6.14 preliminary support for creating mp3
>>> files was added to Csound. I didn't install that version of Csound but
>>> today I did install 6.15 (building from source for Ubuntu) and tried
>>> the example code:
>>> [....]
>>>
>>> When I run it, "csound mp3.csd", I get the following error:
>>>
>>> error: syntax error, unexpected T_IDENT  (token "aa") from file mp3.csd (1)
>>>  line 8:
>>>>>>  mp3out  aa <<<
>>> Unexpected untyped word mp3out when expecting a variable
>>> Parsing failed due to invalid input!
>>> Stopping on parser failure
>>> cannot compile orchestra
>>>
>>> I don't know exactly what this means but hopefully someone here does.
>>
>> This just means that the opcode isn't actually in your system, so it
>> didn't recognize the name.
>>
>> Either it didn't get built, or you don't have the LAME library it needs
>> on your machine.,  (Use 'csound -z' to see if the opcode is actually there.
>> I suspect not.)
>>
>> It won't get built if you don't have the lame develop kit.  apt-get should
>> solve that.
>>
>> Cheersw,
>>
>>         -- Pete --
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-08-29 22:08
FromPete Goodeve
SubjectRe: [Csnd] mp3s and Csound
AttachmentsNone  

Date2020-08-30 02:05
FromDavid Bellows
SubjectRe: [Csnd] mp3s and Csound
> 've noticed that Cmake
doesn't actually start from scratch when you do a new build. It
may use decisions it made previously.  Try a fresh build directory.

Yeah, I couldn't figure out how to "make clean" anyway, so I was using
new build directories each time.

So oh well, I'm sure something'll come up eventually.

Thanks for your help!

On Sat, Aug 29, 2020 at 2:08 PM Pete Goodeve  wrote:
>
> On Sat, Aug 29, 2020 at 12:51:41PM -0700, David Bellows wrote:
> > Hi Pete,
> >
> > > Use 'csound -z' to see if the opcode is actually there.
> > I suspect not.
> >
> > You are correct, it's not there.
> >
> > > It won't get built if you don't have the lame develop kit.  apt-get should
> > solve that.
> >
> > Ok, I installed both libtwolame-dev and libmp3lame-dev and it's still
> > not working with the same error message.
> >
> > I notice that when running cmake ../csound I get the following:
> > searching for lame.h
> > not found
> >
> > Running "locate lame.h" gets the following:
> > /usr/include/twolame.h
> > /usr/include/lame/lame.h
> >
> > So I'm not sure what's going on.
> >
> > Thanks for your help on this.
> >
> I think this is about where any expertise I might have, ends... (:-))
> I think John is right, though, that 'twolame' is irrelevant.
> 'libmp3lame' is what you want, I think.  (I never got as far as
> building 6.14 on Linux, yet.)
>
> As a guess on why it's not working for you, I've noticed that Cmake
> doesn't actually start from scratch when you do a new build. It
> may use decisions it made previously.  Try a fresh build directory.
>
> Goo0d luck!
>
>         -- Pete --
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-08-30 03:49
FromPete Goodeve
SubjectRe: [Csnd] mp3s and Csound
AttachmentsNone  

Date2020-08-30 05:38
FromDavid Bellows
SubjectRe: [Csnd] mp3s and Csound
Hey Pete,

> I took a wild guess and linked that to .../include/lame.h.

> Cmake then easily found it, and libmp3out got compiled!

That's really good news! I'll do that first thing in the morning.

On Sat, Aug 29, 2020 at 7:49 PM Pete Goodeve  wrote:
>
> Solved it!  [For me, anyway]
>
> I decided I'd better get round to building 6.15 on my Mint system,
> and yep, I hit the same problem as you!
>
> Noting that, as you saw, the lame header is ...include/lame/lame.h,
> I took a wild guess and linked that to .../include/lame.h.
>
> Cmake then easily found it, and libmp3out got compiled!
>
> Not sure where the real mismatch is.  I assume that the header
> is always where it is on linux, so it's probably that the Cmake
> search is set up wrongly.  I'll leave that to the Cmake gurus, though.
>
>         -- Pete --
>
>
> On Sat, Aug 29, 2020 at 06:05:59PM -0700, David Bellows wrote:
> > > 've noticed that Cmake
> > doesn't actually start from scratch when you do a new build. It
> > may use decisions it made previously.  Try a fresh build directory.
> >
> > Yeah, I couldn't figure out how to "make clean" anyway, so I was using
> > new build directories each time.
> >
> > So oh well, I'm sure something'll come up eventually.
> >
> > Thanks for your help!
> >
> > On Sat, Aug 29, 2020 at 2:08 PM Pete Goodeve  wrote:
> > >
> > > On Sat, Aug 29, 2020 at 12:51:41PM -0700, David Bellows wrote:
> > > > Hi Pete,
> > > >
> > > > > Use 'csound -z' to see if the opcode is actually there.
> > > > I suspect not.
> > > >
> > > > You are correct, it's not there.
> > > >
> > > > > It won't get built if you don't have the lame develop kit.  apt-get should
> > > > solve that.
> > > >
> > > > Ok, I installed both libtwolame-dev and libmp3lame-dev and it's still
> > > > not working with the same error message.
> > > >
> > > > I notice that when running cmake ../csound I get the following:
> > > > searching for lame.h
> > > > not found
> > > >
> > > > Running "locate lame.h" gets the following:
> > > > /usr/include/twolame.h
> > > > /usr/include/lame/lame.h
> > > >
> > > > So I'm not sure what's going on.
> > > >
> > > > Thanks for your help on this.
> > > >
> > > I think this is about where any expertise I might have, ends... (:-))
> > > I think John is right, though, that 'twolame' is irrelevant.
> > > 'libmp3lame' is what you want, I think.  (I never got as far as
> > > building 6.14 on Linux, yet.)
> > >
> > > As a guess on why it's not working for you, I've noticed that Cmake
> > > doesn't actually start from scratch when you do a new build. It
> > > may use decisions it made previously.  Try a fresh build directory.
> > >
> > > Goo0d luck!
> > >
> > >         -- Pete --
> > >
> > > Csound mailing list
> > > Csound@listserv.heanet.ie
> > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > > Send bugs reports to
> > >         https://github.com/csound/csound/issues
> > > Discussions of bugs and features can be posted here
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-09-01 00:55
FromPete Goodeve
SubjectRe: [Csnd] mp3s and Csound
AttachmentsNone