Reforming the Structure of the Advance (a) Statement

Greetings, fellow Csounders.

My name is Nick Suda. I'm a Berklee student and a Csound newbie, studying under Dr. B for the past two months. During the course of learning the fundamentals of Csound's syntax by working through the Chapter 1 Etudes of The Csound Book, three ideas occurred to me about possible tweaks to the syntax of Csound that Dr. B liked. He encouraged me to share these ideas with the community, both on this forum and the mailing list, so as to begin a dialogue about possible ways of implementing them.

This post is the first of the three ideas. Let's use the aforementioned Etudes as the platform for demonstration.

As early as Etude 2, Dr. B uses an advance statement.

(excerpt from Etude 2)

;inst start duration
a 0 0 7
i107 0 1 10000 440 1
i107 1.5 1 20000 220 2
i107 3 3 10000 110 2
i107 3.5 2.5 10000 138.6 2
i107 4 2 5000 329.6 2
i107 4.5 1.5 6000 440 2

i108 7 1 10000 440 1 2 3 1
i108 8.5 1 20000 220 1 13 8 1
i108 10 3 10000 110 1 1 13 1
i108 10.5 2.5 10000 130.8 1 2.001 8 1
i108 11 2 5000 329.6 1 3.003 5 1
i108 11.5 1.5 6000 440 1 5.005 3 1

(end excerpt)

Each "block" of the piece first auditions a waveform, and then another waveform, and then arpeggiates a chord with the second waveform. Dr. B has used an advance statement to simply skip the first of several of these "blocks" when you first compile the piece.

At this very simple, didactic level of syntax usage, it's easy to see where the advance statement (a 0 0 7) throws you in the piece: The second p-field shows you that it's the beginning of the second "block."

Examination of the advance (a) statement is not detailed until Etude 5, when all shortcuts of the note list are delineated, including ramp (>), carry (.), add (+) and section (s). Despite its limited use until this point, it seemed to me already in conflict with the format of the section (s) statement.

In the realm of common and practical uses of Csound, I realize that Csound's modern integration into other musical resources seldom incoporates the note list, thanks to MIDI-control, the turnon opcode and other such introductions that have made Csound's approach to "sequencing" rather more difficult and archaic.

However, most of the ways in which the section (s) statement is used in Csound files that use the note list make the information significantly more legible as units of action, perhaps as measures or phrases. Take the very logically organized drumMachine.csd:

(excerpt from drumMachine.csd)

r 4
i1 0 0.25 5000
i1 0.25 0.25 5000
i1 0.5 0.25 5000
i1 0.75 0.25 5000
i1 1 0.25 5000
i1 1.25 0.25 5000
i1 1.5 0.25 5000
i1 1.75 0.25 5000
i1 2 0.25 5000
i1 2.25 0.25 5000
i1 2.5 0.25 5000
i1 2.75 0.25 5000
i1 3 0.25 5000
i1 3.25 0.25 5000
i1 3.5 0.25 5000
i1 3.75 0.25 5000

i2 0.5 1 5000
i2 1.5 1 5000
i2 2.5 1 5000
i2 3.5 .5 5000

i3 0 0.25 100
i3 0.375 0.25 100
i3 0.75 0.25 100
i3 1.25 0.25 100
i3 2 0.25 100
i3 2.375 0.25 100
i3 2.75 0.25 100
i3 3.25 0.25 100
i3 3.75 0.25 100

i4 0 0.25 5000 6.00 .02 .01
i4 0.375 0.25 . 6.03 . .
i4 0.75 0.25 . 6.05 . .
i4 1.25 0.25 . 6.06 . .
i4 2 0.25 . 6.07 . .
i4 2.375 0.25 . 6.04 . .
i4 2.75 0.25 . 6.10 . .
i4 3.25 0.25 . 6.08 . .
i4 3.75 0.25 5500 6.07 . .
s

i1 0 0.25 5000
i2 0 1 5000
i3 0 0.25 100
i4 0 3.85 5000 6.00 .02 .01
s

(end of excerpt)

Repeat the little riff four times and then use a new section (section 5) to give a kick, a crash, a snare, and a "do" in the bass.

This is a really self-contained execution, however, and it doesn't interface well with more going on around it: a changing chord progression, a dynamic melody, etc. in other words, things that would make it confusing for the beginning of this phrase to begin on 0 again, because other parts of the music are different lengths than what this phrase has defined as "the beginning."

Let's look at a similar concept recalling macros as entire "measures" in a way that is note-list like and would make sense to someone used to using a sequencer:

(excerpt from beatMacroPopStutter.csd)

;Start

;INSTR START DUR SKIP AMP
$THEBEAT $m(1'1) $w 0 1
$THEBEAT + $w . .

;Stutter
$THEBEAT $m(2'4) $th $q .5
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + [$th / 2] . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .

$THEBEAT $m(3'1) $w 0 1
$THEBEAT + $hd . .

$TABLESTART $m(4'4) $s 0 .5
$TABLEREV $m(4'4.25) $s $s .5
$TABLESTART $m(4'4.5) $s 0 .5
$TABLEREV $m(4'4.75) $s $s .5

;Start Changing the beat
$THEBEAT $m(5'1) $e 0 1
$THEBEAT + $e 0 .
$THEBEAT + $s $q .
$THEBEAT + . . .5
$THEBEAT + [$h + $e] [$q + $e] 1

$THEBEAT $m(6'1) $w 0 .

$THEBEAT $m(7'1) $e 0 1
$THEBEAT $m(7'1.25) $e $q .5
$THEBEAT $m(7'2) $q $q 1
$THEBEAT $m(7'2.75) $e $hd .5
$THEBEAT $m(7'3.25) $e $hd .5
$THEBEAT $m(7'3.5) $q 0 1
;stutter
$THEBEAT $m(7'4) $th $hd .5
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + $e . 1

$THEBEAT $m(8'1) $q 0 1
$THEBEAT $m(8'2) $e 0 .
$THEBEAT $m(8'2.5) $e $q .
$THEBEAT $m(8'3) $h $h .
;stutter
$THEBEAT $m(8'4) [$th / 2] $q .3
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + [$th / 2] $q .3
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + [$th / 4] . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + [$th / 8] 0 .1
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + [$th / 16] . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .
$THEBEAT + . . .

$THEBEAT $m(9'1) $w 0 1
$THEBEAT $m(10'1) $w 0 1

(end of excerpt)

Most Csound files that use the notelist beyond turning things on and leaving them on kind of tend to fall into a bipolar structure: Either they are less committed to 4/4 sequencing because they are less "poppy" in nature ("Trapped in Convert"), and so sectioning is used merely as bookmarks for chapters of the piece, or because of the fundamentally different structure going into the piece, you want to be more like a traditional sequencer (the previous two examples above).

I think there needs to be some way wherein the advance statement's "universal timeline" of total rendering seconds that have elapsed in the piece lines up with the section statement's "contextual timeline" of duration since the last section statement reset all start times to 0 again. As it is, there is no continuum between the two and it makes for a very "blindfolded dart throwing" approach to skipping somewhere within a piece.

What if I want to listen to the pitch of one specific note I've changed, when it's in the middle of section 4? The only way I can roughly get to just that part is by adding up the end start times of the last note of all the previous sections and put in an advance statement at the beginning of the piece close to the sum of those numbers. That's pretty clunky.

Whereas the other two ideas I have imply only modification to existing syntactical structures by replacing arguments in the orchestra with variable commands, this one actually necessitates an addition to the syntax of the note list.

Which one gets extra numbers tacked onto it, so as to stay future-proof? Does the section statement necessitate a reference to overall time next to it (s 122), or does the advance statement abandon total duration and reference sections (a 2.75 s 4)? I don't think either of these are future-proof and backwards compatible.

I want to hear your ideas for how this conflict could be rectified syntactically.

Thanks to all,

Nick Suda
Renton, WA
nick.suda@gmail.com

AttachmentSize
_etude2.csd3.21 KB
drumMachine.csd3.35 KB
beatMacroPopStutter.csd5.53 KB
_etude5.csd12.47 KB

re: Reforming the Structure of the Advance (a) Statement

I agree that the a statement could be more flexible and intuitive. Macros, as cool as they are, aren't exactly the type of things newbies dive right into. But the a statement is useful for debugging a score (..."debugging a score"...only in Csound!) no matter what level you're at.

I think these solutions could very well be backwards compatible. Simply making the arguments optional requires a default setting, which would just be for them to act the way they always have. I remember having problems with this as well (in Dr. B's class!) and kind of wished there was just another score statement altogether that worked like goto-label, though now I realize that might not make much sense. I do like the idea of labeling sections, though. That way, given your first solution, you wouldn't have to figure out a reference time for it. Though this way would combine your solutions (and perhaps complicate it), I think it would be more intuitive to work with. Say I wanted to go two seconds past a section. It might look something like this:

a 2 Chorus

[...]

s Chorus
i1 0 2
i. + . <--jump to here

With this, one could easily cut and paste sections around without worrying about renumbering sections. Of course, this could still allow for unlabeled sections to be given numbers, so someone could just choose to type "a 2 2" if they wanted. There would just be the risk of sections being renumbered when editing the score.

Perhaps it's more complicated, but I think it adds some flexibility to it. I don't know, just some ideas :-).

great idea

That is a great idea. It never occurred to me to name the sections.

buy zithromax kamagra uk cheap generic viagra viagra uk zpack z-pack staxyn Canadian pharmacy z-pak z pak cialis online pharmacy uk ed drugs buy viagra uk cialis uk avanafil z pack Canadian pharmacy viagra generic viagra zpak viagra online ed pills generic cialis