JSPM

react-native-pitch-tracker-extended

0.4.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q38099F
  • License MIT

React Native Pitch Tracker implemented with Tensorflow Lite Model

Package Exports

  • react-native-pitch-tracker-extended
  • react-native-pitch-tracker-extended/lib/commonjs/index.js
  • react-native-pitch-tracker-extended/lib/module/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-pitch-tracker-extended) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-pitch-tracker-extended

NPM

React Native Pitch Tracker implemented with Tensorflow Lite Model

  • iOS/iPadOS Implementation
  • Android Implementation

Extended Changes

  • update kotlin plugin

Installation

npm install --save react-native-pitch-tracker react-native-permissions

Usage

Prerequisites (iOS/iPadOS)

  • First, Download this(Download Link : Onsets and Frames TFLite) Model.
  • After that, add this file to your XCode Project.
  • Double check that the file is successfully imported to project.
    • Check the .tflite model is in your Project File -> Build Phases -> Copy Bundle Resources
  • Open your project's Info.plist in XCode, and add NSMicrophoneUsageDescription row.
    • Or in other editor, add this row in the plist.
    <key>NSMicrophoneUsageDescription</key>
    <string>YOUR TEXT</string>
  • Open your project's Podfile and update with these lines.
target 'YourAwesomeProject' do

  # …

  permissions_path = '../node_modules/react-native-permissions/ios'

  pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone.podspec"

end

Prerequisites (Android)

  • Copy the downloaded file(tflite model) to {ProjDirectory}/android/app/src/main/assets.
  • After that, update the build.gradle
android {

    // …

    aaptOptions {
        noCompress "tflite"
    }
}

Usage in React Native Code

import PitchTracker from "react-native-pitch-tracker";

// ...

// Must do before start()
PitchTracker.prepare()

// Event Subscription (Add function to parameter)
PitchTracker.noteOn((res) => {
    console.log('Note On: ' + res['midiNum']);
}); // Note On: 60
PitchTracker.noteOff((res) => {
    console.log('Note Off: ' + res['midiNum']);
}); // Note Off: 60

// Start PitchTracker Engine
PitchTracker.start()

// Stop PitchTracker Engine
PitchTracker.stop()

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT