Comments (3)
Hi @ashish-ch-98. Thanks for your question. I'm not sure what you mean though:
- are you using ChordFiddle and do you want to reset the chord sheet to the initial key? That is not a feature at the moment.
- are you using a combination of ChordSheetJS and ChordJS and do you want to reset the chord sheet to the initial key? I could think of two solutions:
- store multiple versions of the chord sheet in memory, at least the first one
- keep track of how many steps the chord sheet has been transposed. For example, if the current chord sheet is netto transposed +4, you can reset the chords with
chord.transpose(-4)
Please let me know if this answers your question.
from chordsheetjs.
Thank you for your help.
I am using a combination of ChordSheetJS and ChordJS. I put a reset button which should be transposing the chord sheet to the initial key. I executed it using react hooks. For some transpose operations using up and down buttons, the reset function worked fine but after a while, it starts transposing to a key near to the new transposed key.
Here is my code for reset function:
const [count, setCount] = useState(0)
function reset(){
setKey(key.transpose(-count))
song.lines.forEach(line => {
line.items.forEach(item => {
let chord = Chord.parse(item.chords)
if(chord){
chord = chord.transpose(count)
item.chords = chord
}
})
})
}
from chordsheetjs.
Nice @ashish-ch-98 !
from chordsheetjs.
Related Issues (20)
- Support for browser without regex lookbehind HOT 2
- SetCapo doesn't render chords properly HOT 2
- song.transpose not allowing to transpose to different keys with same distance HOT 2
- How to detect the current key? HOT 4
- ChordSheetJS with ChordProject HOT 3
- Contributing: error with yarn test (Windows) HOT 2
- Is it wrong to use Transpose in a song that modulates within a song? HOT 1
- Verse and Chorus (only) section labels incorrectly omitted if lower case (UG parser only) HOT 10
- Angular : error build HOT 3
- Add support for parsing minus sign (-) HOT 2
- Font handling : Add support for Non-Monospace fonts for converting to ChordPro HOT 10
- support of chordpro v6? HOT 4
- [Duplicate #955] Non-Monospace fonts support HOT 2
- Support for markup (Pango Markup Language)
- Support for annotations
- Support for delegates
- Add missing meta tags
- Support for conditional directives
- Usage in Angular 16 app results in: Cannot find module 'chord_sheet/item' or its corresponding type declarations. HOT 3
- UltimateGuitarParser to ChordProFormatter generates wrong output HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chordsheetjs.