• No se han encontrado resultados

GENERALIDADES DE LA EMPRESA

In document SALUD 2 (página 32-37)

8. SISTEMA DE INSPECCIÓN, DIAGNOSTICO Y CONTROL

8.1 GENERALIDADES DE LA EMPRESA

The self-tuning procedure described in this chapter has been implemented on Swivel 2. Swivel 2, introduced in Chapter 3, is a six-stringed robotic chordophone. To shift pitches, Swivel 2 rotates servo-mounted slides along each of its modules’ strings. To change the fundamental frequency of the string, the “home” position of the fretter arm is changed, as illustrated in Figure 6.4.

Swivel 2 was selected as the mechatron on which to test the self tuning scheme presented in this chapter both due to its suitability to the approach and its need for self-tuning.

Chapter 6. Self-Tuning With Swivel 2 119

Figure 6.6: SwivelSelfTune’s GUI: FFT settings, string characterisation files, and

MIDI and audio input and output routing can be specified by the user. Once the string is tuned, the user can switch into “running mode” by pressing the “Start MIDI Thru”

button.

Swivel 2 is capable of changing its strings’ vibratory frequency at high resolutions, al- lowing the strings’ behaviours to be characterised at a large number of points along their length. Additionally, Swivel 2’s strings can be easily manually retuned with its integrated machine head tuning pegs, allowing the strings to be detuned and charac- terised at a number of different fundamental frequencies. Swivel 2 is a good candidate for self-tuning and fret assignment due to its default low-level interface. Without a self- tuning and fret-assigning system, Swivel 2 requires the composer to manually specify the two-byte pitchbend value for each note pitch. The results of a user study (presented in Chapter 8) indicated that users found this to be a slow way to interact with the sys- tem. Users requested the implementation of self-tuning and streamlined fret-choosing schemes for Swivel 2.

6.4.1 Characterising Swivel 2

To characterise the six strings of Swivel 2 (a process illustrated in Figure 6.5), a series of MIDI pitchbend commands are sent to each string. The pitchbend command instructs the fretter arm to rotate to an angle corresponding to the command’s value (described in Chapter 3), after which the fretter arm clamps against the string and the string is picked. A module’s string’s vibrations are transduced by its magnetic pickup. The pitch is extracted from this signal. If the pitch lies within an expected range, it and its accompanying MIDI pitchbend value are stored in the string’s characterisation table.

Chapter 6. Self-Tuning With Swivel 2 120

After the string has been characterised at a particular open string frequency, the string is retuned and the process repeated.

An FFT-based pitch extractor was built in the ChucK programming language. The pitch extractor’s thresholds are manually specified, allowing users to set the extractor to disregard the strings’ higher harmonics and any actuator noise tranduced by the strings’ pickup. A sample rate of 44.1 kHz is used, along with an FFT size of 16384 samples. The FFT size was chosen to allow for suitable pitch discrimination at low frequencies while remaining able to detect the higher-pitched strings’ frequencies before the fundamental frequency’s decay below the noise floor.

Due to the mechanical and digital nature of the actuator control, the strings can only be tuned as precisely as the actuators’ finest resolution. As such, the string characterisation tables are populated with 25 separate pitches, resulting in a curve found to be sufficiently smooth to avoid hindering the actuators’ positioning.

6.4.2 Self-Tuning and Fret Assignment

Once the robot’s strings are characterised, a purpose-built application is used to self- tune the strings. The application, dubbed SwivelSelfTune, was adapted from preliminary ChucK and Processing code into an integrated C++ application with assistance from student research assistant Paul F.C. Mathews. The application, whose GUI is shown in Figure 6.6, behaves in a manner illustrated in Figure 6.7.

Upon the user instructing the application to tune Swivel 2, SwivelSelfTune outputs a MIDI CC8 command with a value of 127, resulting in the Swivel 2 module lifting its fretter clear of the string. This allows the string to vibrate at its full detuned open-string length, unencumbered by the presence of the fretter. After a delay of three seconds (to allow the string to fully settle if disturbed by the movement of the fretter away from the string), SwivelSelfTune outputs a MIDI CC7 command with a value of 127, resulting in the module’s pick moving across the string. The excited string’s pitch is transduced by the module’s pickup and is input into an ADC-equipped audio interface (a Presonus Firestudio Project Firewire interface was used to test the application on Swivel 2). The signal’s pitch is extracted in a manner similar to that used by the string char- acteriser (discussed above in Section 6.4.1). An advantage of the pitch extractor in

Chapter 6. Self-Tuning With Swivel 2 121 MOVE FRETTER CLEAR OF STRING PICK STRING (TRANSMIT MIDI CC 7) PERFORM PITCH EXTRACTION COMPARE STRING PITCH TO CHARACTERISATION TABLES INTERPOLATE FROM TABLES TO CHARACTERISE CURRENT STRING POPULATE FRET LOCATION TABLE, ENTER RUNNING MODE CONVERT MIDI TO APPROPRIATE MIDI PITCHBEND VALUE MIDI NOTEON FROM

DAW MIDI OUT TO ROBOT

Figure 6.7: The SwivelSelfTune procedure.

“SWIVELSTRING”: SWIVEL 2 MODULE NUMBER

“MEASUREMENTS”: STRING DETUNED TO SPECIFIED FUNDAMENTAL

“MIDIMSBS”: MIDIMSB[i] RESULTS IN STRING FREQUENCY AT MEASUREMENTS[i]

“TARGETS”: VIRTUAL FRET LOOKUP TABLE (TARGET FREQUENCIES)

Figure 6.8: An annotated illustration of the SwivelSelfTune XML file.

SwivelSelfTune over that used by the string characteriser is that the pitch thresholds of SwivelSelfTune’s extractor can be set relatively close to the expected fundamental fre- quency of the string. While the string characteriser must be configured to detect pitches far from the ideal fundamental as it moves along the string, the single open-string ex- traction event of SwivelSelfTune meant that emperically-derived thresholds of ±20 Hz were found suitable, resulting in no detected harmonic-related false-positives.

Chapter 6. Self-Tuning With Swivel 2 122

After determining the pitch, SwivelSelfTune compares the detected pitch to a pre- populated pitch table. The pitch table consists of the results of the string charac- terisation steps at a variety of open-string frequencies. To allow for easy parsing of the pitch table, an XML-format file is used (an annotated illustration of the XML file is shown in Figure 6.8). In the XML file, each string is specified as a<swivelstring>tag, each of which contains a number of <measurements> tags (each <measurements> tag corresponds to a detuned fundamental frequency whose value is decided in the character- isation procedure). The<measurements>tags contain a list of numbers that correspond to the detected pitches at various points along the string. Also included within each

<swivelstring>tag is a<midimsbs>tag that contains a list of the MIDI pitchbend most significant bytes whose index value corresponds to those within the<measurements>tag. Finally, the <swivelstring> tag contains a <targets> tag, which is the “virtual fret” lookup table. Changing the values in the<targets> tag is akin to moving the locations of the frets on a fretted guitar.

The detuned string’s behaviour is interpolated from the two pre-characterised curves closest to its detected pitch4. The result of the interpolation is that a new table is formed, similar to the <measurements> tables (shown in Figure 6.8) but containing values interpolated from the nearest characterisation tables above and below the detected frequency. After the interpolated<measurements>table is created, the MIDI pitchbend values that correspond to its pitches are known (and are contained in the <midimsbs>

table). The fretter arm can move to the “fret positions” in the <targets> table by interpolating between values in the <midimsbs> and the calculated <measurements>

table.

At this stage, the string has been tuned and its virtual fret intervals set. The user can then instruct the SwivelSelfTune software to enter its running mode. In the running mode, MIDI messages from a digital audio workstation or other MIDI-compatible device are routed through SwivelSelfTune and transformed to MIDI pitchbend values that correspond to the desired frequency5.

4With sufficient characterisation data, linear interpolation is suitable. If few characterisation points are taken, though, the error of such interpolation will likely prove audible to listeners.

5See www.github.com/PFCM/SwivelAutotune for full documentation of the GUI (retrieved May 10, 2014).

Chapter 6. Self-Tuning With Swivel 2 123

Table 6.1: Characterization Fundamental Pitches

Swivel Unit Freq. 1 (Hz) Freq. 2 (Hz) Freq. 3 (Hz)

1 70.2 80.6 90.6 2 96.4 106 116 3 130 140 150 4 175 187 200 5 226 246 267 6 306 326 349

In document SALUD 2 (página 32-37)

Documento similar