semvec/pypi-packages huggingface dataset:
pyTinySoundFont 0.0.1
Python port of TinySoundFont
Keywords: synthesizer soundfont sf2

pyTinySoundFont
================

This is Python porting of TinySoundFont(https://github.com/schellingb/TinySoundFont)

We are still relying on C++ for some sample level tasks, so a building process is needed (see below).

The "class TinySoundFont" interface defined in pyTinySoundFont/SF2SynthRT.py provides most of the original functions of TinySoundFont, with the following limitations:

* Loading SF2 from memory is not implemented
* "Higher level channel based functions" are not ported yet.
* Real-time playback is not part of the project, which needs a separate solution.

See test/testRT.py for a use case.

The "SynthNote()" defined in pyTinySoundFont/SF2Synth.py provides a simple interface for single note synthesis. See test/test.py for a use case.


## Building with CMake

Prerequisites:

* CMake 3.0+
* Python3

You can simply run CMake to generate makefiles/project files for your system and build. 
You can set CMAKE_INSTALL_PREFIX to /test so that the test scripts can find pyTinySoundFont.

## Building with Setuptools

	$ python3 setup.py build	
	$ python3 setup.py install

## Use cases

### Realtime Synthesis

Pretty similar to the C version

```Python

	import pyTinySoundFont as tsf

	g_TinySoundFont = tsf.TinySoundFont('florestan-subset.sf2')

	g_TinySoundFont.NoteOn(0,48,1.0) # C2
	g_TinySoundFont.NoteOn(0,52,1.0) # E2

	# We don't have an output device here, just open a file to simulate
	with open('dmp.raw','wb') as f:
		buf =  bytes(512 * 4 * 2) # create a buffer of 512 samples
		for i in range(200): # render 200 times to the buffer when notes are on
			g_TinySoundFont.Render(buf, 512, False)
			f.write(buf)
		
		g_TinySoundFont.NoteOffAll()
	
		for i in range(10): # render another 10 times after notes are off 
			g_TinySoundFont.Render(buf, 512, False)
			f.write(buf)
	

```

### Non-Realtime Synthesis

The use case is that sometimes we just want to render some preprogrammed notes to a buffer as soon as possible, and we don't need immediate play-back. In that case, we can render 1 note each time then blend them together. Bellow example shows how to render a single note.


```Python

	import wave
	import pyTinySoundFont as tsf
	
	sf2= tsf.LoadSF2('florestan-subset.sf2')
	presets = tsf.LoadPresets(sf2)
	
	# Render C5, required length is set to 2 seconds
	# The actual returned buffer will be a little longer than 2 seconds
	# There will some extra samples after the loop is ended
	res=tsf.SynthNote(sf2[1], presets[0], 60, 1.0, 44100*2)

	# Utility to convert float32 to short16
	wavS16=tsf.F32ToS16(res[1], 1.0)
	
	# Here we write the generated samples to a wav file
	# We can also program to mix the samples with other buffer
	with wave.open('out.wav', mode='wb') as wavFile:
		wavFile.setnchannels(2)
		wavFile.setsampwidth(2)
		wavFile.setframerate(44100)
		wavFile.setnframes(len(wavS16)//4)
		wavFile.writeframes(wavS16)

```

## License

pyTinySoundFont is available under the [MIT license](https://choosealicense.com/licenses/mit/).
molint 1.0.9
扫描py文件

#### 1、molint安装

pip install molint

#### 2、查看帮助信息

molint -h

usage: molint [-h] [--rp [RP]]

optional arguments:
  -h, --help  show this help message and exit
  --rp [RP]   代码路径

rp:需要扫描的项目根目录，可不填，不填时为当前目录


#### 3、使用

molint  扫描当前目录

molint --rp D:\aa  扫描D:\aa目录
setlipy 0.0.2
A simple Python wrapper for the setlist.fm API
Requires Python: >=3.7

<a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.7-green.svg"></a>
[![Documentation Status](https://readthedocs.org/projects/setlipy/badge/?version=latest)](https://setlipy.readthedocs.io/en/latest/?badge=latest)
<a target="_blank" href="LICENSE" title="License: MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
# Setlipy
A simple Python wrapper for the setlist.fm API

## Installation
```bash
pip install setlipy
```

## Quick Start
To get started, install setlipy, register a free account on https://www.setlist.fm/signup and apply for an API key on 
https://www.setlist.fm/settings/api
Add your API Key to your environment:

```python
# Get all setlists from an artist and a specific year. 
# Default as JSON file format.
from setlipy import client

sfm = client.Setlipy(auth="YOUR_API_KEY")

results = sfm.setlists(artist_name="The Rolling Stones", year="2022")

json_dump = (results.json())

for idx, setlists in enumerate(json_dump["setlist"]):
    print(idx, setlists)
```

Default file format is JSON. Use the following to request the data as XML:
```python
# Get all setlists from an artist and a specific year. 
# As XML file format.
import xml
import xml.etree.ElementTree as ET

from setlipy import client

sfm = client.Setlipy(file_format="xml", auth="YOUR_API_KEY")

results = sfm.setlists(artist_name="The Rolling Stones", year="2022")

string_xml = results.content
tree = xml.etree.ElementTree.fromstring(results.content)
print(xml.etree.ElementTree.dump(tree))
```

## Reporting Issues
I'm happy about any suggestions you might have. If you find bugs or other issues specific to this library, file them here. Or just send a pull request.

## License 
MIT © Setlipy Project
cnsyn 1.2.0
Query tools for Chinese Synonyms
Keywords: NLP,simwords,Chinese Synonyms

# Chinese-Synonyms
Chinese Synonyms 中文同义词查询工具包
Chinese Synonyms for Natural Language Processing and Understanding.

cnsyn
=====

"cnsyn"：Python 中文同义词查询工具组件

"cnsyn" : Python Query tools for Chinese Synonyms.

GitHub: https://github.com/shangfr/Chinese-Synonyms

特点
====

-  支持同义词查询
-  支持自定义词典 > 已删除
-  Apache License 2.0 授权协议

在线演示： 

安装说明
========

-  全自动安装：``pip install cnsyn``
-  半自动安装：先下载 https://pypi.python.org/pypi/cnsyn/ ，解压后运行 ``python setup.py install``
-  手动安装：将 cnsyn 目录放置于当前目录或者 site-packages 目录，通过 ``import cnsyn`` 来引用。


同义词库说明
========
- 1、wiki：通过维基百科构建的一个中文同义词库-AitSimwords.txt；
- 2、cndict：中文同义词字典-chinese_dictionary.txt；
- 3、words_id_emb: 基于[PaddleNLP](https://gitee.com/paddlepaddle/PaddleNLP) TokenEmbedding的预训练模型获取的词向量，合并wiki、cndict词库，共计129691个词； 

查询原理
========
- 基于词的传统召回
    基于倒排索引，当用户输入查询词后，根据该词到倒排索引中进行查找该词的同义词。
    
- 基于向量的语义召回
    基于KNN-BallTree算法，找出某一个词向量最相近的词集合；

代码示例
========
```python
# encoding=utf-8

import cnsyn

# 查询同义词（全部词库）
word = '垃圾'
cnsyn.search(word)
cnsyn.search(word,topK=3)
# 使用wiki词库
cnsyn.search(word, origin='wiki')
# 使用中文同义词字典库
cnsyn.search(word, origin='cndict')

# 基于向量的语义召回Approximate Nearest Neighbor Search 
cnsyn.anns(word)
cnsyn.anns(word,topK=3)

```