Csound Csound-dev Csound-tekno Search About

[Csnd] Jim Aikin OSC/table Opcode

Date2014-06-07 17:32
Fromfauveboy
Subject[Csnd] Jim Aikin OSC/table Opcode
Screen_Shot_2014-06-07_at_17.png
  

I've recently got hold of the Jim Aikin book Csound Power which I have in
front of me. I've understood how to play back a sample once through the
command line. Aikin has also explained how to approach OSC referencing this
video https://www.youtube.com/watch?v=JX1C3TqP_9Y which I managed. I've
uploaded a screen shot where I've tried to combine the two csound
instruments as Im aiming to control sample playback with OSC parameters sent
from Pure Data starting with "/amp" amplitude. 

However from looking at the terminal and from what I understand from Csound
Power Im not sure what the errors are here? Since I've tried to integrate
OSClisten the sample won't play and I can't launch a connection yet from the
PD window. Is there any clear indication from the screenshot as to what I've
not applied? Of course any help is fully appreciated.

Thank you for reading 



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-07 17:44
FromMartin Peach
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
On 2014-06-07 12:32, fauveboy wrote:
> Screen_Shot_2014-06-07_at_17.png
> 
>
...

> However from looking at the terminal and from what I understand from Csound
> Power Im not sure what the errors are here? Since I've tried to integrate
> OSClisten the sample won't play and I can't launch a connection yet from the
> PD window. Is there any clear indication from the screenshot as to what I've
> not applied? Of course any help is fully appreciated.

Well firstly csound can't find your csd file because of a typo in its 
name. I'm not sure if the WARNINGs are relevant.

Martin


Date2014-06-07 17:48
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
No, they’re not relevant, they’re benign in this case.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 7 Jun 2014, at 17:44, Martin Peach  wrote:

> On 2014-06-07 12:32, fauveboy wrote:
>> Screen_Shot_2014-06-07_at_17.png
>> 
>> 
> ...
> 
>> However from looking at the terminal and from what I understand from Csound
>> Power Im not sure what the errors are here? Since I've tried to integrate
>> OSClisten the sample won't play and I can't launch a connection yet from the
>> PD window. Is there any clear indication from the screenshot as to what I've
>> not applied? Of course any help is fully appreciated.
> 
> Well firstly csound can't find your csd file because of a typo in its name. I'm not sure if the WARNINGs are relevant.
> 
> Martin
> 
> 
> 
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-07 18:06
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Yes, because I did run the same code under the same name just before
integrating of any OSC operations you see on the screenshot and it ran the
sample as it should so the files are all in the correct directories and
things.



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735730.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-07 20:08
FromJim Aikin
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
This is an old video. The method of transmitting OSC messages from Pd has
changed. You'll need to look to the Pd forum for details on this.



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735731.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-07 20:30
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Ah okay. Well the video alone works when I put it into practice... My main
focus though was to get the Csound code correct in terms of how I can
utilise OSC within it to see if its possible to control sample playback in
real time, eventually. In this case Im just temporally using PD just for its
OSC capabilities ( Its actually just a substitute for serialOSC software for
the Monome). Or are you saying transmitting OSC from PD has changed and so
the way Csound now receives it is not the same now to whats in Csound Power?

Thank you Csound Power btw! :)



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735732.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-07 20:40
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
Csound’s OSC support has not changed. It will never do, because of its backward compatibility.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 7 Jun 2014, at 20:30, fauveboy  wrote:

> Ah okay. Well the video alone works when I put it into practice... My main
> focus though was to get the Csound code correct in terms of how I can
> utilise OSC within it to see if its possible to control sample playback in
> real time, eventually. In this case Im just temporally using PD just for its
> OSC capabilities ( Its actually just a substitute for serialOSC software for
> the Monome). Or are you saying transmitting OSC from PD has changed and so
> the way Csound now receives it is not the same now to whats in Csound Power?
> 
> Thank you Csound Power btw! :)
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735732.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-07 21:41
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Is the OSC quite recent I've been searching for answers in Richard
Boulanger's "The Csound Book" but nothing on OSC that reveals itself to help
us here...



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735734.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-08 00:55
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Just a second attempted here ...  Screen_Shot_2014-06-08_at_00.png
  



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735735.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-08 01:01
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
Can you update your Csound version to 6.03 and try again? I am not sure why the segmentation fault, but it
could have been fixed since.

========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 8 Jun 2014, at 00:55, fauveboy  wrote:

> Just a second attempted here ...  Screen_Shot_2014-06-08_at_00.png
>   
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735735.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-08 01:05
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
Also the lines

Ktrig …

should be

ktrig …

(lower case). That could be the cause of the crash.

========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 8 Jun 2014, at 00:55, fauveboy  wrote:

> Just a second attempted here ...  Screen_Shot_2014-06-08_at_00.png
>   
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735735.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-08 01:35
FromMartin Peach
SubjectRe: [Csnd] Re: Jim Aikin OSC/table Opcode
On 2014-06-07 19:55, fauveboy wrote:
> Just a second attempted here ...  Screen_Shot_2014-06-08_at_00.png
> 
>

You don't initialize iamp anywhere, so using iamp to set the output 
level will make for silence, and the whole thing runs for one second, 
and kamp ends up not being used.

Martin


Date2014-06-08 08:01
Fromzappfinger
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Also, you are reading kamp over OSC, but after that you set kamp equal to
iamp, so it gets overwritten.

Richard 



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735739.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-09 17:46
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Thanks guys here's what the working code looks like 
Screen_Shot_2014-06-09_at_17.png
  
So I think it was kamp assigned to iamp and the upper case of "ktrig" that
wasn't working. 
At the moment once the script is launched through terminal, OSC listens for
the duration the phasor sweeping through the table length then it cuts out.
I suppose its a case of using if statements or while loops to have the
'phase' part of the script repeat before cutting out only when the On/Off
toggle is off?



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735765.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-09 18:19
FromMartin Peach
SubjectRe: [Csnd] Re: Jim Aikin OSC/table Opcode
On 2014-06-09 12:46, fauveboy wrote:
> Thanks guys here's what the working code looks like
> Screen_Shot_2014-06-09_at_17.png
> 
> So I think it was kamp assigned to iamp and the upper case of "ktrig" that
> wasn't working.
> At the moment once the script is launched through terminal, OSC listens for
> the duration the phasor sweeping through the table length then it cuts out.
> I suppose its a case of using if statements or while loops to have the
> 'phase' part of the script repeat before cutting out only when the On/Off
> toggle is off?

I think it's because your instrument only runs for one second.
You could try
i1 0 1e9
or something like that to get it to run for longer.
Or use the 'alwayson' opcode.
Or add an f0 statement with the desired duration.

Martin


Date2014-06-09 21:26
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Okay. Is there the option somehow of having the phase scan through the table
indefinitely until the toggle is off or is it a matter of putting a really
long duration as you say 



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735772.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-09 22:06
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
yes, with a negative p3 it will stay on, and turnoff2 can be used to switch it off, or you can
send an event with matching negative p1 to do that too.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 9 Jun 2014, at 21:26, fauveboy  wrote:

> Okay. Is there the option somehow of having the phase scan through the table
> indefinitely until the toggle is off or is it a matter of putting a really
> long duration as you say 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735772.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-12 01:18
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Ah, I had a look at negative p3 but with this script it cuts out immediately
I think because the table length resets as soon as the scripts run? Perhaps
I was thinking maybe a way to have the code continually reset the table? (if
thats the answer) or rather continually extending it...but that would take
up memory? I wasn't sure from looking at this code if what the best way for
is now? Should the "-1"/ p3 of worked here? Screen_Shot_2014-06-12_at_01.png
  



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735786.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-12 10:24
FromVictor Lazzarini
SubjectRe: [Csnd] Jim Aikin OSC/table Opcode
Try adding a f0 30000 to the score, which will keep Csound open for 30000 seconds.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 12 Jun 2014, at 01:18, fauveboy  wrote:

> Ah, I had a look at negative p3 but with this script it cuts out immediately
> I think because the table length resets as soon as the scripts run? Perhaps
> I was thinking maybe a way to have the code continually reset the table? (if
> thats the answer) or rather continually extending it...but that would take
> up memory? I wasn't sure from looking at this code if what the best way for
> is now? Should the "-1"/ p3 of worked here? Screen_Shot_2014-06-12_at_01.png
>   
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735786.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2014-06-13 01:43
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
Interesting, well this has extended the instrument but the audio still only
plays once because the duration of i p3 is still only being set once when
the code is launched (i think). Im not sure whether its just a matter of
experimentation now as my concern is my posts are now becoming tedious for
people? I think considering "f0 30000" there should be away to have this
particular code scan through with the phasor of the table thats storing the
audio repeatedly until perhaps a "turnoff2" opcode indicates to stop,
somehow. 
Jim Aikin in the csound power book does illustrate this instr on pg 144 as a
"template" explaining that there is a way to have the sample repeat in a
loop, just not sure how yet.



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5735804.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-07-02 16:22
Fromfauveboy
Subject[Csnd] Re: Jim Aikin OSC/table Opcode
I have a working code here after help from Racs on the monome forum here
http://monome.org/community/discussion/17744/csound-oscsecond-attempt#Item_9
so I wanted to upload that.

Im hoping to get an opinion regarding the phasor.. on this link
http://www.csounds.com/tootsother/east/Phasor/Phasor.html theres a second
subtitle called "Building an Oscillator with the Phasor". I was basically
trying to confirm its function. How the phasor is used in this code just
runs from 0 to 1 and isn't multiplied directly to the table holding the
sample (I think ) which is in my case the size of 396900 (9seconds of mono
audio at 44100. To have the ability to skip through the progression of a
sample (a lot like mlr) would I have to apply a K rate variable that
directly can hold an occurrence within the table? I've incorporated a
seconded audio file here in the code below but I was just looking for an
opinion if there is one on whether Im working on the right lines to achieve
this idea? At the moment any value Im sending to interacted with the
phasor/the scanning through a table with sample just changes the pitch and
speed rather than maintaining the speed and pitch and just adjusting an
occurrence within table?

Of course Thanks again!






sr = 44100
ksmps = 1 
nchnls = 2
0dbfs = 1

giSample1 ftgen 1, 0, 396900, 1, "rosewavloop1.wav", 0, 0, 0

giOSC1 OSCinit 9999

instr 1
kamp1 init 0
kloop1 init 1
kpcontrol init 1
ktrig1 OSClisten giOSC1, "/loop1", "f", kloop1
ktrig2 OSClisten giOSC1, "/amp1", "f", kamp1
ktrig3 OSClisten giOSC1, "/phasorcontrol", "f", kpcontrol
ilen tableng 1 ; what is table number 1 swapped for giSample1?
kphcontrol = ilen/sr 
aphas phasor kloop1 / kphcontrol * kpcontrol
asig table aphas, giSample1, 1 ; table number and index?
asig = asig * kamp1
outs asig, asig 
endin

giSample2 ftgen 2, 0, 396900, 1, "rosewavloop2.wav", 0, 0, 0


instr 2
kamp2 init 0
kloop2 init 1
kpcontrol init 1
ktrig1 OSClisten giOSC1, "/loop2", "f", kloop2
ktrig2 OSClisten giOSC1, "/amp2", "f", kamp2
ktrig3 OSClisten giOSC1, "/phasorcontrol", "f", kpcontrol
ilen tableng 2 ; what is table number 1 swapped for giSample1?
kphcontrol = ilen/sr 
aphas phasor kloop2 / kphcontrol * kpcontrol
asig table aphas, giSample2, 1 ; table number and index?
asig = asig * kamp2
outs asig, asig 
endin



f 0 18

i 1 0 18
i 2 0 18
e



--
View this message in context: http://csound.1045644.n5.nabble.com/Jim-Aikin-OSC-table-Opcode-tp5735727p5736117.html
Sent from the Csound - General mailing list archive at Nabble.com.