Skip to content

General remarks on improvements of examples

Menno Knevel edited this page Aug 10, 2022 · 3 revisions

The basic layout

  • examples should just work out of box.

  • all examples should work from the terminal on the 3 main platforms OSX, Windows and Linux

  • same header for all the examples

    sr = 44100

    ksmps = 32

    nchnls = 2

    0dbfs = 1

all of these could be guides for future examples, but we should be very careful if we change any existing examples. iirc some opcodes don't respect 0dbfs. There may be exceptions: some examples require sr = 96000 in case of aliasing. In that case i think it might be worth to add a comment why this sr is so high. AND we need to be careful changing examples historically. AND Perhaps we wrap the parts that need to be at that rate in a udo with setksmps=1

  • all the examples that use live input - that use the -adc flag, make source a mono one: for one mic

  • Example filenames:

    If only one example file used:

  • opcodename.csd - the most basic display of the essence of the opcode. Why does this opcodes exist? Why is it different from other (similar) opcodes, who needs it?
    

    If there are multiple examples:

  • opcodename.csd - the most basic display of the essence of the opcode. Why does this opcodes exist? Why is it different from other (similar) opcodes, who needs it?
    
  • opcodename-2.csd - another most basic display of the essence of the opcode. On the same level as opcodename.csd
    
  • opcodename-advanced.csd - in what kind of situation/environment is the opcode needed? What is its interaction with other code?
    
  • opcodename-musical.csd - a cool musical gesture
    

Musical examples

  1. a new musical-examples folder in the top tree
  2. link from the concerning opcodes to that folder
  3. no musical example is visible directly on the manual page

group examples

  1. opcodes that are nearly identical but have (slightly) different applications

  2. all the members of this group get the same group example as a secondary example, or at least NOT as the first example

  3. user can make better decision on which opcode is best suited for his/her needs, based on the group example

  4. candidates for the group example

    outq1, outq2, outq3, outq4

    ampdb, ampdbfs, db, dbamp, dbfsamp

    in32, inh, etc

    ceil, round, int, floor --> done

    adsr, xadsr, madsr, mxadsr --> done


MIDI examples

  1. every “midi opcode” example could have 2 instruments: 1 with real time midi and 1 with a midi file. How to switch easily or how to manage midifile playing and 'playing along' with an active midi input port as well??

  2. -odac -m0 --midi-key=4 --midi-velocity-amp=5 ; treat p4 and p5 as midi data like mxadsr https://csound.com/manual/mxadsr.html


Further thoughts

Victor: widgets in FLTK seem OK on Linux but remain problematic in MacOS

These will never work on MacOS because of threading issues. We cannot use them on that system and there is no solution for it.

  • TCL/TK (button,checkbox etc.) is not a serious replacement as it is hardly available on the 3 platforms

  • send out a message to the forum on a regular basis, and to ask people to send in their reactions on existing, bad or missing examples or asking for musical examples

  • add a section of the manual that discusses the caveats of the frontends

  • new opcodes and manual pages have been added recently, these 2 examples both use the virtual keyboard and thus FLTK.