Csound Csound-dev Csound-tekno Search About

[Csnd] Sample Formats of RAW files

Date2019-10-20 02:05
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Sample Formats of RAW files
Canonical Csound includes samples in RAW format. I need to put one of these samples, marmstk1.raw, into a GEN01 function, for which I need to know its file format. (I know that RAW files can readily be changed to WAV, which retrieves format info from the header, but I want to use the sample as is in the distribution.)

So, two questions:
1) how do you determine the format of a RAW sample? (The examples in the reference manual all use the WAV "equivalent.")
2) what might be the correct format designation for marmstk1.raw? (This file is an impulse response for a Cook/ffitch physical model for struck, pitched percussion.)

Or perhaps do all the RAW samples have the same format (unlikely), and if so which?
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

Date2019-10-20 03:45
FromMichael Gogins
SubjectRe: [Csnd] Sample Formats of RAW files
Raw files have no format. There is no header for the file. The entire file is just a sequence of samples. You need to know the format independently: number of channels, sample rate, sample size, byte order, everything. Start with mono, 16 bit, 44100 Hz, see how that sounds. Change things until it sounds right. 

Regards 
Mike

On Sat, Oct 19, 2019, 21:05 Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Canonical Csound includes samples in RAW format. I need to put one of these samples, marmstk1.raw, into a GEN01 function, for which I need to know its file format. (I know that RAW files can readily be changed to WAV, which retrieves format info from the header, but I want to use the sample as is in the distribution.)

So, two questions:
1) how do you determine the format of a RAW sample? (The examples in the reference manual all use the WAV "equivalent.")
2) what might be the correct format designation for marmstk1.raw? (This file is an impulse response for a Cook/ffitch physical model for struck, pitched percussion.)

Or perhaps do all the RAW samples have the same format (unlikely), and if so which?
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

Date2019-10-20 04:39
FromBenjamin Niemann
SubjectRe: [Csnd] Sample Formats of RAW files
Hi Arthur,

On Sun, Oct 20, 2019 at 3:05 AM Arthur Hunkins
<000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>
> Canonical Csound includes samples in RAW format. I need to put one of these samples, marmstk1.raw, into a GEN01 function, for which I need to know its file format. (I know that RAW files can readily be changed to WAV, which retrieves format info from the header, but I want to use the sample as is in the distribution.)
>
> So, two questions:
> 1) how do you determine the format of a RAW sample? (The examples in the reference manual all use the WAV "equivalent.")
> 2) what might be the correct format designation for marmstk1.raw? (This file is an impulse response for a Cook/ffitch physical model for struck, pitched percussion.)
>
> Or perhaps do all the RAW samples have the same format (unlikely), and if so which?

Searching the internets for that filename suggests that it might come
from https://github.com/thestk/stk/tree/master/rawwaves. And the
corresponding https://github.com/thestk/stk/blob/master/README.md says
that it should be "1-channel, 16-bit, big-endian".

-Ben

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

Date2019-10-21 17:50
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Sample Formats of RAW files
Thanks for that info, Ben. -4 then seems to be the appropriate format value for GEN01, especially for a RAW STK file, which marmstk1.raw is obviously.

Also, I had tried all possible negative values from -1 to -9, and empirically -4 gave the most reasonable amplitudes when incorporated into my percussive sounds (marimba, vibes, cowbell). So -4 RAW it is.

On Sat, Oct 19, 2019 at 11:40 PM Benjamin Niemann <pink@odahoda.de> wrote:
Hi Arthur,

On Sun, Oct 20, 2019 at 3:05 AM Arthur Hunkins
<000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>
> Canonical Csound includes samples in RAW format. I need to put one of these samples, marmstk1.raw, into a GEN01 function, for which I need to know its file format. (I know that RAW files can readily be changed to WAV, which retrieves format info from the header, but I want to use the sample as is in the distribution.)
>
> So, two questions:
> 1) how do you determine the format of a RAW sample? (The examples in the reference manual all use the WAV "equivalent.")
> 2) what might be the correct format designation for marmstk1.raw? (This file is an impulse response for a Cook/ffitch physical model for struck, pitched percussion.)
>
> Or perhaps do all the RAW samples have the same format (unlikely), and if so which?

Searching the internets for that filename suggests that it might come
from https://github.com/thestk/stk/tree/master/rawwaves. And the
corresponding https://github.com/thestk/stk/blob/master/README.md says
that it should be "1-channel, 16-bit, big-endian".

-Ben

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