typetext
{
"instrument": "Trumpet",
"loudness_conf_filter": "0",
"loudness_floor": "0",
"loudness_scale": "0.5",
"loudness_smoothing": "0",
"octave_shift": "1",
"pitch_conf_filter": "0",
"pitch_smoothing": "0",
"use_fastnewt": false,
"use_full_crepe_model": true,
"youtube_length_in_seconds": "20",
"youtube_start_in_seconds": "6.5",
"youtube_url": "https://www.youtube.com/watch?v=dYvPCgcFDIo"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RXa**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run ben-hayes/neural-waveshaping-synthesis using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ben-hayes/neural-waveshaping-synthesis:0d8b1d7be262c95cde0b35bf15112d0faa43a3b456dd5bde0cc7ecc26ba7d0a9",
{
input: {
instrument: "Trumpet",
loudness_conf_filter: "0",
loudness_floor: "0",
loudness_scale: "0.5",
loudness_smoothing: "0",
octave_shift: "1",
pitch_conf_filter: "0",
pitch_smoothing: "0",
use_fastnewt: false,
use_full_crepe_model: true,
youtube_length_in_seconds: "20",
youtube_start_in_seconds: "6.5",
youtube_url: "https://www.youtube.com/watch?v=dYvPCgcFDIo"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RXa**********************************
This is your API token. Keep it to yourself.
import replicate
Run ben-hayes/neural-waveshaping-synthesis using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ben-hayes/neural-waveshaping-synthesis:0d8b1d7be262c95cde0b35bf15112d0faa43a3b456dd5bde0cc7ecc26ba7d0a9",
input={
"instrument": "Trumpet",
"loudness_conf_filter": "0",
"loudness_floor": "0",
"loudness_scale": "0.5",
"loudness_smoothing": "0",
"octave_shift": "1",
"pitch_conf_filter": "0",
"pitch_smoothing": "0",
"use_fastnewt": False,
"use_full_crepe_model": True,
"youtube_length_in_seconds": "20",
"youtube_start_in_seconds": "6.5",
"youtube_url": "https://www.youtube.com/watch?v=dYvPCgcFDIo"
}
)
# The ben-hayes/neural-waveshaping-synthesis model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/ben-hayes/neural-waveshaping-synthesis/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RXa**********************************
This is your API token. Keep it to yourself.
Run ben-hayes/neural-waveshaping-synthesis using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "ben-hayes/neural-waveshaping-synthesis:0d8b1d7be262c95cde0b35bf15112d0faa43a3b456dd5bde0cc7ecc26ba7d0a9",
"input": {
"instrument": "Trumpet",
"loudness_conf_filter": "0",
"loudness_floor": "0",
"loudness_scale": "0.5",
"loudness_smoothing": "0",
"octave_shift": "1",
"pitch_conf_filter": "0",
"pitch_smoothing": "0",
"use_fastnewt": false,
"use_full_crepe_model": true,
"youtube_length_in_seconds": "20",
"youtube_start_in_seconds": "6.5",
"youtube_url": "https://www.youtube.com/watch?v=dYvPCgcFDIo"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"outputType": "object",
"properties": {
"file": {
"outputType": "uri",
"mimeType": "audio/mpeg",
"inferred": false,
"outputValue": "https://replicate.delivery/mgxm/33e14bbd-0db4-49a0-a4d9-fbc08197a579/out.mp3",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"file": "https://replicate.delivery/mgxm/33e14bbd-0db4-49a0-a4d9-fbc08197a579/out.mp3"
},
"typeMismatch": false
}{
"id": "yxmcdhxio5hi5iscdp4xjqx7zm",
"model": "ben-hayes/neural-waveshaping-synthesis",
"version": "0d8b1d7be262c95cde0b35bf15112d0faa43a3b456dd5bde0cc7ecc26ba7d0a9",
"input": {
"instrument": "Trumpet",
"loudness_conf_filter": "0",
"loudness_floor": "0",
"loudness_scale": "0.5",
"loudness_smoothing": "0",
"octave_shift": "1",
"pitch_conf_filter": "0",
"pitch_smoothing": "0",
"use_fastnewt": false,
"use_full_crepe_model": true,
"youtube_length_in_seconds": "20",
"youtube_start_in_seconds": "6.5",
"youtube_url": "https://www.youtube.com/watch?v=dYvPCgcFDIo"
},
"logs": "Downloading youtube video...\nRunning: youtube-dl --format=bestaudio[ext=m4a] --extract-audio --audio-format=wav --output=/tmp/tmp4x7my0ao/yt_audio.%(ext)s https://www.youtube.com/watch?v=dYvPCgcFDIo\nExtracting F0 with crepe...\nComputing control signals...\nRunning model...\nAudio generated in 0.14 seconds. That's 141.6 times faster than the real time threshold!\nSaving result...",
"output": [
{
"file": "https://replicate.delivery/mgxm/33e14bbd-0db4-49a0-a4d9-fbc08197a579/out.mp3"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2021-08-27T10:05:05.473209Z",
"completed_at": "2021-08-27T10:05:16.044474Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/yxmcdhxio5hi5iscdp4xjqx7zm/cancel",
"get": "https://api.replicate.com/v1/predictions/yxmcdhxio5hi5iscdp4xjqx7zm"
},
"metrics": {}
}