Csound Csound-dev Csound-tekno Search About

[Csnd] Csound tutorial idea

Date2018-12-24 16:15
Frombrian@AMSYNTH.COM
Subject[Csnd] Csound tutorial idea

Hi all,

I recently got looking into a sound synthesis application called "Sonic Pi," and I found the tutorial page on the website to be really helpful in getting started. Like Csound, there's an immense amount of possibilities to play around with, making it seem (for some of us) a bit daunting.

Since I personally prefer Csound for my instrument-making/playing, I've always checked out the Csound manuals as they come out afresh.

At the same time, I'm feeling like it would be a really useful thing for people new to Csound, to have a basic tutorial similar to what's provided on the Sonic-Pi site -- to help people learn to create their own instruments. (I think I'd benefit from it myself!)  But I would need help from someone more experienced than me.

I'd be happy to post the documentation on my own website.

Would anyone be interested in collaborating on something like this?

 

Curious to hear anyone's thoughts,

brian

 

 

 

Date2018-12-24 21:19
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-24 22:44
FromSteven Yi
SubjectRe: [Csnd] Csound tutorial idea
Hi Brian,

Sounds great to me, though I don't have any time to contribute myself.
I did write a basic intro for instrument building here:

https://github.com/kunstmusik/csound-live-code/blob/master/doc/tutorial2.md

that works with the live.csound.com site.

Dr. B's Toots are classic and approachable and always a nice place to start.

Hope others get involved in teaching and guiding others for Csound.

Steven


On Mon, Dec 24, 2018 at 11:15 AM  wrote:
>
> Hi all,
>
> I recently got looking into a sound synthesis application called "Sonic Pi," and I found the tutorial page on the website to be really helpful in getting started. Like Csound, there's an immense amount of possibilities to play around with, making it seem (for some of us) a bit daunting.
>
> Since I personally prefer Csound for my instrument-making/playing, I've always checked out the Csound manuals as they come out afresh.
>
> At the same time, I'm feeling like it would be a really useful thing for people new to Csound, to have a basic tutorial similar to what's provided on the Sonic-Pi site -- to help people learn to create their own instruments. (I think I'd benefit from it myself!)  But I would need help from someone more experienced than me.
>
> I'd be happy to post the documentation on my own website.
>
> Would anyone be interested in collaborating on something like this?
>
>
>
> Curious to hear anyone's thoughts,
>
> brian
>
>
>
>
>
>
> 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

Date2018-12-25 00:08
FromGuillermo Senna
SubjectRe: [Csnd] Csound tutorial idea
I'm working on a site with video tutorials. It based on what Steven posted.

I know I'll need a few more iterations in order to produce good content. Also, everything is in Spanish for the moment. But I'm currently working on this project. 


Besides that: 1) Joachim wanted to create a "Tutorials" section inside csound.com. 2) The FLOSS manual is the best thing we have right now with regards to this kind of educational tool.

Cheers.

El lun., 24 dic. 2018 a las 19:44, Steven Yi (<stevenyi@gmail.com>) escribió:
Hi Brian,

Sounds great to me, though I don't have any time to contribute myself.
I did write a basic intro for instrument building here:

https://github.com/kunstmusik/csound-live-code/blob/master/doc/tutorial2.md

that works with the live.csound.com site.

Dr. B's Toots are classic and approachable and always a nice place to start.

Hope others get involved in teaching and guiding others for Csound.

Steven


On Mon, Dec 24, 2018 at 11:15 AM <brian@amsynth.com> wrote:
>
> Hi all,
>
> I recently got looking into a sound synthesis application called "Sonic Pi," and I found the tutorial page on the website to be really helpful in getting started. Like Csound, there's an immense amount of possibilities to play around with, making it seem (for some of us) a bit daunting.
>
> Since I personally prefer Csound for my instrument-making/playing, I've always checked out the Csound manuals as they come out afresh.
>
> At the same time, I'm feeling like it would be a really useful thing for people new to Csound, to have a basic tutorial similar to what's provided on the Sonic-Pi site -- to help people learn to create their own instruments. (I think I'd benefit from it myself!)  But I would need help from someone more experienced than me.
>
> I'd be happy to post the documentation on my own website.
>
> Would anyone be interested in collaborating on something like this?
>
>
>
> Curious to hear anyone's thoughts,
>
> brian
>
>
>
>
>
>
> 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
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

Date2018-12-25 12:46
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

Hi Steven and others,

This one at kunstmusik looks like the closest thing to what I mean. And it's definitely a good start. (There are so many options!)

The FLOSS manual is helpful, yes; and perhaps a bit easier than the other manuals. But what I'd like to do is a "walk-through" approach. (Maybe more than one, using different techniques.)

Also, I'm interested in the use of Csound locally rather than the SAS approach.

 

Crossing my fingers on this one..! :)

 

brian

 

On Mon, 24 Dec 2018 17:44:25 -0500, Steven Yi wrote:

Hi Brian,

Sounds great to me, though I don't have any time to contribute myself.
I did write a basic intro for instrument building here:

https://github.com/kunstmusik/csound-live-code/blob/master/doc/tutorial2.md

that works with the live.csound.com site.

Dr. B's Toots are classic and approachable and always a nice place to start.

Hope others get involved in teaching and guiding others for Csound.

Steven


On Mon, Dec 24, 2018 at 11:15 AM <brian@amsynth.com> wrote:
Hi all, I recently got looking into a sound synthesis application called "Sonic Pi," and I found the tutorial page on the website to be really helpful in getting started. Like Csound, there's an immense amount of possibilities to play around with, making it seem (for some of us) a bit daunting. Since I personally prefer Csound for my instrument-making/playing, I've always checked out the Csound manuals as they come out afresh. At the same time, I'm feeling like it would be a really useful thing for people new to Csound, to have a basic tutorial similar to what's provided on the Sonic-Pi site -- to help people learn to create their own instruments. (I think I'd benefit from it myself!) But I would need help from someone more experienced than me. I'd be happy to post the documentation on my own website. Would anyone be interested in collaborating on something like this? Curious to hear anyone's thoughts, brian 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

 

 

Date2018-12-25 22:29
Fromjoachim heintz
SubjectRe: [Csnd] Csound tutorial idea
hi brian -

just go ahead and count on me and others in reading and helping (if you 
like).  we always need new ways to get started, and we can link later to 
it in the way guillermo mentioned.

did you see the introduction at https://csound.com/get-started.html?

ciao -
	joachim



On 25/12/18 13:46, brian@AMSYNTH.COM wrote:
> Hi Steven and others,
>
> This one at kunstmusik looks like the closest thing to what I mean. And
> it's definitely a good start. (There are so many options!)
>
> The FLOSS manual is helpful, yes; and perhaps a bit easier than the
> other manuals. But what I'd like to do is a "walk-through" approach.
> (Maybe more than one, using different techniques.)
>
> Also, I'm interested in the use of Csound locally rather than the SAS
> approach.
>
>
>
> Crossing my fingers on this one..! :)
>
>
>
> brian
>
>
>
> On Mon, 24 Dec 2018 17:44:25 -0500, Steven Yi wrote:
>
>> Hi Brian,
>>
>> Sounds great to me, though I don't have any time to contribute myself.
>> I did write a basic intro for instrument building here:
>>
>> https://github.com/kunstmusik/csound-live-code/blob/master/doc/tutorial2.md
>>
>> that works with the live.csound.com site.
>>
>> Dr. B's Toots are classic and approachable and always a nice place to start.
>>
>> Hope others get involved in teaching and guiding others for Csound.
>>
>> Steven
>>
>>
>> On Mon, Dec 24, 2018 at 11:15 AM > wrote:
>>> Hi all, I recently got looking into a sound synthesis application
>>> called "Sonic Pi," and I found the tutorial page on the website to be
>>> really helpful in getting started. Like Csound, there's an immense
>>> amount of possibilities to play around with, making it seem (for some
>>> of us) a bit daunting. Since I personally prefer Csound for my
>>> instrument-making/playing, I've always checked out the Csound manuals
>>> as they come out afresh. At the same time, I'm feeling like it would
>>> be a really useful thing for people new to Csound, to have a basic
>>> tutorial similar to what's provided on the Sonic-Pi site -- to help
>>> people learn to create their own instruments. (I think I'd benefit
>>> from it myself!) But I would need help from someone more experienced
>>> than me. I'd be happy to post the documentation on my own website.
>>> Would anyone be interested in collaborating on something like this?
>>> Curious to hear anyone's thoughts, brian 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
>
>
>
>
> 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

Date2018-12-26 11:10
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

Hi Joachim,

ok, that's great!

Here is an idea for the first page. (For some reason I'm not hearing any output on my PC, even though there are no errors in performance. I'm not using Jack, so I thought it would automatically connect to Alsa or Pulseaudio as default, but still no sound. Is there a mistake here?) --

 

Let's get started making music with Csound!

Start by making a file, with any name you wish, but with .csd as the extension. This file is where we will make your instrument. It can be used directly in a terminal by typing for example, if your file is called "foo," the following command without the quotes: "csound foo.csd"   Another way to manage your .csd file is through an application that allows you to manipulate and test your file, such as QTcsound. There are also other frontend applications for managing Csound files such as Cabbage and Blue. For our initial tutorials, we will stay at the terminal (command line) level.

Now that you have your first Csound file, open it using a text editor of your choosing.
Csound basically requires 3 main sections. The first section is the options section, where you will need to specify some important things, such as your computer sample rate, your audio driver and your midi port, if needed.
The second section is called the Instrument Section and is where we will make our instrument, whether it be made of oscillators, audio samples, or what have you.
The third section is called the Score Section. This section can be used as a sequencer or even a full-scale instrument score, where notes and their expression can be indicated. Otherwise, this section can be used simply to denote the length you want the instrument to run for, such as 1 hour, 1 day or 1 year. This is used, for example, when you want to use an external MIDI controller to play your instrument live. As with all Csound files, to stop the program just press "ctrl" and "c" and it should stop. Using Csound from the terminal will allow you to see if it has indeed closed correctly, as well as if there were errors during performance.

So let's look at a Csound file to begin with:

<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1

instr 1
asound    rand    10000
out    asound
endin
</CsInstruments>

<CsScore>
il    0    10
</CsScore>

</CsoundSynthesizer>



brian


Date2018-12-26 16:44
FromPablo Frank
SubjectRe: [Csnd] Csound tutorial idea
Please upload these posts to the csound facebook group:


From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of brian@AMSYNTH.COM <brian@AMSYNTH.COM>
Sent: Wednesday, December 26, 2018 11:10 AM
To: CSOUND@LISTSERV.HEANET.IE
Subject: Re: [Csnd] Csound tutorial idea
 

Hi Joachim,

ok, that's great!

Here is an idea for the first page. (For some reason I'm not hearing any output on my PC, even though there are no errors in performance. I'm not using Jack, so I thought it would automatically connect to Alsa or Pulseaudio as default, but still no sound. Is there a mistake here?) --

 

Let's get started making music with Csound!

Start by making a file, with any name you wish, but with .csd as the extension. This file is where we will make your instrument. It can be used directly in a terminal by typing for example, if your file is called "foo," the following command without the quotes: "csound foo.csd"   Another way to manage your .csd file is through an application that allows you to manipulate and test your file, such as QTcsound. There are also other frontend applications for managing Csound files such as Cabbage and Blue. For our initial tutorials, we will stay at the terminal (command line) level.

Now that you have your first Csound file, open it using a text editor of your choosing.
Csound basically requires 3 main sections. The first section is the options section, where you will need to specify some important things, such as your computer sample rate, your audio driver and your midi port, if needed.
The second section is called the Instrument Section and is where we will make our instrument, whether it be made of oscillators, audio samples, or what have you.
The third section is called the Score Section. This section can be used as a sequencer or even a full-scale instrument score, where notes and their expression can be indicated. Otherwise, this section can be used simply to denote the length you want the instrument to run for, such as 1 hour, 1 day or 1 year. This is used, for example, when you want to use an external MIDI controller to play your instrument live. As with all Csound files, to stop the program just press "ctrl" and "c" and it should stop. Using Csound from the terminal will allow you to see if it has indeed closed correctly, as well as if there were errors during performance.

So let's look at a Csound file to begin with:

<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1

instr 1
asound    rand    10000
out    asound
endin
</CsInstruments>

<CsScore>
il    0    10
</CsScore>

</CsoundSynthesizer>



brian

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

Date2018-12-26 20:01
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

As I don't have a facebook account, it might be easier if you just link to the pages once I get them posted (or copy them to your facebook page).

For the moment I'm still getting the first pages together, so it's a bit early...

 

Brian

 

On Wed, 26 Dec 2018 16:44:44 +0000, Pablo Frank wrote:

Please upload these posts to the csound facebook group:

From: A discussion list for users of Csound on behalf of brian@AMSYNTH.COM
Sent: Wednesday, December 26, 2018 11:10 AM
To: CSOUND@LISTSERV.HEANET.IE
Subject: Re: [Csnd] Csound tutorial idea
 

Hi Joachim,

ok, that's great!

Here is an idea for the first page. (For some reason I'm not hearing any output on my PC, even though there are no errors in performance. I'm not using Jack, so I thought it would automatically connect to Alsa or Pulseaudio as default, but still no sound. Is there a mistake here?) --

 

Let's get started making music with Csound!

Start by making a file, with any name you wish, but with .csd as the extension. This file is where we will make your instrument. It can be used directly in a terminal by typing for example, if your file is called "foo," the following command without the quotes: "csound foo.csd"   Another way to manage your .csd file is through an application that allows you to manipulate and test your file, such as QTcsound. There are also other frontend applications for managing Csound files such as Cabbage and Blue. For our initial tutorials, we will stay at the terminal (command line) level.

Now that you have your first Csound file, open it using a text editor of your choosing.
Csound basically requires 3 main sections. The first section is the options section, where you will need to specify some important things, such as your computer sample rate, your audio driver and your midi port, if needed.
The second section is called the Instrument Section and is where we will make our instrument, whether it be made of oscillators, audio samples, or what have you.
The third section is called the Score Section. This section can be used as a sequencer or even a full-scale instrument score, where notes and their expression can be indicated. Otherwise, this section can be used simply to denote the length you want the instrument to run for, such as 1 hour, 1 day or 1 year. This is used, for example, when you want to use an external MIDI controller to play your instrument live. As with all Csound files, to stop the program just press "ctrl" and "c" and it should stop. Using Csound from the terminal will allow you to see if it has indeed closed correctly, as well as if there were errors during performance.

So let's look at a Csound file to begin with:




-d -odac



sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1

instr 1
asound    rand    10000
out    asound
endin



il    0    10






brian

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

 

 

Date2018-12-26 20:23
FromPete Goodeve
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-26 20:31
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

Hi Pete,

the error has been resolved (Joachim noticed it before I did). I had typed an "l" rather than a "1" in the score.

But here are the first two pages, not yet online though (suggestions welcome!)  --

 

Let's get started making music with Csound!

Start by making a file, with any name you wish, but with .csd as the extension. This file is where we will make your instrument. It can be used directly in a terminal by typing for example, if your file is called "foo," the following command without the quotes: "csound foo.csd"   Another way to manage your .csd file is through an application that allows you to manipulate and test your file, such as QTcsound. There are also other frontend applications for managing Csound files such as Cabbage and Blue. For our initial tutorials, we will stay at the terminal (command line) level.

Now that you have your first Csound file, open it using a text editor of your choosing.
Csound basically requires 3 main sections. The first section is the options section, where you will need to specify some important things, such as your computer sample rate, your audio driver and your midi port, if needed.
The second section is called the Instrument Section and is where we will make our instrument, whether it be made of oscillators, audio samples, or what have you.
The third section is called the Score Section. This section can be used as a sequencer or even a full-scale instrument score, where notes and their expression can be indicated. Otherwise, this section can be used simply to denote the length you want the instrument to run for, such as 1 hour, 1 day or 1 year. This is used, for example, when you want to use an external MIDI controller to play your instrument live. As with all Csound files, to stop the program just press "ctrl" and "c" and it should stop. Using Csound from the terminal will allow you to see if it has indeed closed correctly, as well as if there were errors during performance.

So let's start trying some examples. Copy the following text into your new .csd file:

<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
asound    rand    1
out    asound
endin
</CsInstruments>

<CsScore>
i1    0    10
</CsScore>

</CsoundSynthesizer>


After saving this code, try running it from your terminal. What you should hear are 10 seconds of white noise. So, let's evaluate what we've done:
Any Csound file must be contained within the <CsoundSynthesizer> and </CsoundSynthesizer> tags. Within the <CsOptions> and </CsOptions> tags we put the options which tell Csound to use the default audio system within your computer, and to output to the Digital-Audio-Converter (DAC). A nice feature that can be put here is to tell Csound to create a .wav file of whatever audio is produced when the program is run. If we want the .wav file to be called "Tom," this is what we would need to add in the code:

<CsOptions>
-d -odac  -o Tom.wav
</CsOptions>

NOTE: This addition will not output any actual audio to your speakers. Also, remember that the created audio file will be overwritten if the first file is not moved or renamed!

Okay, so what else is going on in this file? Moving to the area within the <CsInstruments> and </CsInstruments> brackets, we see that the sample rate (sr) is set to 44,100 Hz. If your audio system is set to another frequency, such as 48,000 Hz, you should change your Csound file to match this! The argument "ksmps" is the number of samples in a control period. It is recommended to use a number that is a power of 2. Increasing the ksmps, and/or reducing the sr, should lighten the load on CPU performance.
The number of audio channels is set to 2 (stereo), although monophonic audio output, as well as more complex audio output set-ups, are also possible. The argument 0dbfs = 1 is used as a standard for setting the maximum audio level, so in most cases this is the setting to use.

Moving on, we see the beginning of our instrument, denoted "instr 1." The "asound" argument was of our naming choice.. we could call it "atree" or "acar" or just about anything else, provided that it starts with "a," which tells Csound that we want to create an audio signal. What kind of audio signal?  Here, we have chosen to use a random signal called "rand." And the number 1 denotes the amplitude of this random audio signal. The "out" argument tells Csound to send the signal out of both speakers. The "endin" argument indicates the end of this instrument.

The last section is the Score section. Here we indicated instrument number 1 (i1) starting at 0 seconds and lasting for 10 seconds.

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

Now another example, adding a new type of sound. Create a new file (with a different name!) using the .csd extension and paste the following instrument into it, save, and run it in your terminal.

<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
asound    rand    1    ; white noise
out    asound
endin

instr 2
asound    oscil    1,440   ; single tone
out    asound
endin
</CsInstruments>

<CsScore>
i1    0    5
i2    6    5
</CsScore>

</CsoundSynthesizer>


This time we have added a second instrument, "instr 2." And while we have used the same "asound" argument in this second instrument, the "opcode" used to make the sound is called "oscil." This produces a simple, squarish tone, with amplitude of 1 and a pitch of 440 (Hz). NB: Audio signals in Csound will be denoted as amplitude (in this case "1"), frequency (in this case "440") and function (see the next example).

In the score, we have shortened our noise signal to 5 seconds starting at 0, and told "i2" to start this new instrument at 6 seconds and last for 5 seconds. (Notice the 1 second of silence from second 5 to second 6.)

We also added comments next to each instrument, marked with a semicolon (;). Comments made this way can be useful for us when making long scripts, and won't be seen by Csound. However, when using long comments, write your comments between these instead:  /*  and  */

Now let's take control of the tone that "oscil" is giving us. Try this file:


<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
ifn = p4
asound    oscil    1,440,ifn    ; read the f numbers below
outs    asound,asound
endin

</CsInstruments>

<CsScore>

f1    0    16384    10    1                                          ; Sine
f2    4    16384    10    1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   ; Sawtooth
f3    8    16384    10    1 0   0.3 0    0.2 0     0.14 0     .111   ; Square
f4    12    16384    10    1 1   1   1    0.7 0.5   0.3  0.1          ; Pulse

;p1    p2    p3    p4

i1    0    3    1
i1    4    3    2
i1    8    3    3
i1    12    3    4
</CsScore>

</CsoundSynthesizer>


For this example, we went back to using just one instrument, but with some improvements. For starters, we added an argument "ifn = p4." This tells Csound that when "oscil" produces a sound at 440 Hz, to use one of the waveforms that we have listed down in the score as f1, f2, f3 and f4. Which one? The one listed under the heading "p4." Under p1 we have the first instance of instrument 1, starting at 0 and lasting for 3 seconds. Csound will use f1 as this first tone. The second instance of instrument 1 will start at 4 seconds and last for 3 seconds, using the sawtooth tone (f2). And so on.

What is each of these f numbers telling us? They show the time that the waveform will start, the precision of the waveform in terms of quality (16384 is very precise), the "Gen code" (in this case, Gen10), and the harmonics to be used to form the wave signal. The sine wave, as we know, has in fact only one harmonic. F2, f3 and f4 are other types of waveforms we might be familiar with: the sawtooth wave, the square wave and the pulse wave.

Lastly, instead of a single "out," we have used "outs" and "asound,asound" to specify which speaker will reproduce which sound. So, we can imagine sending separate signals to each speaker, or percentages thereof, or whatever you might desire...

(This example was taken mostly from the "oscil" Opcode page at the Csound.com website, here: https://csound.com/docs/manual/index.html )

For a "bit crush" example using four sawtooth waveforms, try the instrument below. (When using the opcode "oscil," it is necessary to use powers of two when indicating the precision of a waveform. A different opcode, "poscil," doesn't require the number to be a power of two.)

<CsoundSynthesizer>

<CsOptions>
-d -odac
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
ifn = p4
asound    oscil    1,440,ifn    ; read the f numbers below
outs    asound,asound
endin

</CsInstruments>

<CsScore>

f1    0    16384    10    1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   ; Sawtooth 2^14
f2    4    256    10    1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   ; Sawtooth 2^8
f3    8    16    10    1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   ; Sawtooth 2^4
f4    12    8    10    1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111   ; Sawtooth 2^3

;p1    p2    p3    p4

i1    0    3    1
i1    4    3    2
i1    8    3    3
i1    12    3    4
</CsScore>

</CsoundSynthesizer>





Date2018-12-26 20:52
FromPete Goodeve
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-26 21:00
FromPete Goodeve
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-26 21:08
FromPablo Frank
SubjectRe: [Csnd] Csound tutorial idea
you can open an account with any email and any pseudo-name you choose. At the moment there are 410 members. Not doubt it's a good (at least) way to publish your work.


From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of brian@AMSYNTH.COM <brian@AMSYNTH.COM>
Sent: Wednesday, December 26, 2018 8:01 PM
To: CSOUND@LISTSERV.HEANET.IE
Subject: Re: [Csnd] Csound tutorial idea
 

As I don't have a facebook account, it might be easier if you just link to the pages once I get them posted (or copy them to your facebook page).

For the moment I'm still getting the first pages together, so it's a bit early...

 

Brian

 

On Wed, 26 Dec 2018 16:44:44 +0000, Pablo Frank wrote:

Please upload these posts to the csound facebook group:

From: A discussion list for users of Csound on behalf of brian@AMSYNTH.COM
Sent: Wednesday, December 26, 2018 11:10 AM
To: CSOUND@LISTSERV.HEANET.IE
Subject: Re: [Csnd] Csound tutorial idea
 

Hi Joachim,

ok, that's great!

Here is an idea for the first page. (For some reason I'm not hearing any output on my PC, even though there are no errors in performance. I'm not using Jack, so I thought it would automatically connect to Alsa or Pulseaudio as default, but still no sound. Is there a mistake here?) --

 

Let's get started making music with Csound!

Start by making a file, with any name you wish, but with .csd as the extension. This file is where we will make your instrument. It can be used directly in a terminal by typing for example, if your file is called "foo," the following command without the quotes: "csound foo.csd"   Another way to manage your .csd file is through an application that allows you to manipulate and test your file, such as QTcsound. There are also other frontend applications for managing Csound files such as Cabbage and Blue. For our initial tutorials, we will stay at the terminal (command line) level.

Now that you have your first Csound file, open it using a text editor of your choosing.
Csound basically requires 3 main sections. The first section is the options section, where you will need to specify some important things, such as your computer sample rate, your audio driver and your midi port, if needed.
The second section is called the Instrument Section and is where we will make our instrument, whether it be made of oscillators, audio samples, or what have you.
The third section is called the Score Section. This section can be used as a sequencer or even a full-scale instrument score, where notes and their expression can be indicated. Otherwise, this section can be used simply to denote the length you want the instrument to run for, such as 1 hour, 1 day or 1 year. This is used, for example, when you want to use an external MIDI controller to play your instrument live. As with all Csound files, to stop the program just press "ctrl" and "c" and it should stop. Using Csound from the terminal will allow you to see if it has indeed closed correctly, as well as if there were errors during performance.

So let's look at a Csound file to begin with:




-d -odac



sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1

instr 1
asound    rand    10000
out    asound
endin



il    0    10






brian

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

 

 
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

Date2018-12-27 00:02
FromPete Goodeve
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-27 01:13
FromPete Goodeve
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  None  ce3k.csd  

Date2018-12-27 02:59
FromPete Goodeve
Subject[Csnd] Conflicting '-d' option?
AttachmentsNone  

Date2018-12-27 09:33
FromVictor Lazzarini
SubjectRe: [Csnd] Conflicting '-d' option?
Daemon mode is --daemon
-d continues as before.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 27 Dec 2018, at 03:00, Pete Goodeve  wrote:
> 
> I've always been using '-d' on the command line to suppress displays,
> but I see in the '6.x' manuals it is also listed as setting 'daemon mode'.
> How would one separate the two cases, and what is the latter actually
> supposed to do?
> 
> Thanks,
> 
>    -- 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

Date2018-12-27 11:51
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

Hi Pete,

I'll be looking through your notes later on today. In order to free up the Csound Mailing List for other things, write to me directly at brian@amsynth.com for this tutorial project. (I think that's the way they'd prefer it.)  Then I'll write to you directly too.

Thanks!

brian

 

On Wed, 26 Dec 2018 17:13:53 -0800, Pete Goodeve wrote:

On Wed, Dec 26, 2018 at 04:02:26PM -0800, Pete Goodeve wrote:
I'm not happy about the "make a file with the extension .csd, then edit it" paradigm, because that's now how things happen
Oops!  "*not*  how things happen"....
on any system I'm familiar with. So I've rearranged the text a bit, there.
While I'm at it, a couple more points...
Moving to the area within theandbrackets, we see that the sample rate (sr) is set to 44,100 Hz. If your audio system is set to another frequency, such as 48,000 Hz, you should change your Csound file to match this!
I don't think this is at all important.  Any system I'm familiar with is
perfectly happy to convert whatever rate is set in Csound to its
own output rate.  There might be low-level resampling artefacts,
but it's probably "a topic for another time".
This time we have added a second instrument, "instr 2." And while we have used the same "asound" argument in this second instrument, the "opcode" used to make the sound is called "oscil." This produces a simple, squarish tone,
Actually it's a pretty good pure sine tone!

I was also thinking that you might want to skip some of your later
variations and move to a simple melody sequence.  One I've used
in a distribution has a rather familiar one!  Attached...

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

 

 

Date2018-12-27 20:12
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-27 20:28
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Conflicting '-d' option?
AttachmentsNone  

Date2018-12-27 20:36
Frombrian@AMSYNTH.COM
SubjectRe: [Csnd] Csound tutorial idea

You may be right. At any rate, it was Mr. Joachim's request. ;)

Understandibly, this could get long, and the ML might rather benefit from short requests.

 

On Thu, 27 Dec 2018 12:12:44 -0800, pete.goodeve@COMPUTER.ORG wrote:

On Thu, Dec 27, 2018 at 12:51:59PM +0100, brian@AMSYNTH.COMwrote:
Hi Pete, I'll be looking through your notes later on today. In order to free up the Csound Mailing List for other things, write to me directly at brian@amsynth.com for this tutorial project. (I think that's the way they'd prefer it.) Then I'll write to you directly too.
Hmm.  I can do that, but I'm not sure it *is* the right way.  The way I
understand it, this is the sort of thing this forum/ML is *for*!  Ideas
can be publicly viewed and commented upon.

I'd be glad for the opinions of others here.

Thanks,

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

 

 

Date2018-12-27 20:39
Fromjoachim heintz
SubjectRe: [Csnd] Csound tutorial idea
hi pete -

in my opinion, a mixture would be good.  i think it is too much to 
discuss every little step here, because this is mainly a list for 
questions using csound.  but from time to time show results and ask 
others for their opinion would be good.

cheers -
	joachim


On 27/12/18 21:12, pete.goodeve@COMPUTER.ORG wrote:
> On Thu, Dec 27, 2018 at 12:51:59PM +0100, brian@AMSYNTH.COM wrote:
>>
>>
>> Hi Pete,
>>
>> I'll be looking through your notes later on today. In
>> order to free up the Csound Mailing List for other things, write to me
>> directly at brian@amsynth.com for this tutorial project. (I think that's
>> the way they'd prefer it.) Then I'll write to you directly too.
>>
> Hmm.  I can do that, but I'm not sure it *is* the right way.  The way I
> understand it, this is the sort of thing this forum/ML is *for*!  Ideas
> can be publicly viewed and commented upon.
>
> I'd be glad for the opinions of others here.
>
> Thanks,
>
> 	-- 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

Date2018-12-27 20:47
FromVictor Lazzarini
SubjectRe: [Csnd] Conflicting '-d' option?
Thanks. Needs fixing. Would you care to open a ticket in the man repo?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 27 Dec 2018, at 20:28, pete.goodeve@COMPUTER.ORG  wrote:
> 
>> On Thu, Dec 27, 2018 at 09:33:16AM +0000, Victor Lazzarini wrote:
>> Daemon mode is --daemon
>> -d continues as before.
>> 
> Thanks for clarifying.  This seems to be an error in the manual, then.
> Looking at the 'command line flags' section of the 6.12 manual, "--daemon"
> is not defined anywhere (though "-d" is said to set daemon-mode), and only
> referenced in the "--port=N" flag description.
> 
>    -- 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

Date2018-12-27 20:58
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Conflicting '-d' option?
AttachmentsNone  

Date2018-12-27 21:04
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Csound tutorial idea
AttachmentsNone  

Date2018-12-27 21:09
FromVictor Lazzarini
SubjectRe: [Csnd] Conflicting '-d' option?
Thanks. Please use the manual tracker

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 27 Dec 2018, at 20:58, pete.goodeve@COMPUTER.ORG  wrote:
> 
>> On Thu, Dec 27, 2018 at 08:47:10PM +0000, Victor Lazzarini wrote:
>> Thanks. Needs fixing. Would you care to open a ticket in the man repo?
> 
> I guess I shouls be able to do that.  (I have for other projects, but never 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

Date2018-12-27 22:03
Fromjpff
SubjectRe: [Csnd] Conflicting '-d' option?
The manual sources have many cases of -daemon, fitr example in the flags 
sections.  Which manual are you reading?  I am not sure I have seen 
numbered sections.



On Thu, 27 Dec 2018, pete.goodeve@COMPUTER.ORG wrote:

> On Thu, Dec 27, 2018 at 09:33:16AM +0000, Victor Lazzarini wrote:
>> Daemon mode is --daemon
>> -d continues as before.
>>
> Thanks for clarifying.  This seems to be an error in the manual, then.
> Looking at the 'command line flags' section of the 6.12 manual, "--daemon"
> is not defined anywhere (though "-d" is said to set daemon-mode), and only
> referenced in the "--port=N" flag description.
>
> 	-- 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

Date2018-12-27 22:14
FromPete Goodeve
SubjectRe: [Csnd] Conflicting '-d' option?
AttachmentsNone  

Date2018-12-27 22:26
FromPete Goodeve
SubjectRe: [Csnd] Conflicting '-d' option?
AttachmentsNone  

Date2018-12-28 17:01
Fromjpff
SubjectRe: [Csnd] Conflicting '-d' option?
I found the typo and corrected it
==John ff

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