[Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

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

[Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

PrentRodgers
I've been using Csound on Windows for decades, and I just recently switched to Ubuntu Linux.

I initially used Csound 6.4, and was successful. That's the version that Ubuntu distributes.

Today I built 6.11 from source. Now all my input files are failing with mismatch of sample files. loscil thinks they are mono, but in fact they are 24-bit stereo samples.

     instr 1: stereo loscil cannot read from mono ftable
I read them in with gen01:

f646 0 0 1 "samples/Bosendor/47 emp G3-.wav" 0 4 0

I suspect that the 4 in 0 4 0 tells gen01 to read  16-bit short integers, and gets confused by the 24-bit stereo sample file. Can I change that 4 to another number to tell gen01 that the sample files are 24-bit?

and play them with loscil

a3,a4 loscil 1, .228, 646, 24.498, 0  

It reports: "stereo loscil cannot read from mono ftable"

I know they are 24-bit samples, because sndinfo tells me they are:

csound -U sndinfo "samples/Bosendor/47 emp G3-.wav"
reports the following
 0dBFS level = 32768.0
 --Csound version 6.11 (double samples) Mar 31 2018
 [commit: 19078d1cacc3ad93a722287db2a4533d7114162e]
 libsndfile-1.0.25
 util sndinfo:
 samples/Bosendor/47 emp G3-.wav:
 srate 48000, stereo, 24 bit WAV, 19.152 seconds
(919296 sample frames)

What is strange is that the files worked perfectly on Ubuntu in csound 6.4, and only started to fail with csound 6.11 (I did not try all those in between).

Here's a limited test file:

<CsoundSynthesizer>
 
<CsOptions>
-o test.wav -W -G -m2 -3
</CsOptions>
 
<CsInstruments>
 sr = 44100
 ksmps = 2;
 nchnls = 2
 instr 1
  ;           amp
  ;           |  freqency
  ;           |  |     ifn - function table number
  ;           |  |     |    base frequency of sample
  ;           |  |     |    |       no looping
  ;           |  |     |    |       |
 a3,a4 loscil 1, .228, 646, 24.498, 0  
 
 outs a3, a4
 endin
 
</CsInstruments>
 
<CsScore>

;    time
;    | size
;    | | gen01
;    | | |  source soundfile name
;    | | |  |                                skiptime
;    | | |  |                                | format 4 = 16-bit short integers
;    | | |  |                                | | 0 read in all channels
f646 0 0 1 "samples/Bosendor/47 emp G3-.wav" 0 4 0
;
;  format information on the sample file:
;  csound -U sndinfo "samples/Bosendor/47 emp G3-.wav"
;  0dBFS level = 32768.0
;  --Csound version 6.11 (double samples) Mar 31 2018
;  [commit: 19078d1cacc3ad93a722287db2a4533d7114162e]
;  libsndfile-1.0.25
;  util sndinfo:
;  samples/Bosendor/47 emp G3-.wav:
; srate 48000, stereo, 24 bit WAV, 19.152 seconds
; (919296 sample frames)

i1 0 10


</CsScore>
</CsoundSynthesizer>

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

PrentRodgers
I noticed that csound reports that it reads the sample file as mono and RAW:

ftable 646:
deferred alloc for samples/Bosendor/47 emp G3-.wav
audio sr = 44100, monaural
opening RAW infile samples/Bosendor/47 emp G3-.wav
  defer length 1378972

I've tried all the gen01 parameters I could think of, but none seem to read it correctly any more.

From the gen01 manual page, here are the choices.  I don't see 24-bit stereo in the list.

1 - 8-bit signed character    4 - 16-bit short integers
2 - 8-bit A-law bytes         5 - 32-bit long integers
3 - 8-bit U-law bytes         6 - 32-bit floats

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

Victor Lazzarini-2
In reply to this post by PrentRodgers
Use 0 instead of 4 and it should work.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 31 Mar 2018, at 20:12, Prent Rodgers <[hidden email]> wrote:
>
> I've been using Csound on Windows for decades, and I just recently switched to Ubuntu Linux.
>
> I initially used Csound 6.4, and was successful. That's the version that Ubuntu distributes.
>
> Today I built 6.11 from source. Now all my input files are failing with mismatch of sample files. loscil thinks they are mono, but in fact they are 24-bit stereo samples.
>
>     instr 1: stereo loscil cannot read from mono ftable
> I read them in with gen01:
>
> f646 0 0 1 "samples/Bosendor/47 emp G3-.wav" 0 4 0
>
> I suspect that the 4 in 0 4 0 tells gen01 to read  16-bit short integers, and gets confused by the 24-bit stereo sample file. Can I change that 4 to another number to tell gen01 that the sample files are 24-bit?
>
> and play them with loscil
>
> a3,a4 loscil 1, .228, 646, 24.498, 0  
>
> It reports: "stereo loscil cannot read from mono ftable"
>
> I know they are 24-bit samples, because sndinfo tells me they are:
>
> csound -U sndinfo "samples/Bosendor/47 emp G3-.wav"
> reports the following
> 0dBFS level = 32768.0
> --Csound version 6.11 (double samples) Mar 31 2018
> [commit: 19078d1cacc3ad93a722287db2a4533d7114162e]
> libsndfile-1.0.25
> util sndinfo:
> samples/Bosendor/47 emp G3-.wav:
> srate 48000, stereo, 24 bit WAV, 19.152 seconds
> (919296 sample frames)
>
> What is strange is that the files worked perfectly on Ubuntu in csound 6.4, and only started to fail with csound 6.11 (I did not try all those in between).
>
> Here's a limited test file:
>
> <CsoundSynthesizer>
>
> <CsOptions>
> -o test.wav -W -G -m2 -3
> </CsOptions>
>
> <CsInstruments>
> sr = 44100
> ksmps = 2;
> nchnls = 2
> instr 1
>  ;           amp
>  ;           |  freqency
>  ;           |  |     ifn - function table number
>  ;           |  |     |    base frequency of sample
>  ;           |  |     |    |       no looping
>  ;           |  |     |    |       |
> a3,a4 loscil 1, .228, 646, 24.498, 0  
>
> outs a3, a4
> endin
>
> </CsInstruments>
>
> <CsScore>
>
> ;    time
> ;    | size
> ;    | | gen01
> ;    | | |  source soundfile name
> ;    | | |  |                                skiptime
> ;    | | |  |                                | format 4 = 16-bit short integers
> ;    | | |  |                                | | 0 read in all channels
> f646 0 0 1 "samples/Bosendor/47 emp G3-.wav" 0 4 0
> ;
> ;  format information on the sample file:
> ;  csound -U sndinfo "samples/Bosendor/47 emp G3-.wav"
> ;  0dBFS level = 32768.0
> ;  --Csound version 6.11 (double samples) Mar 31 2018
> ;  [commit: 19078d1cacc3ad93a722287db2a4533d7114162e]
> ;  libsndfile-1.0.25
> ;  util sndinfo:
> ;  samples/Bosendor/47 emp G3-.wav:
> ;    srate 48000, stereo, 24 bit WAV, 19.152 seconds
> ;    (919296 sample frames)
>
> i1 0 10
>
>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

jpff
In reply to this post by PrentRodgers
If you use format 0 it will read as wac and get the sample size correcty.
If you set a value in format it will assume you know what you are doing
and will open as raw -- which is rarely correct.

==John ff

On Sat, 31 Mar 2018, Prent Rodgers wrote:

> I noticed that csound reports that it reads the sample file as mono and RAW:
>
> ftable 646:
> deferred alloc for samples/Bosendor/47 emp G3-.wav
> audio sr = 44100, monaural
> opening RAW infile samples/Bosendor/47 emp G3-.wav
>  defer length 1378972
>
> I've tried all the gen01 parameters I could think of, but none seem to read it correctly any more.
>
> From the gen01 manual page, here are the choices.  I don't see 24-bit stereo in the list.
>
> 1 - 8-bit signed character    4 - 16-bit short integers
> 2 - 8-bit A-law bytes         5 - 32-bit long integers
> 3 - 8-bit U-law bytes         6 - 32-bit floats
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

jpff
BTW the latest code in github does not open the file twice;this area has
been subject to some rational reworking.

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

jpff
and moreover the number 8 gives24 bit integer samples and has fora lomg
time - the nanual was wrong in this respect.

1 - 8-bit signed character
2 - 8-bit A-law bytes
3 - 8-bit U-law bytes
4 - 16-bit short integers
5 - 32-bit long integers
6 - 32-bit floats
7 - 8-bit unsigned character
8 - 24-bit integers
9 - 64-bit doubles

BUTonly for RAW format files; others take the data from the header.

==John ff

PS I have just corrected the manual and will commit very soon

On Sat, 31 Mar 2018, jpff wrote:

> BTW the latest code in github does not open the file twice;this area has been
> subject to some rational reworking.
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

PrentRodgers
In reply to this post by PrentRodgers
Sucess! The suggestion to let Csound read the header of the sample file worked. A big thank you to Victor Lazzarini and John ff.

By the way, my latest collection of work I've done with csound is available for free listening and download here: http://ripnread.com/?p=1492 . There is a playlist there that should open in most browsers.

It was all made with csound and my preprocessor for working with complex sample libraries. All the pieces are realizations of compositions by the greats in piano music: Bach, Cage, Ravel, Gibbons, Mozart, and Chopin. I took some small liberty with some of the pieces, and major liberty with others. Most make heavy use of the Drunkard's Walk Markov Chain to make choices about a lot of the musical material. My favorite is a transformation of Ravel's Pièce en forme de Habanera, which I call Tango.

I invested in a commercial Bosendorfer sound library last year, and this one uses it exclusively. The first sample instrument I ever used was a Bosendorfer sample set that someone in the world of csound uploaded. They deleted it later for some reason. This sample library is very nice, with 6-7 different volume levels for 8 notes per octave, and a wide range.

The tuning is based on the Partch tonality diamond to the 31-limit, with 214 unique pitches per octave. I only use 12 per measure, so it just sounds a little strange. There are lots of slides and trills. I like to refer to the instrument as Prent's Microtonal Slide Bosendorfer, because is slide and trill as if it were a guitar.

Prent Rodgers
Snoqualmie Pass, WA

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] gen01 formats on Linux - what do I choose for 24 bit sample files

jpff
Just listened to four dances; went down well in this house.  We both loved it.  Hope to get time for the others later

Thank you for brightening my day.

==John ff

⁣Sent from TypeApp ​

On Apr 1, 2018, 00:34, at 00:34, Prent Rodgers <[hidden email]> wrote:

>Sucess! The suggestion to let Csound read the header of the sample file
>worked. A big thank you to Victor Lazzarini and John ff.
>
>By the way, my latest collection of work I've done with csound is
>available for free listening and download here:
>http://ripnread.com/?p=1492 . There is a playlist there that should
>open in most browsers.
>
>It was all made with csound and my preprocessor for working with
>complex sample libraries. All the pieces are realizations of
>compositions by the greats in piano music: Bach, Cage, Ravel, Gibbons,
>Mozart, and Chopin. I took some small liberty with some of the pieces,
>and major liberty with others. Most make heavy use of the Drunkard's
>Walk Markov Chain to make choices about a lot of the musical material.
>My favorite is a transformation of Ravel's Pièce en forme de Habanera,
>which I call Tango.
>
>I invested in a commercial Bosendorfer sound library last year, and
>this one uses it exclusively. The first sample instrument I ever used
>was a Bosendorfer sample set that someone in the world of csound
>uploaded. They deleted it later for some reason. This sample library is
>very nice, with 6-7 different volume levels for 8 notes per octave, and
>a wide range.
>
>The tuning is based on the Partch tonality diamond to the 31-limit,
>with 214 unique pitches per octave. I only use 12 per measure, so it
>just sounds a little strange. There are lots of slides and trills. I
>like to refer to the instrument as Prent's Microtonal Slide
>Bosendorfer, because is slide and trill as if it were a guitar.
>
>Prent Rodgers
>Snoqualmie Pass, WA
>
>Csound mailing list
>[hidden email]
>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
[hidden email]
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