文件

歌聲樂譜生成 (Beta-v2)

Service: https://arts.api.yating.tw/v2
藉由這隻API,你只要提供歌詞,就可以產生一個歌唱的樂譜。你可以將此樂譜輸入到「歌聲生成」API後取的音檔結果。

發起請求

Request
URL: /leadSheet/vocal
Method: POST
Header
Name
Type
Info
*key
String
*Content-Type
String
Only “application/json”
Body
Name
Type
Info
*lyrics
JSON list of strings
A list of
Chinese character
sentence strings. Word count in each sentence ranges from 1 to 30 characters (inclusive).
NOTE: Best character count for each sentence is between 6 to 15 characters (inclusive). The maximum number of sentences is 8 (inclusive).
*config
JSON
tempo
: integer, ranged from 45 bpm to 250 bpm (inclusive)
artistStyle: string, optional, see 5. ArtistStyle list
genres: list, optional, see 4. genres list
{
   "lyrics": ["笑著愛你笑著看你", "但下一秒我就這樣哭了"],
   "config":{
      "tempo":80, 
      "artistStyle":"JJ Lin",
      "genres":[
         "pop",
         "pop rap"
      ]
   }
}
Response
[
   {
       "uid": "313fb766-cf44-421c-b818-6127ed91d739",
       "status": "pending",
       "createdAt": "2022-08-26T11:40:42.401Z",
       "updatedAt": "2022-08-26T11:40:42.401Z"
   }
]

處理狀態查詢

進行處理後,“狀態”鍵將從“待處理”變為“處理中”,最後變為“完成”。 如果出現問題,就會進入“錯誤”。 您可以發出 GET 請求,如下所示,以檢查轉錄狀態的更新。
您必須重複 GET 請求,直到您的狀態為“完成”或“錯誤”。 一旦狀態鍵顯示為“已完成”,您就可以從 path 拿到新的連結,並且可以直接下載檔案。
Request
URL: /leadSheet/vocal?page=1&perPage=10&status=pending
Method: GET
Header
Name
Type
Info
*key
String
Bearer {key}
Response
Name
Type
Info
id
object
status: Pending, Completed, processing, Error, Expired, Not exists
expiredAt: RFC3339 timestamp
{
  "page":2,
  "perPage":10,
  "total":21,
  "nextPage":3,
  "data":[
    {
      "uid":"512b978b-3bda-4f01-aeca-a5abc1944cc2",
      "taskId":"74fb6122-af46-4578-acd1-eb25aac8a893",
      "status":"ongoing",
      "createdAt":"2022-11-22T16:49:25.835Z",
      "updatedAt":"2022-11-22T16:49:35.000Z"
    }
  ]
}

取得音檔結果

只要你的音檔狀態是 completed,你即可從以下 path 中取得處理後的音檔連結,並進行下載。
Request
URL: /leadSheet/vocal/{uid}
Method: GET
Header
Name
Type
Info
*key
String
Bearer {key}
Query parameter
Name
Info
{uid}
string, uid.
The time signature change of the generated melody is always on 4/4 at the very start and the tempo changes are always the same BPM as the “tempo” parameter in the input configuration.
Response
{
   "uid":"313fb766-cf44-421c-b818-6127ed91d739",
   "Status":"success",
   "metadata":{
      "ticksPerBeat":480,
      "tempoChanges":[
         {
            "time":0,
            "tempo":80
         }
      ],
      "timeSignatureChanges":[
         {
            "time":0,
            "numerator":4,
            "denominator":4
         }
      ],
      "numberOfBars":16
   },
   "instruments":[
      {
         "program":"vocal_leadsheet",
         "notes":[
            {
               "start":1000,
               "end":2250,
               "word":"我",
               "pitch":60
            },
            {
               "start":3000,
               "end":4250,
               "word":"想",
               "pitch":50
            }
         ],
         "chordChanges":[
            {
               "time":1000,
               "root":0,
               "quality":"M"
            }
         ],
         "controlChanges":[
            
         ]
      }
   ]
}

Genre list

adult standards
album rock
alt z
anime
anime rock
arkansas country
art pop
australian country
australian pop
bossa nova
c-pop
cantopop
chill r&b
chinese indie
chinese r&b
city pop
classic cantopop
classic city pop
classic mandopop
classic rock
contemporary country
contemporary vocal jazz
country
country road
country rock
dance pop
disco
easy listening
edm
electro house
electropop
europop
folk
folk rock
funk
gen z singer-songwriter
indie pop
j-idol
j-pop
j-pop girl group
j-rock
japanese alternative rock
japanese r&b
japanese soul
japanese teen pop
japanese vocal jazz
jazz pop
k-pop
k-pop boy group
k-pop girl group
lounge
mandopop
mellow gold
motown
neo mellow
neo soul
oklahoma country
outlaw country
piano rock
pop
pop dance
pop rap
pop rock
post-teen pop
quiet storm
r&b
rock
rock-and-roll
rockabilly
shibuya-kei
shoegaze
singaporean mandopop
singaporean pop
singaporean singer-songwriter
singer-songwriter
soft rock
soul
taiwan idol pop
taiwan pop
taiwan singer-songwriter
tropical house
uk pop
vocal jazz
yacht rock

ArtistStyle list

A-Lin
A-Mei Chang
AKB48
Alan Jackson
Anson Seabra
BTS
Bobby Chen
Bruno Mars
Cheer Chen
Ed Sheeran
Eric Chou
George Strait
Hebe Tien
JJ Lin
Jackson Wang
Jay Chou
John Mayer
Johnny Cash
Jolin Tsai
Keith Urban
King Gnu
LUCKY TAPES
LaLa Hsu
Lady Gaga
Leehom Wang
Lisa Ono
Michael Jackson
Mika Nakashima
Norah Jones
OFFICIAL HIGE DANDISM
OneRepublic
Original Love
Sam Smith
Stacey Kent
Suchmos
TWICE
Tanya Chua
Taylor Swift
The Jackson 5
The Jacksons
Toby Keith
Tony Bennett
WeiBird
Where Chou
Wu Bai
YOASOBI
Yoga Lin
Zhang Yu Sheng