Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic csound output #275

Merged
merged 21 commits into from Dec 2, 2022
Merged

add basic csound output #275

merged 21 commits into from Dec 2, 2022

Conversation

felixroos
Copy link
Collaborator

@felixroos felixroos commented Dec 1, 2022

usage example:

note("c3").csound("<Organ1 Organ2>")

you can also define a custom instrument like this:

await csound`
instr CoolSynth
    iduration = p3
    ifreq = p4
    igain = p5
    ioct = octcps(ifreq)

    kpwm = oscili(.05, 8)
    asig = vco2(igain, ifreq, 4, .5 + kpwm)
    asig += vco2(igain, ifreq * 2)

    idepth = 2
    acut = transegr:a(0, .005, 0, idepth, .06, -4.2, 0.001, .01, -4.2, 0) ; filter envelope
    asig = zdf_2pole(asig, cpsoct(ioct + acut + 2), 0.5)

    iattack = .01
    isustain = .5
    idecay = .1
    irelease = .1
    asig *= linsegr:a(0, iattack, 1, idecay, isustain, iduration, isustain, irelease, 0)
    
    out(asig, asig)
endin`

note("c3").csound('CoolSynth')

update: now also added loadOrc to be able to load a .orc from a url. example:

// livecode.orc by Steven Yi
await loadOrc('github:kunstmusik/csound-live-code/master/livecode.orc')
note("c4").csound('FM1') // FM1 is defined in livecode.orc

@felixroos
Copy link
Collaborator Author

I think this is ready for merge. The integrations is not yet complete, as control values have to be wired up by hand (if needed), but it should be a good state for further experimentation + something to gather feedback from csounders. also, the synths sound so much better than stock waveforms :)

@felixroos felixroos merged commit 01eca56 into main Dec 2, 2022
@felixroos felixroos deleted the csound branch December 2, 2022 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant