Csound Csound-dev Csound-tekno Search About

[Csnd] It only plays half the file and then it repeats (CsoundQt)

Date2012-05-11 02:34
FromCacophony7
Subject[Csnd] It only plays half the file and then it repeats (CsoundQt)
using "oscil", "lfo" and "phasor" to read a file from "table" but it only
reads half the aiff file or table and then it goes back to the beginning and
repeats. I still don't know exactly what phasor does. I'm just reading
/Csound Power!/ and I'm stuck on page 51. I haven't been on the net for days
and I've been stuck on pages 48 to 51 for a long time while experimenting
with song files.













	sr = 44100

	ksmps = 32

	nchnls = 2

	0dbfs = 1



	instr 1



		kosc oscil 7, 2, 2

		klfo lfo 0.03125*(kosc+8), 250, 0

		aphas phasor (klfo + 1)/p3*2

		ifilelength = 9644544 ;I got this number from using Audacity

		aphas = aphas * ifilelength

		asample table aphas, 1



		aout = asample

		

		outs aout, aout

	endin











	f 1 0 16777216 1 "Swallow.aiff" 0 4 0                        /*Korn :
Swallow (converted from a mp3 to a aiff using Audacity)*/

	f 2 0 16777216 10 1 1.5 2.25 3.375

	

	t 0 60



	i 1 0 219







--
View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-05-11 12:39
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] It only plays half the file and then it repeats
Can you give the details of the soundfile Swallow.aiff ?  number of
channels in particular

Also a generic remark -- can people please state platform and vcsound
version when reporting difficulties?  Not always the problem but it really
does help in understanding the problems.

==John ff

> using "oscil", "lfo" and "phasor" to read a file from "table" but it only
> reads half the aiff file or table and then it goes back to the beginning
> and
> repeats. I still don't know exactly what phasor does. I'm just reading
> /Csound Power!/ and I'm stuck on page 51. I haven't been on the net for
> days
> and I've been stuck on pages 48 to 51 for a long time while experimenting
> with song files.
>
> 
>
> 
>
> 
>
>
>
> 
>
>
>
> 	sr = 44100
>
> 	ksmps = 32
>
> 	nchnls = 2
>
> 	0dbfs = 1
>
>
>
> 	instr 1
>
>
>
> 		kosc oscil 7, 2, 2
>
> 		klfo lfo 0.03125*(kosc+8), 250, 0
>
> 		aphas phasor (klfo + 1)/p3*2
>
> 		ifilelength = 9644544 ;I got this number from using Audacity
>
> 		aphas = aphas * ifilelength
>
> 		asample table aphas, 1
>
>
>
> 		aout = asample
>
>
>
> 		outs aout, aout
>
> 	endin
>
>
>
> 
>
>
>
> 
>
>
>
> 	f 1 0 16777216 1 "Swallow.aiff" 0 4 0                        /*Korn :
> Swallow (converted from a mp3 to a aiff using Audacity)*/
>
> 	f 2 0 16777216 10 1 1.5 2.25 3.375
>
>
>
> 	t 0 60
>
>
>
> 	i 1 0 219
>
>
>
> 
>
> 
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>



Date2012-05-11 15:43
FromJustin Glenn Smith
SubjectRe: [Csnd] It only plays half the file and then it repeats (CsoundQt)
not knowing anything else about your file, if "ifilelength = 9644544" plays half the file and repeats, then "ifilelength = 19289088" will play the whole  thing

On 05/10/2012 06:34 PM, Cacophony7 wrote:
> using "oscil", "lfo" and "phasor" to read a file from "table" but it only
> reads half the aiff file or table and then it goes back to the beginning and
> repeats. I still don't know exactly what phasor does. I'm just reading
> /Csound Power!/ and I'm stuck on page 51. I haven't been on the net for days
> and I've been stuck on pages 48 to 51 for a long time while experimenting
> with song files.
>
> 
>
> 
>
> 
>
>
>
> 
>
>
>
> 	sr = 44100
>
> 	ksmps = 32
>
> 	nchnls = 2
>
> 	0dbfs = 1
>
>
>
> 	instr 1
>
>
>
> 		kosc oscil 7, 2, 2
>
> 		klfo lfo 0.03125*(kosc+8), 250, 0
>
> 		aphas phasor (klfo + 1)/p3*2
>
> 		ifilelength = 9644544 ;I got this number from using Audacity
>
> 		aphas = aphas * ifilelength
>
> 		asample table aphas, 1
>
>
>
> 		aout = asample
>
> 		
>
> 		outs aout, aout
>
> 	endin
>
>
>
> 
>
>
>
> 
>
>
>
> 	f 1 0 16777216 1 "Swallow.aiff" 0 4 0                        /*Korn :
> Swallow (converted from a mp3 to a aiff using Audacity)*/
>
> 	f 2 0 16777216 10 1 1.5 2.25 3.375
>
> 	
>
> 	t 0 60
>
>
>
> 	i 1 0 219
>
>
>
> 
>
> 
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>              https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Date2012-05-11 18:23
FromRory Walsh
SubjectRe: [Csnd] It only plays half the file and then it repeats (CsoundQt)
You might also want to use filelen to retrieve the length of the file
in seconds rather than having to use Audacity to retrieve the number
of samples./

On 11 May 2012 15:43, Justin Glenn Smith  wrote:
> not knowing anything else about your file, if "ifilelength = 9644544" plays
> half the file and repeats, then "ifilelength = 19289088" will play the whole
>  thing
>
> On 05/10/2012 06:34 PM, Cacophony7 wrote:
>>
>> using "oscil", "lfo" and "phasor" to read a file from "table" but it only
>> reads half the aiff file or table and then it goes back to the beginning
>> and
>> repeats. I still don't know exactly what phasor does. I'm just reading
>> /Csound Power!/ and I'm stuck on page 51. I haven't been on the net for
>> days
>> and I've been stuck on pages 48 to 51 for a long time while experimenting
>> with song files.
>>
>> 
>>
>> 
>>
>> 
>>
>>
>>
>> 
>>
>>
>>
>>        sr = 44100
>>
>>        ksmps = 32
>>
>>        nchnls = 2
>>
>>        0dbfs = 1
>>
>>
>>
>>        instr 1
>>
>>
>>
>>                kosc oscil 7, 2, 2
>>
>>                klfo lfo 0.03125*(kosc+8), 250, 0
>>
>>                aphas phasor (klfo + 1)/p3*2
>>
>>                ifilelength = 9644544 ;I got this number from using
>> Audacity
>>
>>                aphas = aphas * ifilelength
>>
>>                asample table aphas, 1
>>
>>
>>
>>                aout = asample
>>
>>
>>
>>                outs aout, aout
>>
>>        endin
>>
>>
>>
>> 
>>
>>
>>
>> 
>>
>>
>>
>>        f 1 0 16777216 1 "Swallow.aiff" 0 4 0                        /*Korn
>> :
>> Swallow (converted from a mp3 to a aiff using Audacity)*/
>>
>>        f 2 0 16777216 10 1 1.5 2.25 3.375
>>
>>
>>
>>        t 0 60
>>
>>
>>
>>        i 1 0 219
>>
>>
>>
>> 
>>
>> 
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


Date2012-05-11 20:19
FromCacophony7
Subject[Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
Thanks! I found "filelen" more fast-per-precise than zooming in on audacity.
Audacity is very precise but "filelen" is all I need. "filelen" gives
218.697 and if you do the math Audacity gives 218.6971205 (seconds)

----------------------------------------------------------------------------------------------------------------------
New code:














	sr = 44100

	ksmps = 32

	nchnls = 2

	0dbfs = 1



	instr 1 ; choose between mono or stereo file



		ilen   filelen p4	;calculate length of soundfile

		print  ilen

		ichn filenchnls  p4	;check number of channels

		print  ichn



		if (ichn == 1) then

			;mono signal

			asig diskin2 p4, 1	

			outs    asig, asig



		else

			;stereo signal

			aL, aR diskin2 p4, 1

			outs    aL, aR



		endif



	endin













	f 1 0 16777216 1 "Swallow.aiff" 0 4 0

	f 2 0 16777216 10 1 1.5 2.25 3.375

	

	t 0 60



	i 1 0 218.697 "Swallow.aiff"

	




----------------------------------------------------------------------------------------------------------------------
Output console:

...
new alloc for instr 1:
instr 1: ilen = 218.697
instr 1: ichn = 2.000
diskin2: opened 'swallow.aiff':
            44100 Hz, 2 channel (s), 9644544 sample frames
...

----------------------------------------------------------------------------------------------------------------------
I just copied most of this code from The Canonical Csound Reference Manual
so is there a difference between sample frames and samples?
19289088 samples seems to work
----------------------------------------------------------------------------------------------------------------------
Changed code:

instr 1



		kosc oscil 7, 2, 2

		klfo lfo 0.03125/**(kosc+8)*/, 250, 0

		aphas phasor (klfo + 1)/p3

		ifilelength = 9644544*2 ;the 2 goes here instead

		aphas = aphas * ifilelength

		asample table aphas, 1 ;one more thing, this should be stereo output (more
than one output)



		aout = asample

		

		outs aout, aout

	endin

--
View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5703910.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-05-11 22:19
FromCacophony7
Subject[Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
I hit the limit. The maximum table size for GEN01 is 16777216 (= 2^24) but I
need 2^25 (33554432)
can you developers help me get such a table size? (please)

--
View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5705479.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-05-12 01:39
FromCacophony7
Subject[Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
...can I use beat slicing to break one big file into smaller ones with each
file having it's own individual agency?

http://en.wikipedia.org/wiki/Beat_slicing

...what if it's used for drumbeats only?

--
View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5706022.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-05-12 03:18
FromRory Walsh
SubjectRe: [Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
What is it you are trying to do? Your first example used diskin2 but
then you changed to using a table opcode. What was wrong with diskin2
and why did you change? They both offer different things. The beauty
of loading a file to a table is you can do anything you want with the
samples contained in the table. With diskin2 you can read from
different positions and change the pitch but after that you're stuck,
more or less. You can break one big file into several smaller ones by
only reading the relevant sections of the file. In practical terms it
might be best however to just load the different samples.

In terms of beat slicing I posted an instrument to this list a while
back that would add breaks of sorts to a sound file and Jake posted
some nice Csound/python examples recently that showed off some nifty
ways of breaking up beats. You can probably find them in the archives.

Rory.



On 12 May 2012 01:39, Cacophony7  wrote:
> ...can I use beat slicing to break one big file into smaller ones with each
> file having it's own individual agency?
>
> http://en.wikipedia.org/wiki/Beat_slicing
>
> ...what if it's used for drumbeats only?
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5706022.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Date2012-05-13 03:03
FromCacophony7
Subject[Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
I couldn't find the beat slicing instrument in the archives. How do I search
for it?

I finished my project using diskin2 instead of table because table is
limited to a maximum 16777216 table size. The sound file is 19289088 samples
which is > 16777216.

--------------------------------------------------------------------------------------------------------------------

	instr 1



		kosc1 oscil 0.7, 2, 2

		klfo1 lfo 1.03125*(kosc1+0.8), 250, 0

		kphas1 phasor 440*(klfo1+(1.03125*1.5)+0.1)

		asampleL1, asampleR1 diskin2 "Swallow.aiff", 0.5+kphas1

		

		kosc2 oscil 0.7, 2, 2

		klfo2 lfo 1.03125*(kosc2+0.8), 250, 0

		kphas2 phasor 880*klfo2

		asampleL2, asampleR2 diskin2 "Swallow.aiff", 0.5+kphas2



		asampleLO, asampleRO diskin2 "Swallow.aiff", 1



		aoutL = (asampleLO/3) + (asampleL1/3) + (asampleL2/3)

		aoutR = (asampleRO/3) + (asampleR1/3) + (asampleR2/3)



		outs aoutL, aoutR



	endin

--------------------------------------------------------------------------------------------------------------------

It sounds great!



In terms of beat slicing I posted an instrument to this list a while
back that would add breaks of sorts to a sound file and Jake posted
some nice Csound/python examples recently that showed off some nifty
ways of breaking up beats. You can probably find them in the archives.

Rory.



--
View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5707866.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-05-15 17:34
FromRory Walsh
SubjectRe: [Csnd] Re: It only plays half the file and then it repeats (CsoundQt)
http://www.csounds.com/udo/displayOpcode.php?opcode_id=153

On 13 May 2012 03:03, Cacophony7  wrote:
> I couldn't find the beat slicing instrument in the archives. How do I search
> for it?
>
> I finished my project using diskin2 instead of table because table is
> limited to a maximum 16777216 table size. The sound file is 19289088 samples
> which is > 16777216.
>
> --------------------------------------------------------------------------------------------------------------------
>
>        instr 1
>
>
>
>                kosc1 oscil 0.7, 2, 2
>
>                klfo1 lfo 1.03125*(kosc1+0.8), 250, 0
>
>                kphas1 phasor 440*(klfo1+(1.03125*1.5)+0.1)
>
>                asampleL1, asampleR1 diskin2 "Swallow.aiff", 0.5+kphas1
>
>
>
>                kosc2 oscil 0.7, 2, 2
>
>                klfo2 lfo 1.03125*(kosc2+0.8), 250, 0
>
>                kphas2 phasor 880*klfo2
>
>                asampleL2, asampleR2 diskin2 "Swallow.aiff", 0.5+kphas2
>
>
>
>                asampleLO, asampleRO diskin2 "Swallow.aiff", 1
>
>
>
>                aoutL = (asampleLO/3) + (asampleL1/3) + (asampleL2/3)
>
>                aoutR = (asampleRO/3) + (asampleR1/3) + (asampleR2/3)
>
>
>
>                outs aoutL, aoutR
>
>
>
>        endin
>
> --------------------------------------------------------------------------------------------------------------------
>
> It sounds great!
>
>
>
> In terms of beat slicing I posted an instrument to this list a while
> back that would add breaks of sorts to a sound file and Jake posted
> some nice Csound/python examples recently that showed off some nifty
> ways of breaking up beats. You can probably find them in the archives.
>
> Rory.
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/It-only-plays-half-the-file-and-then-it-repeats-CsoundQt-tp5701891p5707866.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>