### moveTo(beats) Source: https://learn.tunepad.com/docs Moves the _playhead_ forward or backward in time to an arbitrary position. In TunePad, the playhead marks the current time. For example, after calling `playNote(32, beats = 2)`, the playhead will have advanced by 2 beats. The `beats` parameter specifies the point that the playhead will be placed. For example, a value of 0 would move the playhead to the beginning of a track. A value of 1 would skip the first beat and place the playhead before the start of the second beat. ```APIDOC ## moveTo(beats) ### Description Moves the _playhead_ forward or backward in time to an arbitrary position. In TunePad, the playhead marks the current time. For example, after calling `playNote(32, beats = 2)`, the playhead will have advanced by 2 beats. The `beats` parameter specifies the point that the playhead will be placed. For example, a value of 0 would move the playhead to the beginning of a track. A value of 1 would skip the first beat and place the playhead before the start of the second beat. ### Method moveTo ### Endpoint moveTo(beats) ### Parameters #### Query Parameters - **beats** (float) - Required - The point that the playhead will be placed. ### Request Example ``` moveTo(0) moveTo(4) moveTo(0.5) ``` ### Response #### Success Response (200) No return value. #### Response Example No response example. ``` -------------------------------- ### getPlayhead function usage Source: https://learn.tunepad.com/docs Examples of retrieving the current playhead position. ```python getPlayhead() # returns 0.0 playNote(0, beats = 1) getPlayhead() # returns 1.0 ``` -------------------------------- ### Using Note Constants Source: https://learn.tunepad.com/docs Examples of using note constants to print values and play notes in TunePad. ```python from tunepad.constants import * print(A3) # prints 57 (note A) print(Cs2) # prints 37 (note C-sharp) print(Bb4) # prints 70 (note B-flat) playNote(C5) playNote(D5) playNote([C5, E5, G5], 4) ``` -------------------------------- ### getBeat function usage Source: https://learn.tunepad.com/docs Examples of retrieving the current beat value. ```python getBeat() # returns 0 playNote(0, beats = 2) getBeat() # returns 2 playNote(0, beats = 1) getBeat() # returns 3 playNote(0, beats = 1) getMeasure() # returns 0 ``` -------------------------------- ### moveTo function usage Source: https://learn.tunepad.com/docs Examples of moving the playhead to an absolute position in time. ```python moveTo(0) moveTo(4) moveTo(0.5) ``` -------------------------------- ### Using Note Duration Constants Source: https://learn.tunepad.com/docs Examples of using duration constants to print values and play notes with specific timing. ```python from tunepad.constants import * print(WHOLE_NOTE) # prints 4.0 print(QUARTER_NOTE_DOTTED) # prints 1.5 print(TRIPLET_NOTE) # prints 0.33333 playNote(C5, HALF_NOTE) for _ in range(6): playNote(A4, beats = SEXTUPLET_NOTE) playSound(123, EIGHTH_NOTE) ``` -------------------------------- ### getMeasure function usage Source: https://learn.tunepad.com/docs Examples of retrieving the current measure value. ```python getMeasure() # returns 0 playNote(0, beats = 4) getMeasure() # returns 1 ``` -------------------------------- ### playNote function usage Source: https://learn.tunepad.com/docs Examples of playing single notes, chords, and adjusting duration, velocity, and sustain parameters. ```python playNote(32) playNote(55, beats = 0.5) playNote(0, beats = 2, velocity = 80) playNote(0, beats = 2, velocity = 80, sustain = 2) playNote([36, 40, 43]) playNote([36, 40, 43], beats = 2) ``` -------------------------------- ### fastForward function usage Source: https://learn.tunepad.com/docs Examples of moving the playhead forward relative to its current position. ```python fastForward(1.5) fastForward(-2) ``` -------------------------------- ### rest function usage Source: https://learn.tunepad.com/docs Examples of adding pauses between notes using the rest function. ```python rest() # rest for 1 beat rest(2) rest(beats = 1.5) ``` -------------------------------- ### rewind function usage Source: https://learn.tunepad.com/docs Examples of moving the playhead backward relative to its current position. ```python rewind(1) rewind(-2) rewind(0.5) ``` -------------------------------- ### playNote(note, beats=1, velocity=90, sustain=0) Source: https://learn.tunepad.com/docs Play a note with a pitch value greater than 0. You can also call `playNote` with a list of notes that will be played at the same time. The optional parameter `beats` sets how long the note will last, and the optional `velocity` parameter sets how hard/loud the note sounds. Velocity can be any number between 0 and 127. The optional `sustain` parameter allows a note to ring out longer than the value given by the beats parameter. The value of the parameter is the number of beats the note should sustain in beats. ```APIDOC ## playNote(note, beats=1, velocity=90, sustain=0) ### Description Play a note with a pitch value greater than 0. You can also call `playNote` with a list of notes that will be played at the same time. The optional parameter `beats` sets how long the note will last, and the optional `velocity` parameter sets how hard/loud the note sounds. Velocity can be any number between 0 and 127. The optional `sustain` parameter allows a note to ring out longer than the value given by the beats parameter. The value of the parameter is the number of beats the note should sustain in beats. ### Method playNote ### Endpoint playNote(note, beats=1, velocity=90, sustain=0) ### Parameters #### Path Parameters - **note** (int, float, list) - Required - The note or notes to play #### Query Parameters - **beats** (float, optional) - How long to play (default value is 1) - **velocity** (int, float, optional) - How hard/loud the note sounds - **sustain** (float, optional) - How long to sustain the note ### Request Example ``` playNote(32) playNote(55, beats = 0.5) playNote(0, beats = 2, velocity = 80) playNote(0, beats = 2, velocity = 80, sustain = 2) playNote([36, 40, 43]) playNote([36, 40, 43], beats = 2) ``` ### Response #### Success Response (200) No return value. #### Response Example No response example. ``` -------------------------------- ### Supported buildScale Modes Source: https://learn.tunepad.com/docs The list of valid modes for the buildScale function. ```python "Ionian", "Dorian", "Phrygian", "Lydian", "Mixolydian", "Aeolian", "Locrian" "Chromatic", "Whole Tone", "Diminished" ``` -------------------------------- ### Importing tunepad.chords Source: https://learn.tunepad.com/docs The required import statement to use the chords module in a TunePad cell. ```python from tunepad.chords import * ``` -------------------------------- ### Major Keys for changeKey Source: https://learn.tunepad.com/docs The list of available major keys for the changeKey function. ```python "C", "C#", "Db", "D", "Eb", "E", "F", "F#", "Gb", "G", "Ab", "A", "Bb", "B" ``` -------------------------------- ### fastForward(beats) Source: https://learn.tunepad.com/docs Moves the playhead forward in time by an amount relative to its current position. This can be a useful way to play multiple notes at the same time. The `beats` parameter specifies the number of beats to move the playhead. Negative values of `beats` move the playhead backward. ```APIDOC ## fastForward(beats) ### Description Moves the playhead forward in time by an amount relative to its current position. This can be a useful way to play multiple notes at the same time. The `beats` parameter specifies the number of beats to move the playhead. Negative values of `beats` move the playhead backward. ### Method fastForward ### Endpoint fastForward(beats) ### Parameters #### Query Parameters - **beats** (float) - Required - The number of beats to move the playhead. Negative values move the playhead backward. ### Request Example ``` fastForward(1.5) fastForward(-2) ``` ### Response #### Success Response (200) No return value. #### Response Example No response example. ``` -------------------------------- ### Minor Keys for changeKey Source: https://learn.tunepad.com/docs The list of available minor keys for the changeKey function. ```python "Am", "A#m", "Bbm", "Bm", "Cm", "C#m", "Dm", "D#m", "Ebm", "Em", "Fm", "F#m", "Gm", "G#m" ``` -------------------------------- ### getPlayhead() Source: https://learn.tunepad.com/docs Returns the current value of the playhead as a float. This value is zero-indexed, so the first beat will be zero rather than one. ```APIDOC ## getPlayhead() ### Description Returns the current value of the playhead as a float. This value is zero-indexed, so the first beat will be zero rather than one. ### Method getPlayhead ### Endpoint getPlayhead() ### Parameters No parameters. ### Request Example ``` getPlayhead() # returns 0.0 playNote(0, beats = 1) getPlayhead() # returns 1.0 ``` ### Response #### Success Response (200) - **return** (float) - The current value of the playhead. #### Response Example ``` 0.0 ``` ``` -------------------------------- ### Full Set of Note Duration Values Source: https://learn.tunepad.com/docs The complete list of duration constants and their numeric values. ```python DOUBLE_WHOLE_NOTE = 8.0 WHOLE_NOTE = 4.0 HALF_NOTE_DOTTED = 3.0 HALF_NOTE = 2.0 QUARTER_NOTE_DOTTED = 1.5 QUARTER_NOTE = 1.0 EIGHTH_NOTE_DOTTED = 0.75 EIGHTH_NOTE = 0.5 SIXTEENTH_NOTE = 0.25 THIRTY_SECOND_NOTE = 0.125 TRIPLET_NOTE = 1/3 SEXTUPLET_NOTE = 1/6 ``` -------------------------------- ### rewind(beats) Source: https://learn.tunepad.com/docs Moves the playhead backward in time by an amount relative to its current position. This can be a useful way to play multiple notes at the same time. The `beats` parameter specifies the number of beats to move the playhead. Negative values of `beats` move the playhead forward. ```APIDOC ## rewind(beats) ### Description Moves the playhead backward in time by an amount relative to its current position. This can be a useful way to play multiple notes at the same time. The `beats` parameter specifies the number of beats to move the playhead. Negative values of `beats` move the playhead forward. ### Method rewind ### Endpoint rewind(beats) ### Parameters #### Query Parameters - **beats** (float) - Required - The number of beats to move the playhead. Negative values move the playhead forward. ### Request Example ``` rewind(1) rewind(-2) rewind(0.5) ``` ### Response #### Success Response (200) No return value. #### Response Example No response example. ``` -------------------------------- ### getBeat() Source: https://learn.tunepad.com/docs Returns a decimal of the value of the current beat of the measure. This value is zero-indexed, therefore the first beat will be zero rather than one. ```APIDOC ## getBeat() ### Description Returns a decimal of the value of the current beat of the measure. This value is zero-indexed, therefore the first beat will be zero rather than one. ### Method getBeat ### Endpoint getBeat() ### Parameters No parameters. ### Request Example ``` getBeat() # returns 0 playNote(0, beats = 2) getBeat() # returns 2 playNote(0, beats = 1) getBeat() # returns 3 playNote(0, beats = 1) getMeasure() # returns 0 ``` ### Response #### Success Response (200) - **return** (float) - The current beat of the measure. #### Response Example ``` 0 ``` ``` -------------------------------- ### rest(beats=1) Source: https://learn.tunepad.com/docs Add a pause between notes. The length of the pause can be set using the optional `beats` parameter. ```APIDOC ## rest(beats=1) ### Description Add a pause between notes. The length of the pause can be set using the optional `beats` parameter. ### Method rest ### Endpoint rest(beats=1) ### Parameters #### Query Parameters - **beats** (float, optional) - The length of the pause (default value is 1) ### Request Example ``` rest() # rest for 1 beat rest(2) rest(beats = 1.5) ``` ### Response #### Success Response (200) No return value. #### Response Example No response example. ``` -------------------------------- ### getMeasure() Source: https://learn.tunepad.com/docs Returns an integer of the value of the current measure. This value is zero-indexed, therefore the first measure will be zero rather than one. ```APIDOC ## getMeasure() ### Description Returns an integer of the value of the current measure. This value is zero-indexed, therefore the first measure will be zero rather than one. ### Method getMeasure ### Endpoint getMeasure() ### Parameters No parameters. ### Request Example ``` getMeasure() # returns 0 playNote(0, beats = 4) getMeasure() # returns 1 ``` ### Response #### Success Response (200) - **return** (int) - The current measure. #### Response Example ``` 0 ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.