csound / manual

Csound Reference Manual (English)
Other
45 stars 29 forks source link

Prewritten melody include file #479

Open tgrey1 opened 3 years ago

tgrey1 commented 3 years ago

Also mentioned over here: https://github.com/csound/manual/issues/459#issuecomment-725779555

The team had discussed the idea of writing a few melodies in an include file to use as sco macros in examples.

@csounder suggested Twinkle Twinkle Little Star, Mary Had a Little Lamb. Any other suggestions?

Thoughts on how to write them to best be used? I think it would be good to make it possible to trigger at different times and with different instruments.

For example (not finalized, just an idea):

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac      ;;;realtime audio out
; For Non-realtime ouput leave only the line below:
; -o A4.wav -W ;;; for file output any platform

; By Stefano Cucchi - 2020

</CsOptions>
<CsInstruments>

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

#define STANDARDPITCH #440# ; as set by ISO 1975:16 - STANDARD MUSICAL PITCH
#define BAROQUEPITCH #415# ; common use (but not standard) in Baroque era (1600 - 1750)
#define HIGHER #443# ; some orchestras, mainly in Europe use higher pitch (442-443 Hz)

#define EXPRESSION #(440*1.3)+200# ; you can use an expression

A4 = $STANDARDPITCH
;A4 = $BAROQUEPITCH
;A4 = $HIGHER

;A4 = $EXPRESSION

instr 1

ipch =  p4
icps =  cpspch(ipch)
asig    oscil 0.7, icps, 1
    outs  asig, asig

endin

</CsInstruments>
<CsScore>

f 1 0 4096 10 1 0.3 0.2. 0.1

#include "Melodies.sco.inc"

; start Bach theme at 0 seconds with instr 1
$BACH(0'1)

; start Twinkle theme at 16 seconds with instr 2
$TWINKLE(16'2)
e

</CsScore>
</CsoundSynthesizer>
tgrey1 commented 3 years ago

The include could then be something like this:

; Theme from Bach BWV 578 -  Little fugue in G minor.
#define BACH(time'instr) #
i$instr $time 1 7.07
i$instr + 1 8.02
i$instr + 1.5 7.10
i$instr + .5 7.09
i$instr + .5 7.07
i$instr + .5 7.10
i$instr + .5 7.09
i$instr + .5 7.07
i$instr + .5 7.06
i$instr + .5 7.09
i$instr + 1 7.02
#

; Twinkle Twinkle Little Star
#define TWINKLE(time'instr) #
i$instr $time .5 8.00
i$instr + .5 8.00
i$instr + .5 8.07
i$instr + .5 8.07
i$instr + .5 8.09
i$instr + .5 8.09
i$instr + 1 8.07
i$instr + .5 8.05
i$instr + .5 8.05
i$instr + .5 8.04
i$instr + .5 8.04
i$instr + .5 8.02
i$instr + .5 8.02
i$instr + 1 8.00
#

; Mary Had a Little Lamb
#define MARY(time'instr) #
i$instr $time .5 8.04
i$instr + .5 8.02
i$instr + .5 8.00
i$instr + .5 8.02
i$instr + .5 8.04
i$instr + .5 8.04
i$instr + 1 8.04
i$instr + .5 8.02
i$instr + .5 8.02
i$instr + 1 8.02
i$instr + .5 8.04
i$instr + .5 8.07
i$instr + 1 8.07
#
csounder commented 3 years ago

given that they were raised on MIDI, you might imagine that most of my students are not particularly fond of cpspch notation. they always prefer notelists in cpsmidinn (just a thought to consider when 'notating' these melodies.

but cpspch is good.

you might consider some English carol or if you are going to include BACH - you should at least include CAGE and The Close Encounters Theme too! (historically important)

Boulanger

On Wed, Nov 11, 2020 at 9:15 PM tgrey1 notifications@github.com wrote:

Also mentioned over here: #459 (comment) https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzQ1OSNpc3N1ZWNvbW1lbnQtNzI1Nzc5NTU1&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=c3piRW1rS1k5VUJSckZYY0U0R0t5QTFKTGtjaC9UbzJFZlYrdTUwbFEvWT0=&h=286d3ba569064a318087e5931c293bb1

The team had discussed the idea of writing a few melodies in an include file to use as sco macros in examples.

@csounder https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZGVy&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=TlVwcHBEV2pBaktPNXN6d2grZnhkbEZVMWxyQmxSTUpReUFBOHcxcTZjMD0=&h=286d3ba569064a318087e5931c293bb1 suggested Twinkle Twinkle Little Star, Mary Had a Little Lamb. Any other suggestions?

Thoughts on how to write them to best be used? I think it would be good to make it possible to trigger at different times and with different instruments.

For example (not finalized, just an idea):

; Select audio/midi flags here according to platform -odac ;;;realtime audio out; For Non-realtime ouput leave only the line below:; -o A4.wav -W ;;; for file output any platform ; By Stefano Cucchi - 2020 sr = 44100ksmps = 32nchnls = 20dbfs = 1#define STANDARDPITCH #440# ; as set by ISO 1975:16 - STANDARD MUSICAL PITCH#define BAROQUEPITCH #415# ; common use (but not standard) in Baroque era (1600 - 1750)#define HIGHER #443# ; some orchestras, mainly in Europe use higher pitch (442-443 Hz)#define EXPRESSION #(440*1.3)+200# ; you can use an expressionA4 = $STANDARDPITCH;A4 = $BAROQUEPITCH;A4 = $HIGHER;A4 = $EXPRESSIONinstr 1ipch = p4icps = cpspch(ipch)asig oscil 0.7, icps, 1 outs asig, asigendin f 1 0 4096 10 1 0.3 0.2. 0.1#include "Melodies.sco.inc"; start Bach theme at 0 seconds with instr 1$BACH(0'1); start Twinkle theme at 16 seconds with instr 2$TWINKLE(16'2)e

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzQ3OQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=QldxRERVMVlzYURhTUR0UGdpSmcyY3RXN1hRVnFHWkFQKzlKaDREa3JEOD0=&h=286d3ba569064a318087e5931c293bb1, or unsubscribe https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZTTjZLNjUzTUZYR0RRNUs1RFNQTkFOSEFOQ05GU000VFNXUFdKUQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=SUVQQ0xIa1F3N0FyU0VNQmxJYjJPL21vU3pTNlQ5akVPcTJ5cDdVVmhEUT0=&h=286d3ba569064a318087e5931c293bb1 .

tgrey1 commented 3 years ago

Of course, nothing here is complete yet... I just wanted to get a proof of concept showing how it would work and be used in a real working example.

My argument for using cpspch is that it's easy to recognize and work with alter octaves without having to do math... but I'm open to changing it to note numbers too, or maybe even having macro versions using both.

Close Encounters would be a fantastic choice! For Cage, I think @AsterixMusic has a 4:33 rendition we could pull some excerpts from! 👍

csounder commented 3 years ago

Funny about 4:33. I meant the notes C A G E

Dr. Richard Boulanger Professor Electronic Production and Design Berklee College of Music

On Nov 12, 2020, at 2:21 AM, tgrey1 notifications@github.com wrote:

 Of course, nothing here is complete yet... I just wanted to get a proof of concept showing how it would work and be used in a real working example.

My argument for using cpspch is that it's easy to recognize and work with alter octaves without having to do math... but I'm open to changing it to note numbers too, or maybe even having macro versions using both.

Close Encounters would be a fantastic choice! For Cage, I think @AsterixMusic has a 4:33 rendition we could pull some excerpts from! 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.