Capstone Progress Report IV

system.png

Following the last report, I made a list of items to complete. The status of these and comments are outlined below:

  1. Added pot input for ‘rate’
  2. Added pot input for output volume’
  3. Got the 4th pot working, but some issues with the mapping ranges.
  4. Went through an extensive debugging process to see where my patch is failing and why. All 6 analogs-in work (patch visualizes in the Bela IDE), as signal and number inputs.
    1. Range for all 4 is 0.02-0.726
    2. Could this reach the full range with more power? or is that not the issue? I can just map to this range of values.
    3. The section that calculates the number of harmonics and harmonic combination works. The error “text define, no method for float” has been removed. (Patch no longer visualizes at this point in Bela IDE; is it a specific object that’s making it fail?). (Well, error came back later, I really don’t know why it happens, it just happens when I open the patch: no messages, no methods, nothing sent to [text define]
    4. I have now identified what causes the error. It is connecting [r number_harmonics] to [select 1 2 3 4 5]problem.png
    5. Fixed by 1) removing continuously printed error by adding [change] between [r] and [sel] to filter repetitions. 2) There was some kind of issue because there was both a [s gates_1] and a [text get/define gates_1]. This seems to have been causing the issues, I guess when the [sel] was triggered, [s gates_1] was sending integers not only to [r gates_1], but also to [text gates_1]?
      1. issue is not GUI objects in the patch
      2. [text get] is what causes visualization in the IDE to fail. Even though patch isn’t visualizing, it’s still working. Tested this by putting a fixed frequency [osc~] after the [text get] has been included, and visualized the signal on scope via [dac~ 27]. Signal is visualized.
    6. I don’t know why, but the potentiometer values are now behaving almost as expected. Their minimum value is close to 0 (~0.005) and maximum at 0.704 (instead of 1).
    7. NOTE: it works: variable are a bit off ito. mappings because of voltage values.
    8. And then it didn’t work, and now it won’t even compile, I’m getting a bunch of errors.
    9. Fixed this by resetting board. Now 2 issues:
      1. potentiometers are cross-influencing each other, why?
      2. when the pots are connected to the Arduino, to be read for the LED values, the readings get very jumpy. Also, the LEDs I think need their own power source, because there is some interference or something from the Bela power.
    10. I separated the LEDs and removed the vibration motor part of the circuit, so now its JUST the pots. On a 3.3V they work well, no interference. Reach a max of .82. With 5V, its stable, but maxing at >1.0 before I’ve reached the full turn of the pot, so I will try 3.3V and scale the outputs. Without scaling there is an error with pot_4, when trying to index the harmonic combinations and number of harmonics.
    11. With scaling: works using [expr~ ($v1 – 0.002)/0.8)] through [clip~ 0. 1.]
    12. NOTE: check minimum adc read value, maybe its not 0.02, I think it might be 0.02.
  5. SETUP THAT SEEMS TO WORK:
    1. 3.3V power from Arduino to power potentiometers. Potentiometers feed parallel to Bela and Arduino analog inputs.
    2. 5V power from Arduino to power the LEDs.
    3. Ground from Arduino for LEDs and pots.
    4. will see where vibration motors figure into this.
  6. External power for vibration motors:
    1. external power with a 5V supply setup for powering the pots, LEDs, and V(in) on Arduino.
  7.  Vibration mappings:
    1. take 5V power from the supply, ground from supply, and Bela connected to power supply ground via its GND pin (not P8 or P9, but GND, at the analog out section).
    2. vibration motors begin to respond at 0.596adcu, until 1adcu, but on the fall will be felt until about 0.4adcu.
    3. so I mapped the direct adcu (0-1), to the range for the motors = (0.4-1.0).
    4. can get motors 1-4 to virbate on dac~ 3 4 5 6. can’t get dac~ 7 to work, but I don’t know if the issue is dac 7 or the pots 5 and 6, can’t even see them in the scope?? For tomorrow: figure out what’s the issue [dac~ 7] or the 5th motor, or both, or my pots 5 and 6?
    5. testing, what works:
      • adc 3 4 5 6 –> dac 3 4 5 6
      • adc 3 4 5 6 –> dac 4 5 6 7 ** 7 doesn’t work.
    6. issue is not with that particular motor circuit, I tested it with another analog output and it vibrates, so issue could be [dac~ 7] or having that many [dac~] outputs in general.
      1. [adc~ 3 5] à [dac~ 3 5], works, so you don’t need to use sequential outputs
      2. [adc~ 3 4 5 6] à [dac~ 3 4 5 7] works. So 7 works, but I didn’t pass any “-C argument”. Now let me test if I can 1) control more than 4 motors, 2) more than 4 pot inputs work now . 1) Yes I can. 2) Yes, they work.
      3. Conclusion: do not pass the “-C #” argument. smdh.
    7. Take 5V power from the supply, ground from supply, and Bela connected to power supply ground via its GND pin (not P8 or P9, but GND, at the analog out section).combo_fritz_dev_jpg.jpg
  8. Color mappings
    1. Tried 2 models of color mappings. Think second version is better, outlined here:
      • Knob_1_LED: center maps to B1. If grav < 0, drift_size maps to R1 (0-240) and maps to G1 (0-60), if grav > 0, drift_size maps to G1 (0-240) and maps to  R1 (0-60)
      • Knob_2_LED: has 2 features, intensity and redness: a subtraction of G2 and B2. Intensity = map probability to (RGB).Redness = mapping of stretch_abs to R2
      • Knob_3_LED: stretch_abs maps to R3 (0-140).  Taste maps to G3 over total range (0-690:10:180). Taste maps to B3 over segmented ranges (0 – 200, over segments).
      • Knob_4_LED: taste (corresponding to square mix) maps over 2 colour presets (20,190,80 -235,90,10). Fourth LED is thus also bluer in the more stable (less square) state, and more orange when more square is mixed in.
    2. Observations + notes:
      1. there is a stable condition, where many of the LEDs are similar, which corresponds to a stable state of the musical system i.e. little or no gravity, little to no stretch, lower taste. The three LEDs have distinct behaviors but are co-influenced by the same source – i.e. it seems clear that turning one knob affects multiple LEDs but they way it does for each is different. e.g. 1, complex and different on each side of grav, 2, overall brightness + red component behaviour, 3 – total and segmented color cycling, 4 – simple 2-state color transition.
      2. Need to now figure out how to visualize these functions and show the relations in a diagram form. For an example, I used Grapher to visualise a 3-dimensional relationship with 3 variables, drift_size, absolute_stretch, and gravity_magnitude.drift_stretch_grav_2drift_stretch_grav_1
  9. Vibration mappings
    1. 3 vibration points on under side of hand. 2 on top. Each of these vibrates at a frequency between 0.05 – 2.0 Hz. The features that change are
      1. top/bottom damping
      2. phase of the vibrations
      3. frequency of the vibrations
    1. Damping – if drift_direction == 1 (+ grav): bottom motors (M1, M2, M3) are damped by grav_mag mapped (0, 100, 0., 1.). If drift_direction == -1 (- grav): top motors (M4, M5) are damped. NOTE: test this and see, it might be more intuitive if the gravity is pulling down, to have there be a force on top of your hand. It will depend on the sensation, is it more of a pull or push. Needs to be tested.
    2. Phase – absolute stretch value determines how many of the motors are out of phase compared to a reference motor. When the number of motors out of phase changes, each motor that is out of phase is assigned a randomly selected phase value from a file of presets [0.175, 0.25, 0.5, 0.75, 0.625].
    3. Frequency – a function of taste and the center freq. (0.05 to 2.0). Sum of these two parameters. (each mapped 0 – 0.975).
  1. Implemented vibration mappings in Pd w. successful outputs

Next items:

  1. Mapping of 4th pot to adc~ values. It’s a bit off. Take care of jumpy/borderline values, or include them as part of the instruments design.
  2. Charts of the mappings for both sound / control variables, RGB outputs, and vibrations of the motors. For documentation, explanation, and reference.
  3. Vibration glove implementation
  4. The high frequencies really overpower the lower ones, and in the final cases with 5+ harmonics, become almost unpleasant / too loud. Will need to attenuate these frequencies.
  5. Build design
    1. Powering: Will have a screw-terminal for xV power supply. This will internally be split to power both the Arduino and the Bela through 2 separate adapters.
    2. The body will also need to include USB access to the Bela and Arduino, as I will need to make changes to the code on each after body is built.
    3. Additionally, the Bela and Arduino need to be removable from the body.

Leave a comment