gogins / yarns

Forked from hellochar.com to develop visual music.
http://gogins.github.io
MIT License
0 stars 0 forks source link

Swum #1

Closed gogins closed 6 years ago

gogins commented 6 years ago

Visual music based on the "Flame" sketch of Zhang. Options:

  1. Key bindings to create chord progressions/voice-leadings, and that also feed parameters to the flame.
  2. Use the existing key bindings (string hash of a word generates parameters for the flame), but also derive Csound score events from them.

In any case the input element for the word must be removed or hidden.

I will also want to change the appearance of the flame, something thicker and more atmospheric would be good.

I will want to try loading the WebAssembly stuff using requirejs.

gogins commented 6 years ago

Got Zhang's site narrowed down to just the flame, made the input field invisible. To do:

  1. Import Csound for WebAssembly. Look at https://github.com/ballercat/wasm-loader. Oh wait, this looks like it: https://www.npmjs.com/package/wasm-emscripten-loader. No, maybe this: https://www.npmjs.com/package/emscripten-wasm-loader. And look at this: https://github.com/webpack/webpack/issues/7352 and https://github.com/kripken/emscripten/pull/6483. The issue will become moot when Emscripten builds ES6 modules.
  2. Add Csound orchestra, Csound message console, and dat.gui controls to the flame page.,
  3. Add clabber and use that for parameters of the flame.
gogins commented 6 years ago

No time to mess with ES6 modules or even with WebPack. I'm loading CsoundAudioNode in the index HTML. It's now loading...

Tore out Zhang's WebAudio code. Next task is to embed Csound and clabber in the flame page.

gogins commented 6 years ago

All pieces tied together albeit in most hackish ways.

It's clear that clubber to string name isn't the way to go, variations are too similar, also smoothly interpolating between perameters would be good.

I could change the hash function to better suit clubber but I think it will be better to put in keys to generate chord progressions and voice-leadings and to try using the chord voices with the existing hash function.

Annoying bug in that the score always only plays 36 seconds. Not sure why.

gogins commented 6 years ago

Replaced Ambisonic csd with Drone IV. Not stopping now. Removed all style sheets so that now UI elements do not hide each other. To do:

  1. Better instruments, create "edit script", need pads with internal evolution as in Drone IV and also some sounds with sharper attacks.
  2. Still not fitting canvas into window on first opening. Fix that.
  3. Keystrokes for generating notes from chords. I could use PTIVa or I could use KQT, will probably use that. Option for revoicing and for voiceleading. Push user into onto a stack until "enter" is received, then generate chord and notes.
  4. Thicker flames, possible changes in flame generating algorithm.
gogins commented 6 years ago

I made hear_patch.py which works great, no idea why I didn't do this before, looks to greatly speed instrument development and tweaking.

gogins commented 6 years ago

This is now a piece. It still needs work.

Duration -1 works fine. Notes now turn off with the d opcode. Voiceleading seems to be working well enough. Appearance is good, sounds are pretty good. To finish the piece I need:

  1. Better key bindings.
  2. Better sounds.
  3. No glitches.
  4. Possibly, tie overlapping notes between chords. In reality, this would mean not turning off notes and turning them on again.
gogins commented 6 years ago

For glitches I have switched to ftgen above instr blocks rather than ftgenonce within instr blocks, and I am using prealloc. If there is still a problem I can try not using the signal flow graph opcodes (but they do really simplify things). After that the only choice is simpler instruments.

For better key bindings I should pick up numeric values only in one case, and the command keystrokes should simply be letters, no combination keystrokes. The commands should be:

  1. c: create a note from the chord.
  2. v: create a note from the chord with the closest voiceleading from the prior chord.
  3. t: apply the T(N) transformation.
  4. i: apply the I transformation.
  5. k: apply the K transformation.
  6. q: apply the Q(N, modality) transformation.
  7. r: apply an octavewise revoicing, i.e. the v(N) transformation.
  8. p: play the piece.
  9. s: stop the piece.
  10. h: toggle the controls.

Then I need to practice and make a note of artistically useful sequences of commands.

gogins commented 6 years ago

Done all that, now working on the arrangement. Problems. I did learn something: if using i for note on and d for note off, thus requiring releasing envelopes, there needs to be a p3 (i.e. -1) segment in the envelope. This is documented but I failed to understand the manual.

Update: not quite true. There appears to be a bug in Csound whereby in this case, for simultaneously sounding notes for an instrument all of which have indefinite duration, the instrument numbers must be distinct!

I can't add this to the voice index of the chord, it has to be in the Event object.

gogins commented 6 years ago

Tried that, it starts up the notes but now they don't turn off! I'll have to look at the Csound source code.

gogins commented 6 years ago

There are problems with note off and note on, but I think it's manageable. They key is not to use fractional instrument numbers, but rather i and d opcodes, and to have the right kind of releasing envelope. It has to continue for some time but then release at the end of the note.

I having problems with the FM water bell however. I can't seem to get the envelope to work right.

gogins commented 6 years ago

Coming along great!

  1. More "alive" sounds.
  2. Some more percussive or bell-like, pluck-like, something sounds. Just need two.
  3. Just chords is boring. Needs what? An arpeggiator? That could be the "R" key that automatically makes a chord. Some gaps? A jspline or rspline to vary the level of the individual instruments? A keystroke to change dynamics?
  4. Maybe a "D" for T(5) key binding. Done.
  5. Definitely an "F" for fullscreen key binding (no non-default for "F11"). Done.
  6. Needs to end at 6 minutes! Use a fade out. Done.

The danger as always is the fine line between pretty and cheesy. It will be nothing if it's not pretty, and it is, but it's too often cheesy.

What will be effective is to vary the tempo of changes, and at times just rest on a chord to let the moving sounds move.

The console window needs to be just a bit wider to show a whole event on one line.

gogins commented 6 years ago
  1. A key binding so that "R" also does "C". Done.
  2. Decaying envelope on the FMWaterBell. Done, sort of.
  3. Arpeggiation on attacks -- random selection of onset delays. Maybe in addition to "C", e.g. "A". Done.
  4. Dynamics up and down with a key binding. Done with "L" for louder and "M" for softer. Done.
gogins commented 6 years ago

I will leave this issue open until the performance but I am moving on to Parachronic.

gogins commented 6 years ago

yarn start Sample rate must match in src/index.template.html.

gogins commented 6 years ago

Went OK! Post live version? Variant with automated changes that also allows manual changes.