Csound Csound-dev Csound-tekno Search About

Sample file format

Date2007-09-29 23:00
FromBrian Wong
SubjectSample file format
Hello all, I am a very new user (noob) of Csound and blue, and just working my way through the tutorials and trying to learn the basics. First off I would just like to say I absolutely love Csound and blue, and am thrilled to be able to work on the microtonal concepts that interest me with such a powerful platform.
 
However I do have what is probably a fairly common noob question : what is the situation with importing sample files? I am able import a sample using soundin (Tootorial part 8), but in Csound Book Chapter 1 (exercises for etude #1) using loscil I am having problems. The file supplied on the website sing.aif works fine, but my sample file will not. Can someone please direct me to a reference that explains how to make samples that are usable in Csound?


Discover the new Windows Vista Learn more!

Date2007-09-30 00:06
FromJulien Claassen
SubjectRe: Sample file format
Hi!
  As far as I am aware, your files should:
1. Stick to the samplerate given by sr in the orc-files. So if you have
sr = 4410
  Then your own files should be sampled (or converted to) 44.1kHz.
2. I think loscil takes its samples from a wave table, which might only 
support MONO files. What sense would it make for an loscil-sample to be 
stereo. If you like both channels of a stereo file. Split the original, 
perhaps with csound as well and then read them in two function-tables and 
use two loscils and mix their output.
  Probably you should also stick to the actual bitrate, but I don't know that 
exactly, only worked with 16bit with csound.
  Hope that helps!
  Kindest regards
           Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net
the Linux TextBased Studio guide
======= AND MY PERSONAL PAGES AT: =======
http://www.juliencoder.de

Date2007-09-30 00:11
Fromluis jure
SubjectRe: Sample file format
El Sat, 29 Sep 2007 19:00:33 -0300
Brian Wong  escribió:

> The file supplied on the website sing.aif works fine, but my sample
> file will not. 

a bit of additional information would be useful to be able to help you.
in which way your sound file "does not work"? what kind of file are you
trying to use? csound comes with an utility called "sndinfo" that does
what its name suggests. what's the output of that command on your sound
file?

best,

lj

Date2007-09-30 01:58
FromBrian Wong
SubjectRe: Sample file format
Thank you to both Luis and Julien for your response to my question.
 
Apparently loscil will work with either mono or stereo, according to the manual.
 
With the sndinfo command (thanks, that will be useful!) my sound file gives basically the same results with both my sample and sing.aif, which is :
srate 44100, monaural, 16 bit AIFF, 0.201 seconds
I should add this is the same sample that worked with soundin as a .wav. I converted it to .aif for use with loscil using wavesurfer.exe. By "not working" what I mean is that I don't hear anything except a slight clicking sound. The resulting aif sample plays fine in various audio players.
 
I have looked at the Csound dialog output and see the two following warnings :
WARNING: no legal base frequency
WARNING: locscil: sustain defers to non-looping source

 
So it looks like either the base frequency or loop points might be the problem. I have tried setting the frequency argument in loscil to 0 to try to make it use the csound default value, but this was not successful, nor was using 440 as the base frequency. I am not sure how to find out what the base frequency of the sample is.
 
Thanks in advance for any assistance you can offer!
 


Connect to the next generation of MSN Messenger  Get it now!

Date2007-09-30 02:10
FromBrian Wong
SubjectRe: Sample file format
Sorry to double post, but I just tried it with a much lower base frequency (5 in this case) and it is working fine. However my question remains, how do I find out the actual base frequency of an existing sample?




From: brian.wong1@hotmail.com
To: csound@lists.bath.ac.uk
Date: Sat, 29 Sep 2007 21:58:51 -0300
Subject: Re: [Csnd] Sample file format

Thank you to both Luis and Julien for your response to my question.
 
Apparently loscil will work with either mono or stereo, according to the manual.
 
With the sndinfo command (thanks, that will be useful!) my sound file gives basically the same results with both my sample and sing.aif, which is :
srate 44100, monaural, 16 bit AIFF, 0.201 seconds
I should add this is the same sample that worked with soundin as a .wav. I converted it to .aif for use with loscil using wavesurfer.exe. By "not working" what I mean is that I don't hear anything except a slight clicking sound. The resulting aif sample plays fine in various audio players.
 
I have looked at the Csound dialog output and see the two following warnings :
WARNING: no legal base frequency
WARNING: locscil: sustain defers to non-looping source

 
So it looks like either the base frequency or loop points might be the problem. I have tried setting the frequency argument in loscil to 0 to try to make it use the csound default value, but this was not successful, nor was using 440 as the base frequency. I am not sure how to find out what the base frequency of the sample is.
 
Thanks in advance for any assistance you can offer!
 


Connect to the next generation of MSN Messenger  Get it now!


Discover the new Windows Vista Learn more!