question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Draw f0 on cqt's image

See original GitHub issue

Draw f0 on cqt’s image

Draw f0 on cqt’s image for users to read note’s name directly

Is your feature request related to a problem? Please describe.

I’m always frustrated when trying to draw a f0 line into a cqt image.

I use code1 to draw cqt_note - time image. I find it useful because I can read the name of the notes directly from y-axis.

# code1
y, sr = librosa.load("F:\\Script\\Voice\\music\\human.wav", duration=15.0, sr=None)
C = librosa.cqt(y=y, sr=sr)
C_db = librosa.amplitude_to_db(np.abs(C), ref=np.max)
fig, ax = plt.subplots()
img = librosa.display.specshow(C_db, sr=sr, y_axis='cqt_note', x_axis='time', ax=ax, cmap='gray_r')
fig.colorbar(img, ax=ax, format='%+2.0f dB')
plt.show()

But, the pyin didn’t suppprt it, I can draw f0 line by log y-axis in ‘ferequency-time’ image, but I can not directly read out the note’s name on the y-axis.

Describe the solution you’d like

Provide a new function[let’s call itnote_0()]. and the output could be added to the cqt’s ‘ax’ object, just like drawing pyin’s output on ‘db-time’ image

Describe alternatives you’ve considered

I tried to slove it in a physical way. I set all the figures to a certain size, then, mark the notes in one picture’s y-axis by a pen.

Then, I cut it off, and use this piece of paper as a ruler, but it is very funny, and I have to copy the ‘ruler’ a lot of times.😢

Additional context

I want to get a <u>‘line’</u> of f0, not a number of rectangle(s) filled by a color.

this function is very useful for musicians.

Thanks for your reading

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
unbadfishcommented, Aug 25, 2020

@lostanlen Thanks for your answer. But Bmcfee showed me how to achieve my goal. https://github.com/librosa/librosa/issues/1227#issuecomment-678241271 Issue close. By the way, I think the code should be added to the document

0reactions
lostanlencommented, Aug 25, 2020

@unbadfish it’s unclear what you’re asking. If what you want is to overlay a fundamental frequency curve on top of a CQT image, specshow and plot will do that in two lines. If what you want is to be able to name pitches extracted by pYIN, then hz_to_note is your friend: https://librosa.org/doc/latest/generated/librosa.hz_to_note.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pin on giftdtkcyk - Pinterest
Cut cat drawing easy ... easy pen drawing idea Basic Drawing For Kids, Drawing Images For. super cool things to drw - 30...
Read more >
I actually like this version better - Drawing, DIY & Crafts
More memes, funny videos and pics on 9GAG True Memes, Cat Memes, Funny ... I actually like this version better - Drawing, DIY...
Read more >
27 Cat faces ideas | cat drawing, cat art, drawings - Pinterest
Jan 22, 2021 - Explore antoinette basson's board "Cat faces" on Pinterest. See more ideas about cat drawing, cat art, drawings.
Read more >
19654 Christmas Cat Drawing Images, Stock Photos & Vectors
Find Christmas Cat Drawing stock images in HD and millions of other royalty-free stock photos, illustrations and vectors in the Shutterstock collection.
Read more >
Medieval Cat Paintings Are So Horrible, It's Hilarious
Ever tried to draw a cat? It turns out it's not as easy as you expect. It indeed wasn't for these Medieval artists....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found