Csound Csound-dev Csound-tekno Search About

[Csnd] Playing raw-files in csound

Date2019-12-15 11:37
FromJan Jacob Hofmann
Subject[Csnd] Playing raw-files in csound
Dear list,

for the first time I do have to read a raw soundfile ("bassdrum.raw") 
with diskin2. No matter, which setting I do choose for iformat, all I 
get is just the same short burst of noise. Is there something general 
about dealing with raw soundfiles that I am missing?

Best,

Jan Jacob

-- 

sound      |      movement       |       object      |      space
sonic architecture     |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

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-12-15 12:29
FromVictor Lazzarini
SubjectRe: [Csnd] Playing raw-files in csound
What version of Csound?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 15 Dec 2019, at 11:37, Jan Jacob Hofmann  wrote:
> 
> Dear list,
> 
> for the first time I do have to read a raw soundfile ("bassdrum.raw") with diskin2. No matter, which setting I do choose for iformat, all I get is just the same short burst of noise. Is there something general about dealing with raw soundfiles that I am missing?
> 
> Best,
> 
> Jan Jacob
> 
> -- 
> 
> sound      |      movement       |       object      |      space
> sonic architecture     |      site: http://www.sonicarchitecture.de
> spatial electronic composition    |    higher order ambisonic music
> 
> 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-12-15 23:36
FromPete Goodeve
SubjectRe: [Csnd] Playing raw-files in csound
AttachmentsNone  

Date2019-12-16 21:59
FromPete Goodeve
Subject[Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
AttachmentsNone  

Date2019-12-17 02:38
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
Several months ago I spent weeks trying to get the marmstk1.raw file working for me in the marimba, vibes and gogobel opcodes. I finally did, and the results can be found in three .csd's for my composition From a Dream (top of my comp list at arthunkins.com, in it's zip archive).

I needed the 3 different .csd's largely due to differences in the way I had to implement marmstk1.raw in 3 platforms: console Csound, and new and older versions of the Android OS. (One of the differences is that the STK samples are not included in the earlier Android distributions of Csound.)

You can compare my STK solutions by comparing their incorporation in the GEN01 functions near the end of the .csd's.

Several random comments: complete paths for samples must be specified on Android. (Android doesn't seem to do relative.) And IIRC, for console Csound (in my case Windows), a simple substitution of a WAV for the RAW extension seems to be acceptable. (I don't recall that this works on Android.) I note that this is what Iain McCurdy seems to do in gogobel.csd in his Csound instrument collection. His SR is 22050, which I believe is the SR for all the SDK samples (I recall someone on this list verifying this fact.)

Unfortunately, none of these knotty deviations are discussed anywhere that I know of.


On Mon, Dec 16, 2019 at 4:59 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
Just an addendum to yesterday's post.

I found my link to the CCRMA page on STK, and there it states
that the sample rate of the files is 22050 (not 16000 as I had
guessed).

I notice that Michael has included the rawwaves set in his
Android Csound.  Not sure why, as they won't work there, either!
They aren't used in any of the examples.

Are the samples of possible interest to Csounders, though?
If so, they should be converted to something useful.  Maybe
convert them to WAV -- or maybe even better, AIFF, as that
format is also Big-Endian, so the data itself would be unswapped.

I could probably whip up a script and convert them fairly quickly,
if there's anywhere public covenient to put them.

         -- Pete --


On Sun, Dec 15, 2019 at 03:36:36PM -0800, Pete Goodeve wrote:
> On Sun, Dec 15, 2019 at 12:37:02PM +0100, Jan Jacob Hofmann wrote:
> > Dear list,
> >
> > for the first time I do have to read a raw soundfile ("bassdrum.raw")
> > with diskin2. No matter, which setting I do choose for iformat, all I
> > get is just the same short burst of noise. Is there something general
> > about dealing with raw soundfiles that I am missing?
> >
>
> If that 'bassdrum.raw' is from the STK 'rawwaves' set, it turns out
> to be big-endian! (https://github.com/thestk/stk)  This isn't going
> to work in (normally) little-endian Csound.
>
> ....

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-12-17 06:56
FromVictor Lazzarini
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
Never actually looked into this, but one should ask, is it not a dumb thing to distribute raw files with your API?

My impression always was that the STK only worked with these raw files, and not with proper soundfiles, therefore putting our wav or aif versions was useless. I might be wrong, though.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Dec 2019, at 21:59, Pete Goodeve  wrote:
> 
> Just an addendum to yesterday's post.
> 
> I found my link to the CCRMA page on STK, and there it states
> that the sample rate of the files is 22050 (not 16000 as I had
> guessed).
> 
> I notice that Michael has included the rawwaves set in his
> Android Csound.  Not sure why, as they won't work there, either!
> They aren't used in any of the examples.
> 
> Are the samples of possible interest to Csounders, though?
> If so, they should be converted to something useful.  Maybe
> convert them to WAV -- or maybe even better, AIFF, as that
> format is also Big-Endian, so the data itself would be unswapped.
> 
> I could probably whip up a script and convert them fairly quickly,
> if there's anywhere public covenient to put them.
> 
>     -- Pete --
> 
> 
>> On Sun, Dec 15, 2019 at 03:36:36PM -0800, Pete Goodeve wrote:
>>> On Sun, Dec 15, 2019 at 12:37:02PM +0100, Jan Jacob Hofmann wrote:
>>> Dear list,
>>> 
>>> for the first time I do have to read a raw soundfile ("bassdrum.raw") 
>>> with diskin2. No matter, which setting I do choose for iformat, all I 
>>> get is just the same short burst of noise. Is there something general 
>>> about dealing with raw soundfiles that I am missing?
>>> 
>> 
>> If that 'bassdrum.raw' is from the STK 'rawwaves' set, it turns out
>> to be big-endian! (https://github.com/thestk/stk)  This isn't going
>> to work in (normally) little-endian Csound.
>> 
>> ....
> 
> 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-12-17 07:59
FromPete Goodeve
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
AttachmentsNone  

Date2019-12-17 08:10
FromPete Goodeve
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
AttachmentsNone  None  stkwaveaiffs.zip  

Date2019-12-17 18:50
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
Pete -

Thanks for these insights. I'd like to see your "proper" marmstk1.wav (or .aiff) and experiment with it to see whether my gogobel, vibes and marimba opcodes might be made cleaner.

I got into the .wav/.raw quagmire first because the reference manual for these opcodes used the .wav format, while my distributions (Windows and latest Android) supplied only .raw. Iain's catalog also uses .wav. I wonder how he "converted," if indeed he did anything but an extension substitution?)

What I did was import marmstk1.raw into Audacity, and export it as a 22050 sr .wav.  Should this give the proper impulse envelope, or is some other operation required? In any case, I'd like to know what sample (sample format?) is the proper one to use with these three opcodes (gogobel, vibes and marimba).

Surely, all this should be made clear in the documentation (reference manual) somewhere - probably on the STK Opcodes page. Unfortunately, these three opcodes and marmstk1 (whether .raw or .wav) are not mentioned/discussed there.

On Tue, Dec 17, 2019 at 2:59 AM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Mon, Dec 16, 2019 at 09:38:57PM -0500, Arthur Hunkins wrote:
> Several months ago I spent weeks trying to get the marmstk1.raw file
> working for me in the marimba, vibes and gogobel opcodes. I finally did,
> and the results can be found in three .csd's for my composition From a> Dream (top of my comp list at arthunkins.com, in it's zip archive).

I'm afraid you misled yuurself a bit, there... (:-/)  As I noted, the raw STK
samples won't ever be read properly by Csound.  This turns out to be
counterbalanced by gogobel etc. apparently not being all that sensitive
to their driving waveform!

I did some experiments (which I can supply later -- they're not exactly
organized right now!) and find that gogobel.csd from the Csound examples
doesn't sound all that different if you replace the marmstk1.wav it uses
with marmstk1.raw. (The raw file is providing something close to white
noise, whereas the wav is a proper decaying impulse.)  However, the
wav version is much cleaner and more appropriate.

This probably shows that we *should* provide convenient non-raw
alternatives so people don't get caught by this.

        -- 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

Date2019-12-17 22:54
FromPete Goodeve
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
AttachmentsNone  None  marmstk1.aiff  

Date2019-12-17 23:52
FromPete Goodeve
SubjectRe: [Csnd] STK rawwaves files (was Re: [Csnd] Playing raw-files in csound)
AttachmentsNone