gogins / michael.gogins.studio

Studio of Michael Gogins: computer music, photographs, writings.
4 stars 0 forks source link

Piece for 2024 ICSC #69

Open gogins opened 6 months ago

gogins commented 6 months ago

I actually will prepare the following pieces in parallel and submit the best:

Finishing the piece:

Things I need to do before the conference:

gogins commented 5 months ago

For cloud-5 type pieces, add a button to start/stop recording to file with fade in/fade out. Victor has a tutorial that shows how to upload and download files that Csound can read or has written here.

gogins commented 1 month ago

Create key bindings for the following inputs:

cloud5_piece.menu_slider_addon(Composition, "NoteTempo", 0, 200);
cloud5_piece.menu_slider_addon(Composition, "NoteDensity", 5, 200);
cloud5_piece.menu_slider_addon(Composition, "NoteDurationFactor", 0., 5.);
cloud5_piece.menu_slider_addon(Composition, "GraphicsTempo", .0, .25);
cloud5_piece.menu_slider_addon(Composition, "GraphicsHue", 0., 1.);
cloud5_piece.menu_slider_addon(Composition, "GraphicsValue", 0., 1.);

Key bindings will be as mnemonic as possible and use [Ctrl][Alt] with [Shift] for decrease and no shift for increase:

n NoteTempo
d NoteDensity
f NoteDurationFactor
g GraphicsTempo
h GraphicsHue
v GraphicsValue

The handler will increment (no [Shift]) or decrement [Shift] the parameter value in steps of size range/100; minimum and maximum values will simply peg.

gogins commented 1 month ago

I wasted time getting the fade in and fade out to work because turnoff2 turned off the master output without releasing its cossegr envelope. Changing that to linsegr works.

gogins commented 1 month ago

Submitted the piece, 2024-ICSC.html here at commit 03e599266139bb18baa9ec18d1580ed5c7a1ff1f.

gogins commented 1 week ago

Perhaps not done here. Control the piece from my phone or from a dedicated MIDI controller.

gogins commented 1 week ago

Possibly usable sensors on the phone:

  1. TYPE_GRAVITY, force of gravity relative to X, Y, Z.
  2. TYPE_ROTATION_VECTOR.
  3. But see https://developer.android.com/develop/sensors-and-location/sensors/sensors_position#sensors-pos-orient, how to compute rotations in radians of device relative to magnetic north.

Note: X is left to right, Y is bottom to top, Z is back to front.

gogins commented 1 week ago

The Csound for Android app claims to have the OSC opcodes. I could design a custom GUI and send control parameters from a piece running on my phone through OSC to the actual piece running on my MacBook. I will try this.

gogins commented 1 week ago

There are Android apps for OSC including OSC Controller, TouchOSC, and Sensors2.OSC.

I will test with OSC Controller and if things work, will switch to TouchOSC.

gogins commented 1 week ago

The receiver is controlling data in the JavaScript context so needs to be JavaScript, see https://github.com/colinbdclark/osc.js/. This looks good, but there are hoops to be jumped through. Maybe MIDI would be better.

gogins commented 1 week ago

CsoundAudioNode doesn't implement OSCinit. I must use either MIDI, or OSC on NW.js.

gogins commented 1 week ago

The Midi Studio on the MacBook does not recognize the MIDI Commander app.

gogins commented 1 week ago

Maybe I can use WebMIDI directly to do this job. See https://webmidijs.org/.

gogins commented 1 week ago

I believe I can use requestFullScreen with options to select the screen. That would be far the best if it works for me, so that is what I will try first. Supposedly works with current Chrome.

I should then also add a parameter to select which screen.

gogins commented 2 days ago

Partly there with opening a separate browser window with HTML controls on the secondary screen. Now to get it talking.

gogins commented 2 days ago

Apparently in the HTMLControls window, window.opener contains a live reference to the window for the piece, so I should be able to run the controls without using postMessage, just assigning new values to the piece parameters members.

That works.

gogins commented 2 days ago

The thing is basically working, but the two sets of controls should mirror each other somehow.